From 98333e807b28ef5df3a223eaf47a5f0f4dfb3a03 Mon Sep 17 00:00:00 2001 From: KambleSonam Date: Mon, 6 May 2024 11:54:48 +0530 Subject: [PATCH 01/19] Added Page Builder logic --- clevertap.js | 7812 ++++++++++------------ clevertap.js.map | 2 +- clevertap.min.js | 2 +- src/clevertap.js | 16 + src/modules/visualBuilder/pageBuilder.js | 144 + src/util/tr.js | 76 + 6 files changed, 3891 insertions(+), 4161 deletions(-) create mode 100644 src/modules/visualBuilder/pageBuilder.js diff --git a/clevertap.js b/clevertap.js index 6e5d657d..c75175c1 100644 --- a/clevertap.js +++ b/clevertap.js @@ -4,317 +4,6 @@ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.clevertap = factory()); }(this, (function () { 'use strict'; - function _typeof(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof = function (obj) { - return typeof obj; - }; - } else { - _typeof = function (obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - - return _typeof(obj); - } - - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } - - function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; - } - - function ownKeys(object, enumerableOnly) { - var keys = Object.keys(object); - - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(object); - if (enumerableOnly) symbols = symbols.filter(function (sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - }); - keys.push.apply(keys, symbols); - } - - return keys; - } - - function _objectSpread2(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? arguments[i] : {}; - - if (i % 2) { - ownKeys(Object(source), true).forEach(function (key) { - _defineProperty(target, key, source[key]); - }); - } else if (Object.getOwnPropertyDescriptors) { - Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); - } else { - ownKeys(Object(source)).forEach(function (key) { - Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); - }); - } - } - - return target; - } - - function _inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); - } - - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - - return _setPrototypeOf(o, p); - } - - function _isNativeReflectConstruct() { - if (typeof Reflect === "undefined" || !Reflect.construct) return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === "function") return true; - - try { - Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); - return true; - } catch (e) { - return false; - } - } - - function _construct(Parent, args, Class) { - if (_isNativeReflectConstruct()) { - _construct = Reflect.construct; - } else { - _construct = function _construct(Parent, args, Class) { - var a = [null]; - a.push.apply(a, args); - var Constructor = Function.bind.apply(Parent, a); - var instance = new Constructor(); - if (Class) _setPrototypeOf(instance, Class.prototype); - return instance; - }; - } - - return _construct.apply(null, arguments); - } - - function _isNativeFunction(fn) { - return Function.toString.call(fn).indexOf("[native code]") !== -1; - } - - function _wrapNativeSuper(Class) { - var _cache = typeof Map === "function" ? new Map() : undefined; - - _wrapNativeSuper = function _wrapNativeSuper(Class) { - if (Class === null || !_isNativeFunction(Class)) return Class; - - if (typeof Class !== "function") { - throw new TypeError("Super expression must either be null or a function"); - } - - if (typeof _cache !== "undefined") { - if (_cache.has(Class)) return _cache.get(Class); - - _cache.set(Class, Wrapper); - } - - function Wrapper() { - return _construct(Class, arguments, _getPrototypeOf(this).constructor); - } - - Wrapper.prototype = Object.create(Class.prototype, { - constructor: { - value: Wrapper, - enumerable: false, - writable: true, - configurable: true - } - }); - return _setPrototypeOf(Wrapper, Class); - }; - - return _wrapNativeSuper(Class); - } - - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - - return self; - } - - function _possibleConstructorReturn(self, call) { - if (call && (typeof call === "object" || typeof call === "function")) { - return call; - } - - return _assertThisInitialized(self); - } - - function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf(this).constructor; - - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - - return _possibleConstructorReturn(this, result); - }; - } - - function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); - } - - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) return _arrayLikeToArray(arr); - } - - function _iterableToArray(iter) { - if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); - } - - function _unsupportedIterableToArray(o, minLen) { - if (!o) return; - if (typeof o === "string") return _arrayLikeToArray(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) n = o.constructor.name; - if (n === "Map" || n === "Set") return Array.from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); - } - - function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) len = arr.length; - - for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; - - return arr2; - } - - function _nonIterableSpread() { - throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - - function _createForOfIteratorHelper(o, allowArrayLike) { - var it; - - if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { - if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - var i = 0; - - var F = function () {}; - - return { - s: F, - n: function () { - if (i >= o.length) return { - done: true - }; - return { - done: false, - value: o[i++] - }; - }, - e: function (e) { - throw e; - }, - f: F - }; - } - - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - - var normalCompletion = true, - didErr = false, - err; - return { - s: function () { - it = o[Symbol.iterator](); - }, - n: function () { - var step = it.next(); - normalCompletion = step.done; - return step; - }, - e: function (e) { - didErr = true; - err = e; - }, - f: function () { - try { - if (!normalCompletion && it.return != null) it.return(); - } finally { - if (didErr) throw err; - } - } - }; - } - var id = 0; function _classPrivateFieldLooseKey(name) { @@ -329,9 +18,9 @@ return receiver; } - var TARGET_DOMAIN = 'clevertap-prod.com'; - var TARGET_PROTOCOL = 'https:'; - var DEFAULT_REGION = 'eu1'; + const TARGET_DOMAIN = 'clevertap-prod.com'; + const TARGET_PROTOCOL = 'https:'; + const DEFAULT_REGION = 'eu1'; var _accountId = _classPrivateFieldLooseKey("accountId"); @@ -343,17 +32,14 @@ var _token = _classPrivateFieldLooseKey("token"); - var Account = /*#__PURE__*/function () { - function Account() { - var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, - id = _ref.id; - - var region = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; - var targetDomain = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : TARGET_DOMAIN; - var token = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ''; - - _classCallCheck(this, Account); - + class Account { + constructor() { + let { + id + } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + let region = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + let targetDomain = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : TARGET_DOMAIN; + let token = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ''; Object.defineProperty(this, _accountId, { writable: true, value: void 0 @@ -389,159 +75,151 @@ } } - _createClass(Account, [{ - key: "id", - get: function get() { - return _classPrivateFieldLooseBase(this, _accountId)[_accountId]; - }, - set: function set(accountId) { - _classPrivateFieldLooseBase(this, _accountId)[_accountId] = accountId; - } - }, { - key: "region", - get: function get() { - return _classPrivateFieldLooseBase(this, _region)[_region]; - }, - set: function set(region) { - _classPrivateFieldLooseBase(this, _region)[_region] = region; - } - }, { - key: "dcSDKVersion", - get: function get() { - return _classPrivateFieldLooseBase(this, _dcSdkversion)[_dcSdkversion]; - }, - set: function set(dcSDKVersion) { - _classPrivateFieldLooseBase(this, _dcSdkversion)[_dcSdkversion] = dcSDKVersion; - } - }, { - key: "targetDomain", - get: function get() { - return _classPrivateFieldLooseBase(this, _targetDomain)[_targetDomain]; - }, - set: function set(targetDomain) { - _classPrivateFieldLooseBase(this, _targetDomain)[_targetDomain] = targetDomain; + get id() { + return _classPrivateFieldLooseBase(this, _accountId)[_accountId]; + } + + set id(accountId) { + _classPrivateFieldLooseBase(this, _accountId)[_accountId] = accountId; + } + + get region() { + return _classPrivateFieldLooseBase(this, _region)[_region]; + } + + set region(region) { + _classPrivateFieldLooseBase(this, _region)[_region] = region; + } + + get dcSDKVersion() { + return _classPrivateFieldLooseBase(this, _dcSdkversion)[_dcSdkversion]; + } + + set dcSDKVersion(dcSDKVersion) { + _classPrivateFieldLooseBase(this, _dcSdkversion)[_dcSdkversion] = dcSDKVersion; + } + + get targetDomain() { + return _classPrivateFieldLooseBase(this, _targetDomain)[_targetDomain]; + } + + set targetDomain(targetDomain) { + _classPrivateFieldLooseBase(this, _targetDomain)[_targetDomain] = targetDomain; + } + + get token() { + return _classPrivateFieldLooseBase(this, _token)[_token]; + } + + set token(token) { + _classPrivateFieldLooseBase(this, _token)[_token] = token; + } + + get finalTargetDomain() { + if (this.region) { + return "".concat(this.region, ".").concat(this.targetDomain); + } else { + if (this.targetDomain === TARGET_DOMAIN) { + return "".concat(DEFAULT_REGION, ".").concat(this.targetDomain); + } + + return this.targetDomain; } - }, { - key: "token", - get: function get() { - return _classPrivateFieldLooseBase(this, _token)[_token]; - }, - set: function set(token) { - _classPrivateFieldLooseBase(this, _token)[_token] = token; - } - }, { - key: "finalTargetDomain", - get: function get() { - if (this.region) { - return "".concat(this.region, ".").concat(this.targetDomain); - } else { - if (this.targetDomain === TARGET_DOMAIN) { - return "".concat(DEFAULT_REGION, ".").concat(this.targetDomain); - } + } + + get dataPostPEURL() { + return "".concat(TARGET_PROTOCOL, "//").concat(this.finalTargetDomain, "/defineVars"); + } + + get dataPostURL() { + return "".concat(TARGET_PROTOCOL, "//").concat(this.finalTargetDomain, "/a?t=96"); + } + + get recorderURL() { + return "".concat(TARGET_PROTOCOL, "//").concat(this.finalTargetDomain, "/r?r=1"); + } + + get emailURL() { + return "".concat(TARGET_PROTOCOL, "//").concat(this.finalTargetDomain, "/e?r=1"); + } - return this.targetDomain; - } - } - }, { - key: "dataPostPEURL", - get: function get() { - return "".concat(TARGET_PROTOCOL, "//").concat(this.finalTargetDomain, "/defineVars"); - } - }, { - key: "dataPostURL", - get: function get() { - return "".concat(TARGET_PROTOCOL, "//").concat(this.finalTargetDomain, "/a?t=96"); - } - }, { - key: "recorderURL", - get: function get() { - return "".concat(TARGET_PROTOCOL, "//").concat(this.finalTargetDomain, "/r?r=1"); - } - }, { - key: "emailURL", - get: function get() { - return "".concat(TARGET_PROTOCOL, "//").concat(this.finalTargetDomain, "/e?r=1"); - } - }]); - - return Account; - }(); - - var unsupportedKeyCharRegex = new RegExp('^\\s+|\\\.|\:|\\\$|\'|\"|\\\\|\\s+$', 'g'); - var unsupportedValueCharRegex = new RegExp("^\\s+|\'|\"|\\\\|\\s+$", 'g'); - var singleQuoteRegex = new RegExp('\'', 'g'); - var CLEAR = 'clear'; - var CHARGED_ID = 'Charged ID'; - var CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'; - var GCOOKIE_NAME = 'WZRK_G'; - var KCOOKIE_NAME = 'WZRK_K'; - var CAMP_COOKIE_NAME = 'WZRK_CAMP'; - var CAMP_COOKIE_G = 'WZRK_CAMP_G'; // cookie for storing campaign details against guid - - var SCOOKIE_PREFIX = 'WZRK_S'; - var SCOOKIE_EXP_TIME_IN_SECS = 60 * 20; // 20 mins - - var EV_COOKIE = 'WZRK_EV'; - var META_COOKIE = 'WZRK_META'; - var PR_COOKIE = 'WZRK_PR'; - var ARP_COOKIE = 'WZRK_ARP'; - var LCOOKIE_NAME = 'WZRK_L'; - var GLOBAL = 'global'; // used for email unsubscribe also - var DISPLAY = 'display'; - var WEBPUSH_LS_KEY = 'WZRK_WPR'; - var OPTOUT_KEY = 'optOut'; - var CT_OPTOUT_KEY = 'ct_optout'; - var OPTOUT_COOKIE_ENDSWITH = ':OO'; - var USEIP_KEY = 'useIP'; - var LRU_CACHE = 'WZRK_X'; - var LRU_CACHE_SIZE = 100; - var IS_OUL = 'isOUL'; - var EVT_PUSH = 'push'; - var EVT_PING = 'ping'; - var COOKIE_EXPIRY = 86400 * 365; // 1 Year in seconds - - var MAX_TRIES = 200; // API tries - - var FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000; // 2 mins - - var CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000; // 5 mins - - var GROUP_SUBSCRIPTION_REQUEST_ID = '2'; - var categoryLongKey = 'cUsY'; - var WZRK_PREFIX = 'wzrk_'; - var WZRK_ID = 'wzrk_id'; - var NOTIFICATION_VIEWED = 'Notification Viewed'; - var NOTIFICATION_CLICKED = 'Notification Clicked'; - var FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'; - var PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD'; // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN - - var COMMAND_INCREMENT = '$incr'; - var COMMAND_DECREMENT = '$decr'; - var COMMAND_SET = '$set'; - var COMMAND_ADD = '$add'; - var COMMAND_REMOVE = '$remove'; - var COMMAND_DELETE = '$delete'; - var WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'; - var WEBINBOX = 'WZRK_INBOX'; - var MAX_INBOX_MSG = 15; - var VARIABLES = 'WZRK_PE'; - var PUSH_DELAY_MS = 1000; - var MAX_DELAY_FREQUENCY = 1000 * 60 * 10; - var WZRK_FETCH = 'wzrk_fetch'; - var SYSTEM_EVENTS = ['Stayed', 'UTM Visited', 'App Launched', 'Notification Sent', NOTIFICATION_VIEWED, NOTIFICATION_CLICKED]; - - var isString = function isString(input) { + } + + const unsupportedKeyCharRegex = new RegExp('^\\s+|\\\.|\:|\\\$|\'|\"|\\\\|\\s+$', 'g'); + const unsupportedValueCharRegex = new RegExp("^\\s+|\'|\"|\\\\|\\s+$", 'g'); + const singleQuoteRegex = new RegExp('\'', 'g'); + const CLEAR = 'clear'; + const CHARGED_ID = 'Charged ID'; + const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'; + const GCOOKIE_NAME = 'WZRK_G'; + const KCOOKIE_NAME = 'WZRK_K'; + const CAMP_COOKIE_NAME = 'WZRK_CAMP'; + const CAMP_COOKIE_G = 'WZRK_CAMP_G'; // cookie for storing campaign details against guid + + const SCOOKIE_PREFIX = 'WZRK_S'; + const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20; // 20 mins + + const EV_COOKIE = 'WZRK_EV'; + const META_COOKIE = 'WZRK_META'; + const PR_COOKIE = 'WZRK_PR'; + const ARP_COOKIE = 'WZRK_ARP'; + const LCOOKIE_NAME = 'WZRK_L'; + const GLOBAL = 'global'; // used for email unsubscribe also + const DISPLAY = 'display'; + const WEBPUSH_LS_KEY = 'WZRK_WPR'; + const OPTOUT_KEY = 'optOut'; + const CT_OPTOUT_KEY = 'ct_optout'; + const OPTOUT_COOKIE_ENDSWITH = ':OO'; + const USEIP_KEY = 'useIP'; + const LRU_CACHE = 'WZRK_X'; + const LRU_CACHE_SIZE = 100; + const IS_OUL = 'isOUL'; + const EVT_PUSH = 'push'; + const EVT_PING = 'ping'; + const COOKIE_EXPIRY = 86400 * 365; // 1 Year in seconds + + const MAX_TRIES = 200; // API tries + + const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000; // 2 mins + + const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000; // 5 mins + + const GROUP_SUBSCRIPTION_REQUEST_ID = '2'; + const categoryLongKey = 'cUsY'; + const WZRK_PREFIX = 'wzrk_'; + const WZRK_ID = 'wzrk_id'; + const NOTIFICATION_VIEWED = 'Notification Viewed'; + const NOTIFICATION_CLICKED = 'Notification Clicked'; + const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'; + const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD'; // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN + + const COMMAND_INCREMENT = '$incr'; + const COMMAND_DECREMENT = '$decr'; + const COMMAND_SET = '$set'; + const COMMAND_ADD = '$add'; + const COMMAND_REMOVE = '$remove'; + const COMMAND_DELETE = '$delete'; + const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'; + const WEBINBOX = 'WZRK_INBOX'; + const MAX_INBOX_MSG = 15; + const VARIABLES = 'WZRK_PE'; + const PUSH_DELAY_MS = 1000; + const MAX_DELAY_FREQUENCY = 1000 * 60 * 10; + const WZRK_FETCH = 'wzrk_fetch'; + const SYSTEM_EVENTS = ['Stayed', 'UTM Visited', 'App Launched', 'Notification Sent', NOTIFICATION_VIEWED, NOTIFICATION_CLICKED]; + + const isString = input => { return typeof input === 'string' || input instanceof String; }; - var isObject = function isObject(input) { + const isObject = input => { // TODO: refine return Object.prototype.toString.call(input) === '[object Object]'; }; - var isDateObject = function isDateObject(input) { - return _typeof(input) === 'object' && input instanceof Date; + const isDateObject = input => { + return typeof input === 'object' && input instanceof Date; }; - var isObjectEmpty = function isObjectEmpty(obj) { - for (var prop in obj) { + const isObjectEmpty = obj => { + for (const prop in obj) { if (obj.hasOwnProperty(prop)) { return false; } @@ -549,26 +227,26 @@ return true; }; - var isConvertibleToNumber = function isConvertibleToNumber(n) { + const isConvertibleToNumber = n => { return !isNaN(parseFloat(n)) && isFinite(n); }; - var isNumber = function isNumber(n) { + const isNumber = n => { return /^-?[\d.]+(?:e-?\d+)?$/.test(n) && typeof n === 'number'; }; - var isValueValid = function isValueValid(value) { + const isValueValid = value => { if (value === null || value === undefined || value === 'undefined') { return false; } return true; }; - var removeUnsupportedChars = function removeUnsupportedChars(o, logger) { + const removeUnsupportedChars = (o, logger) => { // keys can't be greater than 1024 chars, values can't be greater than 1024 chars - if (_typeof(o) === 'object') { - for (var key in o) { + if (typeof o === 'object') { + for (const key in o) { if (o.hasOwnProperty(key)) { - var sanitizedVal = removeUnsupportedChars(o[key], logger); - var sanitizedKey = void 0; + const sanitizedVal = removeUnsupportedChars(o[key], logger); + let sanitizedKey; sanitizedKey = sanitize(key, unsupportedKeyCharRegex); if (sanitizedKey.length > 1024) { @@ -581,7 +259,7 @@ } } } else { - var val; + let val; if (isString(o)) { val = sanitize(o, unsupportedValueCharRegex); @@ -599,324 +277,301 @@ return o; }; - var sanitize = function sanitize(input, regex) { + const sanitize = (input, regex) => { return input.replace(regex, ''); }; - var getToday = function getToday() { - var today = new Date(); + const getToday = () => { + const today = new Date(); return today.getFullYear() + '' + today.getMonth() + '' + today.getDay(); }; - var getNow = function getNow() { + const getNow = () => { return Math.floor(new Date().getTime() / 1000); }; - var convertToWZRKDate = function convertToWZRKDate(dateObj) { + const convertToWZRKDate = dateObj => { return '$D_' + Math.round(dateObj.getTime() / 1000); }; - var setDate = function setDate(dt) { + const setDate = dt => { // expecting yyyymmdd format either as a number or a string if (isDateValid(dt)) { return '$D_' + dt; } }; - var isDateValid = function isDateValid(date) { - var matches = /^(\d{4})(\d{2})(\d{2})$/.exec(date); + const isDateValid = date => { + const matches = /^(\d{4})(\d{2})(\d{2})$/.exec(date); if (matches == null) return false; - var d = matches[3]; - var m = matches[2] - 1; - var y = matches[1]; - var composedDate = new Date(y, m, d); // eslint-disable-next-line eqeqeq + const d = matches[3]; + const m = matches[2] - 1; + const y = matches[1]; + const composedDate = new Date(y, m, d); // eslint-disable-next-line eqeqeq return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y; }; - var StorageManager = /*#__PURE__*/function () { - function StorageManager() { - _classCallCheck(this, StorageManager); - } + class StorageManager { + static save(key, value) { + if (!key || !value) { + return false; + } - _createClass(StorageManager, null, [{ - key: "save", - value: function save(key, value) { - if (!key || !value) { - return false; - } + if (this._isLocalStorageSupported()) { + localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value)); + return true; + } + } - if (this._isLocalStorageSupported()) { - localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value)); - return true; - } + static read(key) { + if (!key) { + return false; } - }, { - key: "read", - value: function read(key) { - if (!key) { - return false; - } - var data = null; + let data = null; - if (this._isLocalStorageSupported()) { - data = localStorage.getItem(key); - } + if (this._isLocalStorageSupported()) { + data = localStorage.getItem(key); + } - if (data != null) { - try { - data = JSON.parse(data); - } catch (e) {} - } + if (data != null) { + try { + data = JSON.parse(data); + } catch (e) {} + } - return data; + return data; + } + + static remove(key) { + if (!key) { + return false; } - }, { - key: "remove", - value: function remove(key) { - if (!key) { - return false; - } - if (this._isLocalStorageSupported()) { - localStorage.removeItem(key); - return true; - } + if (this._isLocalStorageSupported()) { + localStorage.removeItem(key); + return true; } - }, { - key: "removeCookie", - value: function removeCookie(name, domain) { - var cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'; + } - if (domain) { - cookieStr = cookieStr + ' domain=' + domain + '; path=/'; - } + static removeCookie(name, domain) { + let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'; - document.cookie = cookieStr; + if (domain) { + cookieStr = cookieStr + ' domain=' + domain + '; path=/'; } - }, { - key: "createCookie", - value: function createCookie(name, value, seconds, domain) { - var expires = ''; - var domainStr = ''; - if (seconds) { - var date = new Date(); - date.setTime(date.getTime() + seconds * 1000); - expires = '; expires=' + date.toGMTString(); - } + document.cookie = cookieStr; + } - if (domain) { - domainStr = '; domain=' + domain; - } + static createCookie(name, value, seconds, domain) { + let expires = ''; + let domainStr = ''; - value = encodeURIComponent(value); - document.cookie = name + '=' + value + expires + domainStr + '; path=/'; + if (seconds) { + const date = new Date(); + date.setTime(date.getTime() + seconds * 1000); + expires = '; expires=' + date.toGMTString(); } - }, { - key: "readCookie", - value: function readCookie(name) { - var nameEQ = name + '='; - var ca = document.cookie.split(';'); - for (var idx = 0; idx < ca.length; idx++) { - var c = ca[idx]; + if (domain) { + domainStr = '; domain=' + domain; + } - while (c.charAt(0) === ' ') { - c = c.substring(1, c.length); - } // eslint-disable-next-line eqeqeq + value = encodeURIComponent(value); + document.cookie = name + '=' + value + expires + domainStr + '; path=/'; + } + static readCookie(name) { + const nameEQ = name + '='; + const ca = document.cookie.split(';'); - if (c.indexOf(nameEQ) == 0) { - return decodeURIComponent(c.substring(nameEQ.length, c.length)); - } - } + for (let idx = 0; idx < ca.length; idx++) { + let c = ca[idx]; - return null; + while (c.charAt(0) === ' ') { + c = c.substring(1, c.length); + } // eslint-disable-next-line eqeqeq + + + if (c.indexOf(nameEQ) == 0) { + return decodeURIComponent(c.substring(nameEQ.length, c.length)); + } } - }, { - key: "_isLocalStorageSupported", - value: function _isLocalStorageSupported() { - return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'; + + return null; + } + + static _isLocalStorageSupported() { + return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'; + } + + static saveToLSorCookie(property, value) { + if (value == null) { + return; } - }, { - key: "saveToLSorCookie", - value: function saveToLSorCookie(property, value) { - if (value == null) { - return; - } - try { - if (this._isLocalStorageSupported()) { - this.save(property, encodeURIComponent(JSON.stringify(value))); + try { + if (this._isLocalStorageSupported()) { + this.save(property, encodeURIComponent(JSON.stringify(value))); + } else { + if (property === GCOOKIE_NAME) { + this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname); } else { - if (property === GCOOKIE_NAME) { - this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname); - } else { - this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname); - } + this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname); } + } - $ct.globalCache[property] = value; - } catch (e) {} + $ct.globalCache[property] = value; + } catch (e) {} + } + + static readFromLSorCookie(property) { + let data; + + if ($ct.globalCache.hasOwnProperty(property)) { + return $ct.globalCache[property]; } - }, { - key: "readFromLSorCookie", - value: function readFromLSorCookie(property) { - var data; - if ($ct.globalCache.hasOwnProperty(property)) { - return $ct.globalCache[property]; - } + if (this._isLocalStorageSupported()) { + data = this.read(property); + } else { + data = this.readCookie(property); + } - if (this._isLocalStorageSupported()) { - data = this.read(property); - } else { - data = this.readCookie(property); - } + if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) { + let value; - if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) { - var value; + try { + value = JSON.parse(decodeURIComponent(data)); + } catch (err) { + value = decodeURIComponent(data); + } - try { - value = JSON.parse(decodeURIComponent(data)); - } catch (err) { - value = decodeURIComponent(data); - } + $ct.globalCache[property] = value; + return value; + } + } - $ct.globalCache[property] = value; - return value; - } - } - }, { - key: "createBroadCookie", - value: function createBroadCookie(name, value, seconds, domain) { - // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on ".bar.com" - // To update an existing "broad domain" cookie, we need to know what domain it was actually set on. - // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie - // to find out which "broadest" domain the cookie was set on. Then delete the test cookie, and use that domain - // for updating the actual cookie. - if (domain) { - var broadDomain = $ct.broadDomain; - - if (broadDomain == null) { - // if we don't know the broadDomain yet, then find out - var domainParts = domain.split('.'); - var testBroadDomain = ''; - - for (var idx = domainParts.length - 1; idx >= 0; idx--) { - if (idx === 0) { - testBroadDomain = domainParts[idx] + testBroadDomain; - } else { - testBroadDomain = '.' + domainParts[idx] + testBroadDomain; - } // only needed if the cookie already exists and needs to be updated. See note above. + static createBroadCookie(name, value, seconds, domain) { + // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on ".bar.com" + // To update an existing "broad domain" cookie, we need to know what domain it was actually set on. + // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie + // to find out which "broadest" domain the cookie was set on. Then delete the test cookie, and use that domain + // for updating the actual cookie. + if (domain) { + let broadDomain = $ct.broadDomain; + + if (broadDomain == null) { + // if we don't know the broadDomain yet, then find out + const domainParts = domain.split('.'); + let testBroadDomain = ''; + + for (let idx = domainParts.length - 1; idx >= 0; idx--) { + if (idx === 0) { + testBroadDomain = domainParts[idx] + testBroadDomain; + } else { + testBroadDomain = '.' + domainParts[idx] + testBroadDomain; + } // only needed if the cookie already exists and needs to be updated. See note above. - if (this.readCookie(name)) { - // no guarantee that browser will delete cookie, hence create short lived cookies - var testCookieName = 'test_' + name + idx; - this.createCookie(testCookieName, value, 10, testBroadDomain); // self-destruct after 10 seconds + if (this.readCookie(name)) { + // no guarantee that browser will delete cookie, hence create short lived cookies + var testCookieName = 'test_' + name + idx; + this.createCookie(testCookieName, value, 10, testBroadDomain); // self-destruct after 10 seconds - if (!this.readCookie(testCookieName)) { - // if test cookie not set, then the actual cookie wouldn't have been set on this domain either. - continue; - } else { - // else if cookie set, then delete the test and the original cookie - this.removeCookie(testCookieName, testBroadDomain); - } + if (!this.readCookie(testCookieName)) { + // if test cookie not set, then the actual cookie wouldn't have been set on this domain either. + continue; + } else { + // else if cookie set, then delete the test and the original cookie + this.removeCookie(testCookieName, testBroadDomain); } + } - this.createCookie(name, value, seconds, testBroadDomain); - var tempCookie = this.readCookie(name); // eslint-disable-next-line eqeqeq + this.createCookie(name, value, seconds, testBroadDomain); + const tempCookie = this.readCookie(name); // eslint-disable-next-line eqeqeq - if (tempCookie == value) { - broadDomain = testBroadDomain; - $ct.broadDomain = broadDomain; - break; - } + if (tempCookie == value) { + broadDomain = testBroadDomain; + $ct.broadDomain = broadDomain; + break; } - } else { - this.createCookie(name, value, seconds, broadDomain); } } else { - this.createCookie(name, value, seconds, domain); + this.createCookie(name, value, seconds, broadDomain); } + } else { + this.createCookie(name, value, seconds, domain); } - }, { - key: "getMetaProp", - value: function getMetaProp(property) { - var metaObj = this.readFromLSorCookie(META_COOKIE); + } - if (metaObj != null) { - return metaObj[property]; - } + static getMetaProp(property) { + const metaObj = this.readFromLSorCookie(META_COOKIE); + + if (metaObj != null) { + return metaObj[property]; } - }, { - key: "setMetaProp", - value: function setMetaProp(property, value) { - if (this._isLocalStorageSupported()) { - var wzrkMetaObj = this.readFromLSorCookie(META_COOKIE); + } - if (wzrkMetaObj == null) { - wzrkMetaObj = {}; - } + static setMetaProp(property, value) { + if (this._isLocalStorageSupported()) { + let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE); - if (value === undefined) { - delete wzrkMetaObj[property]; - } else { - wzrkMetaObj[property] = value; - } + if (wzrkMetaObj == null) { + wzrkMetaObj = {}; + } - this.saveToLSorCookie(META_COOKIE, wzrkMetaObj); + if (value === undefined) { + delete wzrkMetaObj[property]; + } else { + wzrkMetaObj[property] = value; } + + this.saveToLSorCookie(META_COOKIE, wzrkMetaObj); } - }, { - key: "getAndClearMetaProp", - value: function getAndClearMetaProp(property) { - var value = this.getMetaProp(property); - this.setMetaProp(property, undefined); - return value; - } - }, { - key: "setInstantDeleteFlagInK", - value: function setInstantDeleteFlagInK() { - var k = this.readFromLSorCookie(KCOOKIE_NAME); + } - if (k == null) { - k = {}; - } + static getAndClearMetaProp(property) { + const value = this.getMetaProp(property); + this.setMetaProp(property, undefined); + return value; + } - k.flag = true; - this.saveToLSorCookie(KCOOKIE_NAME, k); + static setInstantDeleteFlagInK() { + let k = this.readFromLSorCookie(KCOOKIE_NAME); + + if (k == null) { + k = {}; } - }, { - key: "backupEvent", - value: function backupEvent(data, reqNo, logger) { - var backupArr = this.readFromLSorCookie(LCOOKIE_NAME); - if (typeof backupArr === 'undefined') { - backupArr = {}; - } + k.flag = true; + this.saveToLSorCookie(KCOOKIE_NAME, k); + } - backupArr[reqNo] = { - q: data - }; - this.saveToLSorCookie(LCOOKIE_NAME, backupArr); - logger.debug("stored in ".concat(LCOOKIE_NAME, " reqNo : ").concat(reqNo, " -> ").concat(data)); + static backupEvent(data, reqNo, logger) { + let backupArr = this.readFromLSorCookie(LCOOKIE_NAME); + + if (typeof backupArr === 'undefined') { + backupArr = {}; } - }, { - key: "removeBackup", - value: function removeBackup(respNo, logger) { - var backupMap = this.readFromLSorCookie(LCOOKIE_NAME); - if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') { - logger.debug("del event: ".concat(respNo, " data-> ").concat(backupMap[respNo].q)); - delete backupMap[respNo]; - this.saveToLSorCookie(LCOOKIE_NAME, backupMap); - } + backupArr[reqNo] = { + q: data + }; + this.saveToLSorCookie(LCOOKIE_NAME, backupArr); + logger.debug("stored in ".concat(LCOOKIE_NAME, " reqNo : ").concat(reqNo, " -> ").concat(data)); + } + + static removeBackup(respNo, logger) { + const backupMap = this.readFromLSorCookie(LCOOKIE_NAME); + + if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') { + logger.debug("del event: ".concat(respNo, " data-> ").concat(backupMap[respNo].q)); + delete backupMap[respNo]; + this.saveToLSorCookie(LCOOKIE_NAME, backupMap); } - }]); + } - return StorageManager; - }(); - var $ct = { + } + const $ct = { globalCache: { gcookie: null, REQ_N: 0, @@ -956,10 +611,8 @@ var _deleteFromObject = _classPrivateFieldLooseKey("deleteFromObject"); - var LRUCache = /*#__PURE__*/function () { - function LRUCache(max) { - _classCallCheck(this, LRUCache); - + class LRUCache { + constructor(max) { Object.defineProperty(this, _deleteFromObject, { value: _deleteFromObject2 }); @@ -968,14 +621,14 @@ value: void 0 }); this.max = max; - var lruCache = StorageManager.readFromLSorCookie(LRU_CACHE); + let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE); if (lruCache) { - var tempLruCache = {}; + const tempLruCache = {}; _classPrivateFieldLooseBase(this, _keyOrder)[_keyOrder] = []; lruCache = lruCache.cache; - for (var entry in lruCache) { + for (const entry in lruCache) { if (lruCache.hasOwnProperty(entry)) { tempLruCache[lruCache[entry][0]] = lruCache[entry][1]; @@ -990,112 +643,103 @@ } } - _createClass(LRUCache, [{ - key: "get", - value: function get(key) { - var item = this.cache[key]; - - if (item) { - this.cache = _classPrivateFieldLooseBase(this, _deleteFromObject)[_deleteFromObject](key, this.cache); - this.cache[key] = item; + get(key) { + const item = this.cache[key]; - _classPrivateFieldLooseBase(this, _keyOrder)[_keyOrder].push(key); - } + if (item) { + this.cache = _classPrivateFieldLooseBase(this, _deleteFromObject)[_deleteFromObject](key, this.cache); + this.cache[key] = item; - this.saveCacheToLS(this.cache); - return item; + _classPrivateFieldLooseBase(this, _keyOrder)[_keyOrder].push(key); } - }, { - key: "set", - value: function set(key, value) { - var item = this.cache[key]; - var allKeys = _classPrivateFieldLooseBase(this, _keyOrder)[_keyOrder]; + this.saveCacheToLS(this.cache); + return item; + } - if (item != null) { - this.cache = _classPrivateFieldLooseBase(this, _deleteFromObject)[_deleteFromObject](key, this.cache); - } else if (allKeys.length === this.max) { - this.cache = _classPrivateFieldLooseBase(this, _deleteFromObject)[_deleteFromObject](allKeys[0], this.cache); - } + set(key, value) { + const item = this.cache[key]; - this.cache[key] = value; + const allKeys = _classPrivateFieldLooseBase(this, _keyOrder)[_keyOrder]; - if (_classPrivateFieldLooseBase(this, _keyOrder)[_keyOrder][_classPrivateFieldLooseBase(this, _keyOrder)[_keyOrder] - 1] !== key) { - _classPrivateFieldLooseBase(this, _keyOrder)[_keyOrder].push(key); - } + if (item != null) { + this.cache = _classPrivateFieldLooseBase(this, _deleteFromObject)[_deleteFromObject](key, this.cache); + } else if (allKeys.length === this.max) { + this.cache = _classPrivateFieldLooseBase(this, _deleteFromObject)[_deleteFromObject](allKeys[0], this.cache); + } + + this.cache[key] = value; - this.saveCacheToLS(this.cache); + if (_classPrivateFieldLooseBase(this, _keyOrder)[_keyOrder][_classPrivateFieldLooseBase(this, _keyOrder)[_keyOrder] - 1] !== key) { + _classPrivateFieldLooseBase(this, _keyOrder)[_keyOrder].push(key); } - }, { - key: "saveCacheToLS", - value: function saveCacheToLS(cache) { - var objToArray = []; - var allKeys = _classPrivateFieldLooseBase(this, _keyOrder)[_keyOrder]; + this.saveCacheToLS(this.cache); + } - for (var index in allKeys) { - if (allKeys.hasOwnProperty(index)) { - var temp = []; - temp.push(allKeys[index]); - temp.push(cache[allKeys[index]]); - objToArray.push(temp); - } + saveCacheToLS(cache) { + const objToArray = []; + + const allKeys = _classPrivateFieldLooseBase(this, _keyOrder)[_keyOrder]; + + for (const index in allKeys) { + if (allKeys.hasOwnProperty(index)) { + const temp = []; + temp.push(allKeys[index]); + temp.push(cache[allKeys[index]]); + objToArray.push(temp); } + } - StorageManager.saveToLSorCookie(LRU_CACHE, { - cache: objToArray - }); + StorageManager.saveToLSorCookie(LRU_CACHE, { + cache: objToArray + }); + } + + getKey(value) { + if (value === null) { + return null; } - }, { - key: "getKey", - value: function getKey(value) { - if (value === null) { - return null; - } - var allKeys = _classPrivateFieldLooseBase(this, _keyOrder)[_keyOrder]; + const allKeys = _classPrivateFieldLooseBase(this, _keyOrder)[_keyOrder]; - for (var index in allKeys) { - if (allKeys.hasOwnProperty(index)) { - if (this.cache[allKeys[index]] === value) { - return allKeys[index]; - } + for (const index in allKeys) { + if (allKeys.hasOwnProperty(index)) { + if (this.cache[allKeys[index]] === value) { + return allKeys[index]; } } - - return null; } - }, { - key: "getSecondLastKey", - value: function getSecondLastKey() { - var keysArr = _classPrivateFieldLooseBase(this, _keyOrder)[_keyOrder]; - if (keysArr != null && keysArr.length > 1) { - return keysArr[keysArr.length - 2]; - } + return null; + } - return -1; + getSecondLastKey() { + const keysArr = _classPrivateFieldLooseBase(this, _keyOrder)[_keyOrder]; + + if (keysArr != null && keysArr.length > 1) { + return keysArr[keysArr.length - 2]; } - }, { - key: "getLastKey", - value: function getLastKey() { - var keysLength = _classPrivateFieldLooseBase(this, _keyOrder)[_keyOrder].length; - if (keysLength) { - return _classPrivateFieldLooseBase(this, _keyOrder)[_keyOrder][keysLength - 1]; - } + return -1; + } + + getLastKey() { + const keysLength = _classPrivateFieldLooseBase(this, _keyOrder)[_keyOrder].length; + + if (keysLength) { + return _classPrivateFieldLooseBase(this, _keyOrder)[_keyOrder][keysLength - 1]; } - }]); + } - return LRUCache; - }(); + } var _deleteFromObject2 = function _deleteFromObject2(key, obj) { - var allKeys = JSON.parse(JSON.stringify(_classPrivateFieldLooseBase(this, _keyOrder)[_keyOrder])); - var newCache = {}; - var indexToDelete; + const allKeys = JSON.parse(JSON.stringify(_classPrivateFieldLooseBase(this, _keyOrder)[_keyOrder])); + const newCache = {}; + let indexToDelete; - for (var index in allKeys) { + for (const index in allKeys) { if (allKeys.hasOwnProperty(index)) { if (allKeys[index] !== key) { newCache[allKeys[index]] = obj[allKeys[index]]; @@ -1118,15 +762,14 @@ var _session = _classPrivateFieldLooseKey("session"); - var CleverTapAPI = /*#__PURE__*/function () { - function CleverTapAPI(_ref) { - var logger = _ref.logger, - request = _ref.request, - device = _ref.device, - session = _ref.session; - - _classCallCheck(this, CleverTapAPI); - + class CleverTapAPI { + constructor(_ref) { + let { + logger, + request, + device, + session + } = _ref; Object.defineProperty(this, _logger, { writable: true, value: void 0 @@ -1159,137 +802,132 @@ */ - _createClass(CleverTapAPI, [{ - key: "s", - value: function s(global, session, resume, respNumber, optOutResponse) { - var oulReq = false; - var newGuid = false; // for a scenario when OUL request is true from client side - // but resume is returned as false from server end - // we maintan a OulReqN var in the window object - // and compare with respNumber to determine the response of an OUL request + s(global, session, resume, respNumber, optOutResponse) { + let oulReq = false; + let newGuid = false; // for a scenario when OUL request is true from client side + // but resume is returned as false from server end + // we maintan a OulReqN var in the window object + // and compare with respNumber to determine the response of an OUL request - if (window.isOULInProgress) { - if (resume || respNumber !== 'undefined' && respNumber === window.oulReqN) { - window.isOULInProgress = false; - oulReq = true; - } - } // call back function used to store global and session ids for the user + if (window.isOULInProgress) { + if (resume || respNumber !== 'undefined' && respNumber === window.oulReqN) { + window.isOULInProgress = false; + oulReq = true; + } + } // call back function used to store global and session ids for the user - if (typeof respNumber === 'undefined') { - respNumber = 0; - } + if (typeof respNumber === 'undefined') { + respNumber = 0; + } - StorageManager.removeBackup(respNumber, _classPrivateFieldLooseBase(this, _logger)[_logger]); + StorageManager.removeBackup(respNumber, _classPrivateFieldLooseBase(this, _logger)[_logger]); - if (respNumber > $ct.globalCache.REQ_N) { - // request for some other user so ignore - return; - } + if (respNumber > $ct.globalCache.REQ_N) { + // request for some other user so ignore + return; + } - if (!isValueValid(_classPrivateFieldLooseBase(this, _device)[_device].gcookie)) { - if (global) { - newGuid = true; - } + if (!isValueValid(_classPrivateFieldLooseBase(this, _device)[_device].gcookie)) { + if (global) { + newGuid = true; } + } - if (!isValueValid(_classPrivateFieldLooseBase(this, _device)[_device].gcookie) || resume || typeof optOutResponse === 'boolean') { - var sessionObj = _classPrivateFieldLooseBase(this, _session)[_session].getSessionCookieObject(); - /* If the received session is less than the session in the cookie, - then don't update guid as it will be response for old request - */ + if (!isValueValid(_classPrivateFieldLooseBase(this, _device)[_device].gcookie) || resume || typeof optOutResponse === 'boolean') { + const sessionObj = _classPrivateFieldLooseBase(this, _session)[_session].getSessionCookieObject(); + /* If the received session is less than the session in the cookie, + then don't update guid as it will be response for old request + */ - if (window.isOULInProgress || sessionObj.s && session < sessionObj.s) { - return; - } + if (window.isOULInProgress || sessionObj.s && session < sessionObj.s) { + return; + } - _classPrivateFieldLooseBase(this, _logger)[_logger].debug("Cookie was ".concat(_classPrivateFieldLooseBase(this, _device)[_device].gcookie, " set to ").concat(global)); + _classPrivateFieldLooseBase(this, _logger)[_logger].debug("Cookie was ".concat(_classPrivateFieldLooseBase(this, _device)[_device].gcookie, " set to ").concat(global)); - _classPrivateFieldLooseBase(this, _device)[_device].gcookie = global; + _classPrivateFieldLooseBase(this, _device)[_device].gcookie = global; - if (!isValueValid(_classPrivateFieldLooseBase(this, _device)[_device].gcookie)) { - // clear useIP meta prop - StorageManager.getAndClearMetaProp(USEIP_KEY); - } + if (!isValueValid(_classPrivateFieldLooseBase(this, _device)[_device].gcookie)) { + // clear useIP meta prop + StorageManager.getAndClearMetaProp(USEIP_KEY); + } - if (global && StorageManager._isLocalStorageSupported()) { - if ($ct.LRU_CACHE == null) { - $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE); - } + if (global && StorageManager._isLocalStorageSupported()) { + if ($ct.LRU_CACHE == null) { + $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE); + } - var kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME); - var guidFromLRUCache; + const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME); + let guidFromLRUCache; - if (kIdFromLS != null && kIdFromLS.id) { - guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]; + if (kIdFromLS != null && kIdFromLS.id) { + guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]; - if (resume) { - if (!guidFromLRUCache) { - StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true); // replace login identity in OUL request - // with the gcookie returned in exchange + if (resume) { + if (!guidFromLRUCache) { + StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true); // replace login identity in OUL request + // with the gcookie returned in exchange - $ct.LRU_CACHE.set(kIdFromLS.id, global); - } + $ct.LRU_CACHE.set(kIdFromLS.id, global); } } + } - StorageManager.saveToLSorCookie(GCOOKIE_NAME, global); // lastk provides the guid + StorageManager.saveToLSorCookie(GCOOKIE_NAME, global); // lastk provides the guid - var lastK = $ct.LRU_CACHE.getSecondLastKey(); + const lastK = $ct.LRU_CACHE.getSecondLastKey(); - if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) { - var lastGUID = $ct.LRU_CACHE.cache[lastK]; // fire the request directly via fireRequest to unregister the token - // then other requests with the updated guid should follow + if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) { + const lastGUID = $ct.LRU_CACHE.cache[lastK]; // fire the request directly via fireRequest to unregister the token + // then other requests with the updated guid should follow - _classPrivateFieldLooseBase(this, _request)[_request].unregisterTokenForGuid(lastGUID); - } + _classPrivateFieldLooseBase(this, _request)[_request].unregisterTokenForGuid(lastGUID); } - - StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname); - StorageManager.saveToLSorCookie(GCOOKIE_NAME, global); } - if (StorageManager._isLocalStorageSupported()) { - _classPrivateFieldLooseBase(this, _session)[_session].manageSession(session); - } // session cookie + StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname); + StorageManager.saveToLSorCookie(GCOOKIE_NAME, global); + } + if (StorageManager._isLocalStorageSupported()) { + _classPrivateFieldLooseBase(this, _session)[_session].manageSession(session); + } // session cookie - var obj = _classPrivateFieldLooseBase(this, _session)[_session].getSessionCookieObject(); // for the race-condition where two responses come back with different session ids. don't write the older session id. + const obj = _classPrivateFieldLooseBase(this, _session)[_session].getSessionCookieObject(); // for the race-condition where two responses come back with different session ids. don't write the older session id. - if (typeof obj.s === 'undefined' || obj.s <= session) { - obj.s = session; - obj.t = getNow(); // time of last response from server - _classPrivateFieldLooseBase(this, _session)[_session].setSessionCookieObject(obj); - } // set blockRequest to false only if the device has a valid gcookie + if (typeof obj.s === 'undefined' || obj.s <= session) { + obj.s = session; + obj.t = getNow(); // time of last response from server + _classPrivateFieldLooseBase(this, _session)[_session].setSessionCookieObject(obj); + } // set blockRequest to false only if the device has a valid gcookie - if (isValueValid(_classPrivateFieldLooseBase(this, _device)[_device].gcookie)) { - $ct.blockRequest = false; - } // only process the backup events after an OUL request or a new guid is recieved + if (isValueValid(_classPrivateFieldLooseBase(this, _device)[_device].gcookie)) { + $ct.blockRequest = false; + } // only process the backup events after an OUL request or a new guid is recieved - if ((oulReq || newGuid) && !_classPrivateFieldLooseBase(this, _request)[_request].processingBackup) { - _classPrivateFieldLooseBase(this, _request)[_request].processBackupEvents(); - } - $ct.globalCache.RESP_N = respNumber; + if ((oulReq || newGuid) && !_classPrivateFieldLooseBase(this, _request)[_request].processingBackup) { + _classPrivateFieldLooseBase(this, _request)[_request].processBackupEvents(); } - }]); - - return CleverTapAPI; - }(); - var _logger$1 = _classPrivateFieldLooseKey("logger"); + $ct.globalCache.RESP_N = respNumber; + } - var DeviceManager = /*#__PURE__*/function () { - function DeviceManager(_ref) { - var logger = _ref.logger; + } - _classCallCheck(this, DeviceManager); + var _logger$1 = _classPrivateFieldLooseKey("logger"); + class DeviceManager { + constructor(_ref) { + let { + logger + } = _ref; Object.defineProperty(this, _logger$1, { writable: true, value: void 0 @@ -1299,79 +937,75 @@ this.gcookie = this.getGuid(); } - _createClass(DeviceManager, [{ - key: "getGuid", - value: function getGuid() { - var guid = null; + getGuid() { + let guid = null; - if (isValueValid(this.gcookie)) { - return this.gcookie; - } + if (isValueValid(this.gcookie)) { + return this.gcookie; + } - if (StorageManager._isLocalStorageSupported()) { - var value = StorageManager.read(GCOOKIE_NAME); + if (StorageManager._isLocalStorageSupported()) { + const value = StorageManager.read(GCOOKIE_NAME); - if (isValueValid(value)) { - try { - guid = JSON.parse(decodeURIComponent(value)); - } catch (e) { - _classPrivateFieldLooseBase(this, _logger$1)[_logger$1].debug('Cannot parse Gcookie from localstorage - must be encoded ' + value); // assumming guids are of size 32. supporting both formats. - // guid can have encodedURIComponent or be without it. - // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent()) - // 2.%2256e4078ed15749928c042479ec2b4d47%22 + if (isValueValid(value)) { + try { + guid = JSON.parse(decodeURIComponent(value)); + } catch (e) { + _classPrivateFieldLooseBase(this, _logger$1)[_logger$1].debug('Cannot parse Gcookie from localstorage - must be encoded ' + value); // assumming guids are of size 32. supporting both formats. + // guid can have encodedURIComponent or be without it. + // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent()) + // 2.%2256e4078ed15749928c042479ec2b4d47%22 - if (value.length === 32) { - guid = value; - StorageManager.saveToLSorCookie(GCOOKIE_NAME, value); - } else { - _classPrivateFieldLooseBase(this, _logger$1)[_logger$1].error('Illegal guid ' + value); - } - } // Persist to cookie storage if not present there. + if (value.length === 32) { + guid = value; + StorageManager.saveToLSorCookie(GCOOKIE_NAME, value); + } else { + _classPrivateFieldLooseBase(this, _logger$1)[_logger$1].error('Illegal guid ' + value); + } + } // Persist to cookie storage if not present there. - if (isValueValid(guid)) { - StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname); - } + if (isValueValid(guid)) { + StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname); } } + } - if (!isValueValid(guid)) { - guid = StorageManager.readCookie(GCOOKIE_NAME); - - if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\'') === 0 || guid.indexOf('"') === 0)) { - guid = null; - } + if (!isValueValid(guid)) { + guid = StorageManager.readCookie(GCOOKIE_NAME); - if (isValueValid(guid)) { - StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid); - } + if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\'') === 0 || guid.indexOf('"') === 0)) { + guid = null; } - return guid; + if (isValueValid(guid)) { + StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid); + } } - }]); - return DeviceManager; - }(); + return guid; + } + + } - var DATA_NOT_SENT_TEXT = 'This property has been ignored.'; - var CLEVERTAP_ERROR_PREFIX = 'CleverTap error:'; // Formerly wzrk_error_txt + const DATA_NOT_SENT_TEXT = 'This property has been ignored.'; + const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:'; // Formerly wzrk_error_txt - var EMBED_ERROR = "".concat(CLEVERTAP_ERROR_PREFIX, " Incorrect embed script."); - var EVENT_ERROR = "".concat(CLEVERTAP_ERROR_PREFIX, " Event structure not valid. ").concat(DATA_NOT_SENT_TEXT); - var GENDER_ERROR = "".concat(CLEVERTAP_ERROR_PREFIX, " Gender value should be either M or F. ").concat(DATA_NOT_SENT_TEXT); - var EMPLOYED_ERROR = "".concat(CLEVERTAP_ERROR_PREFIX, " Employed value should be either Y or N. ").concat(DATA_NOT_SENT_TEXT); - var MARRIED_ERROR = "".concat(CLEVERTAP_ERROR_PREFIX, " Married value should be either Y or N. ").concat(DATA_NOT_SENT_TEXT); - var EDUCATION_ERROR = "".concat(CLEVERTAP_ERROR_PREFIX, " Education value should be either School, College or Graduate. ").concat(DATA_NOT_SENT_TEXT); - var AGE_ERROR = "".concat(CLEVERTAP_ERROR_PREFIX, " Age value should be a number. ").concat(DATA_NOT_SENT_TEXT); - var DOB_ERROR = "".concat(CLEVERTAP_ERROR_PREFIX, " DOB value should be a Date Object"); - var ENUM_FORMAT_ERROR = "".concat(CLEVERTAP_ERROR_PREFIX, " setEnum(value). value should be a string or a number"); - var PHONE_FORMAT_ERROR = "".concat(CLEVERTAP_ERROR_PREFIX, " Phone number should be formatted as +[country code][number]"); + const EMBED_ERROR = "".concat(CLEVERTAP_ERROR_PREFIX, " Incorrect embed script."); + const EVENT_ERROR = "".concat(CLEVERTAP_ERROR_PREFIX, " Event structure not valid. ").concat(DATA_NOT_SENT_TEXT); + const GENDER_ERROR = "".concat(CLEVERTAP_ERROR_PREFIX, " Gender value should be either M or F. ").concat(DATA_NOT_SENT_TEXT); + const EMPLOYED_ERROR = "".concat(CLEVERTAP_ERROR_PREFIX, " Employed value should be either Y or N. ").concat(DATA_NOT_SENT_TEXT); + const MARRIED_ERROR = "".concat(CLEVERTAP_ERROR_PREFIX, " Married value should be either Y or N. ").concat(DATA_NOT_SENT_TEXT); + const EDUCATION_ERROR = "".concat(CLEVERTAP_ERROR_PREFIX, " Education value should be either School, College or Graduate. ").concat(DATA_NOT_SENT_TEXT); + const AGE_ERROR = "".concat(CLEVERTAP_ERROR_PREFIX, " Age value should be a number. ").concat(DATA_NOT_SENT_TEXT); + const DOB_ERROR = "".concat(CLEVERTAP_ERROR_PREFIX, " DOB value should be a Date Object"); + const ENUM_FORMAT_ERROR = "".concat(CLEVERTAP_ERROR_PREFIX, " setEnum(value). value should be a string or a number"); + const PHONE_FORMAT_ERROR = "".concat(CLEVERTAP_ERROR_PREFIX, " Phone number should be formatted as +[country code][number]"); - var _globalChargedId; + let _globalChargedId; - var isEventStructureFlat = function isEventStructureFlat(eventObj) { + const isEventStructureFlat = eventObj => { // Events cannot have nested structure or Arrays if (isObject(eventObj)) { for (var key in eventObj) { @@ -1389,7 +1023,7 @@ return false; }; - var isChargedEventStructureValid = function isChargedEventStructureValid(chargedObj, logger) { + const isChargedEventStructureValid = (chargedObj, logger) => { if (isObject(chargedObj)) { for (var key in chargedObj) { if (chargedObj.hasOwnProperty(key)) { @@ -1422,7 +1056,7 @@ if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) { // save charged Id - var chargedId = chargedObj[CHARGED_ID] + ''; // casting chargedId to string + const chargedId = chargedObj[CHARGED_ID] + ''; // casting chargedId to string if (typeof _globalChargedId === 'undefined') { _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME); @@ -1455,96 +1089,82 @@ var _processEventArray = _classPrivateFieldLooseKey("processEventArray"); - var EventHandler = /*#__PURE__*/function (_Array) { - _inherits(EventHandler, _Array); - - var _super = _createSuper(EventHandler); - - function EventHandler(_ref, values) { - var _this; - - var logger = _ref.logger, - request = _ref.request, - isPersonalisationActive = _ref.isPersonalisationActive; - - _classCallCheck(this, EventHandler); - - _this = _super.call(this); - Object.defineProperty(_assertThisInitialized(_this), _processEventArray, { + class EventHandler extends Array { + constructor(_ref, values) { + let { + logger, + request, + isPersonalisationActive + } = _ref; + super(); + Object.defineProperty(this, _processEventArray, { value: _processEventArray2 }); - Object.defineProperty(_assertThisInitialized(_this), _logger$2, { + Object.defineProperty(this, _logger$2, { writable: true, value: void 0 }); - Object.defineProperty(_assertThisInitialized(_this), _oldValues, { + Object.defineProperty(this, _oldValues, { writable: true, value: void 0 }); - Object.defineProperty(_assertThisInitialized(_this), _request$1, { + Object.defineProperty(this, _request$1, { writable: true, value: void 0 }); - Object.defineProperty(_assertThisInitialized(_this), _isPersonalisationActive, { + Object.defineProperty(this, _isPersonalisationActive, { writable: true, value: void 0 }); - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _logger$2)[_logger$2] = logger; - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _oldValues)[_oldValues] = values; - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _request$1)[_request$1] = request; - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _isPersonalisationActive)[_isPersonalisationActive] = isPersonalisationActive; - return _this; + _classPrivateFieldLooseBase(this, _logger$2)[_logger$2] = logger; + _classPrivateFieldLooseBase(this, _oldValues)[_oldValues] = values; + _classPrivateFieldLooseBase(this, _request$1)[_request$1] = request; + _classPrivateFieldLooseBase(this, _isPersonalisationActive)[_isPersonalisationActive] = isPersonalisationActive; } - _createClass(EventHandler, [{ - key: "push", - value: function push() { - for (var _len = arguments.length, eventsArr = new Array(_len), _key = 0; _key < _len; _key++) { - eventsArr[_key] = arguments[_key]; - } + push() { + for (var _len = arguments.length, eventsArr = new Array(_len), _key = 0; _key < _len; _key++) { + eventsArr[_key] = arguments[_key]; + } - _classPrivateFieldLooseBase(this, _processEventArray)[_processEventArray](eventsArr); + _classPrivateFieldLooseBase(this, _processEventArray)[_processEventArray](eventsArr); - return 0; + return 0; + } + + _processOldValues() { + if (_classPrivateFieldLooseBase(this, _oldValues)[_oldValues]) { + _classPrivateFieldLooseBase(this, _processEventArray)[_processEventArray](_classPrivateFieldLooseBase(this, _oldValues)[_oldValues]); } - }, { - key: "_processOldValues", - value: function _processOldValues() { - if (_classPrivateFieldLooseBase(this, _oldValues)[_oldValues]) { - _classPrivateFieldLooseBase(this, _processEventArray)[_processEventArray](_classPrivateFieldLooseBase(this, _oldValues)[_oldValues]); - } - _classPrivateFieldLooseBase(this, _oldValues)[_oldValues] = null; + _classPrivateFieldLooseBase(this, _oldValues)[_oldValues] = null; + } + + getDetails(evtName) { + if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive)[_isPersonalisationActive]()) { + return; } - }, { - key: "getDetails", - value: function getDetails(evtName) { - if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive)[_isPersonalisationActive]()) { - return; - } - if (typeof $ct.globalEventsMap === 'undefined') { - $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE); - } + if (typeof $ct.globalEventsMap === 'undefined') { + $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE); + } - if (typeof $ct.globalEventsMap === 'undefined') { - return; - } + if (typeof $ct.globalEventsMap === 'undefined') { + return; + } - var evtObj = $ct.globalEventsMap[evtName]; - var respObj = {}; + const evtObj = $ct.globalEventsMap[evtName]; + const respObj = {}; - if (typeof evtObj !== 'undefined') { - respObj.firstTime = new Date(evtObj[1] * 1000); - respObj.lastTime = new Date(evtObj[2] * 1000); - respObj.count = evtObj[0]; - return respObj; - } + if (typeof evtObj !== 'undefined') { + respObj.firstTime = new Date(evtObj[1] * 1000); + respObj.lastTime = new Date(evtObj[2] * 1000); + respObj.count = evtObj[0]; + return respObj; } - }]); + } - return EventHandler; - }( /*#__PURE__*/_wrapNativeSuper(Array)); + } var _processEventArray2 = function _processEventArray2(eventsArr) { if (Array.isArray(eventsArr)) { @@ -1569,12 +1189,12 @@ continue; } - var data = {}; + const data = {}; data.type = 'event'; data.evtName = sanitize(eventName, unsupportedKeyCharRegex); if (eventsArr.length !== 0) { - var eventObj = eventsArr.shift(); + const eventObj = eventsArr.shift(); if (!isObject(eventObj)) { // put it back if it is not an object @@ -1604,19 +1224,19 @@ } }; - var getURLParams = function getURLParams(url) { - var urlParams = {}; - var idx = url.indexOf('?'); + const getURLParams = url => { + const urlParams = {}; + const idx = url.indexOf('?'); if (idx > 1) { - var uri = url.substring(idx + 1); - var match; - var pl = /\+/g; // Regex for replacing addition symbol with a space + const uri = url.substring(idx + 1); + let match; + const pl = /\+/g; // Regex for replacing addition symbol with a space - var search = /([^&=]+)=?([^&]*)/g; + const search = /([^&=]+)=?([^&]*)/g; - var decode = function decode(s) { - var replacement = s.replace(pl, ' '); + const decode = function (s) { + let replacement = s.replace(pl, ' '); try { replacement = decodeURIComponent(replacement); @@ -1636,39 +1256,39 @@ return urlParams; }; - var getDomain = function getDomain(url) { + const getDomain = url => { if (url === '') return ''; var a = document.createElement('a'); a.href = url; return a.hostname; }; - var addToURL = function addToURL(url, k, v) { + const addToURL = (url, k, v) => { return url + '&' + k + '=' + encodeURIComponent(v); }; - var getHostName = function getHostName() { + const getHostName = () => { return window.location.hostname; }; /* eslint-disable */ - var urlBase64ToUint8Array = function urlBase64ToUint8Array(base64String) { - var padding = '='.repeat((4 - base64String.length % 4) % 4); - var base64 = (base64String + padding).replace(/\-/g, '+').replace(/_/g, '/'); - var rawData = window.atob(base64); - var processedData = []; + const urlBase64ToUint8Array = base64String => { + let padding = '='.repeat((4 - base64String.length % 4) % 4); + let base64 = (base64String + padding).replace(/\-/g, '+').replace(/_/g, '/'); + let rawData = window.atob(base64); + let processedData = []; - for (var i = 0; i < rawData.length; i++) { + for (let i = 0; i < rawData.length; i++) { processedData.push(rawData.charCodeAt(i)); } return new Uint8Array(processedData); }; - var compressData = function compressData(dataObject, logger) { + const compressData = (dataObject, logger) => { logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject); return compressToBase64(dataObject); }; - var compress = function compress(uncompressed) { + const compress = uncompressed => { if (uncompressed == null) return ''; - var i, + let i, value, context_dictionary = {}, context_dictionaryToCreate = {}, @@ -1928,9 +1548,9 @@ return context_data_string; }; - var getKeyStr = function getKeyStr() { - var key = ''; - var i = 0; + const getKeyStr = () => { + let key = ''; + let i = 0; for (i = 0; i <= 25; i++) { key = key + String.fromCharCode(i + 65); @@ -1947,8 +1567,8 @@ return key + '+/='; }; - var _keyStr = getKeyStr(); - var compressToBase64 = function compressToBase64(input) { + const _keyStr = getKeyStr(); + const compressToBase64 = input => { if (input == null) return ''; var output = ''; var chr1, chr2, chr3, enc1, enc2, enc3, enc4; @@ -1995,66 +1615,58 @@ var _addARPToRequest = _classPrivateFieldLooseKey("addARPToRequest"); - var RequestDispatcher = /*#__PURE__*/function () { - function RequestDispatcher() { - _classCallCheck(this, RequestDispatcher); - + class RequestDispatcher { + constructor() { this.networkRetryCount = 0; this.minDelayFrequency = 0; } - _createClass(RequestDispatcher, [{ - key: "getDelayFrequency", - value: function getDelayFrequency() { - this.logger.debug('Network retry #' + this.networkRetryCount); // Retry with delay as 1s for first 10 retries + /** + * + * @param {string} url + * @param {*} skipARP + * @param {boolean} sendOULFlag + */ + static fireRequest(url, skipARP, sendOULFlag, evtName) { + _classPrivateFieldLooseBase(this, _fireRequest)[_fireRequest](url, 1, skipARP, sendOULFlag, evtName); + } - if (this.networkRetryCount < 10) { - this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s'); - this.minDelayFrequency = PUSH_DELAY_MS; // Reset minimum delay to 1s + getDelayFrequency() { + this.logger.debug('Network retry #' + this.networkRetryCount); // Retry with delay as 1s for first 10 retries - return this.minDelayFrequency; - } + if (this.networkRetryCount < 10) { + this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s'); + this.minDelayFrequency = PUSH_DELAY_MS; // Reset minimum delay to 1s - if (this.account.region == null) { - // Retry with delay as 1s if region is null in case of eu1 - this.logger.debug(this.account.id, 'Setting delay frequency to 1s'); - return PUSH_DELAY_MS; - } else { - // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic - var randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000; - this.minDelayFrequency += randomDelay; + return this.minDelayFrequency; + } - if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) { - this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency); - return this.minDelayFrequency; - } else { - this.minDelayFrequency = PUSH_DELAY_MS; - } + if (this.account.region == null) { + // Retry with delay as 1s if region is null in case of eu1 + this.logger.debug(this.account.id, 'Setting delay frequency to 1s'); + return PUSH_DELAY_MS; + } else { + // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic + const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000; + this.minDelayFrequency += randomDelay; + if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) { this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency); return this.minDelayFrequency; + } else { + this.minDelayFrequency = PUSH_DELAY_MS; } - } - }], [{ - key: "fireRequest", - /** - * - * @param {string} url - * @param {*} skipARP - * @param {boolean} sendOULFlag - */ - value: function fireRequest(url, skipARP, sendOULFlag, evtName) { - _classPrivateFieldLooseBase(this, _fireRequest)[_fireRequest](url, 1, skipARP, sendOULFlag, evtName); + this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency); + return this.minDelayFrequency; } - }]); + } - return RequestDispatcher; - }(); + } var _addARPToRequest2 = function _addARPToRequest2(url, skipResARP) { if (skipResARP === true) { - var _arp = {}; + const _arp = {}; _arp.skipResARP = true; return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger)); } @@ -2086,9 +1698,7 @@ }; var _fireRequest2 = function _fireRequest2(url, tries, skipARP, sendOULFlag, evtName) { - var _this = this, - _window$clevertap, - _window$wizrocket; + var _window$clevertap, _window$wizrocket; if (_classPrivateFieldLooseBase(this, _dropRequestDueToOptOut)[_dropRequestDueToOptOut]()) { this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie); @@ -2111,19 +1721,19 @@ if (evtName && evtName === WZRK_FETCH) { // New retry mechanism if (!isValueValid(this.device.gcookie) && $ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) { - setTimeout(function () { - _this.logger.debug("retrying fire request for url: ".concat(url, ", tries: ").concat(_this.networkRetryCount)); + setTimeout(() => { + this.logger.debug("retrying fire request for url: ".concat(url, ", tries: ").concat(this.networkRetryCount)); - _classPrivateFieldLooseBase(_this, _fireRequest)[_fireRequest](url, undefined, skipARP, sendOULFlag); + _classPrivateFieldLooseBase(this, _fireRequest)[_fireRequest](url, undefined, skipARP, sendOULFlag); }, this.getDelayFrequency()); } } else { if (!isValueValid(this.device.gcookie) && $ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1 && tries < MAX_TRIES) { // if ongoing First Request is in progress, initiate retry - setTimeout(function () { - _this.logger.debug("retrying fire request for url: ".concat(url, ", tries: ").concat(tries)); + setTimeout(() => { + this.logger.debug("retrying fire request for url: ".concat(url, ", tries: ").concat(tries)); - _classPrivateFieldLooseBase(_this, _fireRequest)[_fireRequest](url, tries + 1, skipARP, sendOULFlag); + _classPrivateFieldLooseBase(this, _fireRequest)[_fireRequest](url, tries + 1, skipARP, sendOULFlag); }, 50); return; } @@ -2150,7 +1760,7 @@ if (((_window$clevertap = window.clevertap) === null || _window$clevertap === void 0 ? void 0 : _window$clevertap.hasOwnProperty('plugin')) || ((_window$wizrocket = window.wizrocket) === null || _window$wizrocket === void 0 ? void 0 : _window$wizrocket.hasOwnProperty('plugin'))) { // used to add plugin name in request parameter - var plugin = window.clevertap.plugin || window.wizrocket.plugin; + const plugin = window.clevertap.plugin || window.wizrocket.plugin; url = addToURL(url, 'ct_pl', plugin); } @@ -2165,7 +1775,7 @@ ctCbScripts[0].parentNode.removeChild(ctCbScripts[0]); } - var s = document.createElement('script'); + const s = document.createElement('script'); s.setAttribute('type', 'text/javascript'); s.setAttribute('src', url); s.setAttribute('class', 'ct-jp-cb'); @@ -2191,11 +1801,12 @@ value: _addARPToRequest2 }); - var getCampaignObject = function getCampaignObject() { - var finalcampObj = {}; + // CleverTap specific utilities + const getCampaignObject = () => { + let finalcampObj = {}; if (StorageManager._isLocalStorageSupported()) { - var campObj = StorageManager.read(CAMP_COOKIE_NAME); + let campObj = StorageManager.read(CAMP_COOKIE_NAME); if (campObj != null) { campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\"')); @@ -2212,45 +1823,46 @@ return finalcampObj; }; - var saveCampaignObject = function saveCampaignObject(campaignObj) { + const saveCampaignObject = campaignObj => { if (StorageManager._isLocalStorageSupported()) { - var newObj = _objectSpread2(_objectSpread2({}, getCampaignObject()), campaignObj); - - var campObj = JSON.stringify(newObj); + const newObj = { ...getCampaignObject(), + ...campaignObj + }; + const campObj = JSON.stringify(newObj); StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj)); // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME setCampaignObjectForGuid(); } }; // set Campaign Object against the guid, with daily count and total count details - var setCampaignObjectForGuid = function setCampaignObjectForGuid() { + const setCampaignObjectForGuid = () => { if (StorageManager._isLocalStorageSupported()) { - var guid = StorageManager.read(GCOOKIE_NAME); + let guid = StorageManager.read(GCOOKIE_NAME); if (isValueValid(guid)) { try { guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME))); - var guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}; + const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}; if (guid && StorageManager._isLocalStorageSupported()) { var finalCampObj = {}; var campObj = getCampaignObject(); - Object.keys(campObj).forEach(function (key) { - var campKeyObj = guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key] ? guidCampObj[guid][key] : {}; - var globalObj = campObj[key].global; - var today = getToday(); - var dailyObj = campObj[key][today]; + Object.keys(campObj).forEach(key => { + const campKeyObj = guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key] ? guidCampObj[guid][key] : {}; + const globalObj = campObj[key].global; + const today = getToday(); + const dailyObj = campObj[key][today]; if (typeof globalObj !== 'undefined') { - var campaignIdArray = Object.keys(globalObj); + const campaignIdArray = Object.keys(globalObj); - for (var index in campaignIdArray) { - var resultObj = []; + for (const index in campaignIdArray) { + let resultObj = []; if (campaignIdArray.hasOwnProperty(index)) { - var dailyC = 0; - var totalC = 0; - var campaignId = campaignIdArray[index]; + let dailyC = 0; + let totalC = 0; + const campaignId = campaignIdArray[index]; if (campaignId === 'tc') { continue; @@ -2270,7 +1882,9 @@ } } - finalCampObj = _objectSpread2(_objectSpread2({}, finalCampObj), {}, _defineProperty({}, key, campKeyObj)); + finalCampObj = { ...finalCampObj, + [key]: campKeyObj + }; }); guidCampObj[guid] = finalCampObj; StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj))); @@ -2281,22 +1895,22 @@ } } }; - var getCampaignObjForLc = function getCampaignObjForLc() { + const getCampaignObjForLc = () => { // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G - var guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME))); - var campObj = {}; + const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME))); + let campObj = {}; if (StorageManager._isLocalStorageSupported()) { - var resultObj = {}; + let resultObj = {}; campObj = getCampaignObject(); - var storageValue = StorageManager.read(CAMP_COOKIE_G); - var decodedValue = storageValue ? decodeURIComponent(storageValue) : null; - var parsedValue = decodedValue ? JSON.parse(decodedValue) : null; - var resultObjWP = !!guid && storageValue !== undefined && storageValue !== null && parsedValue && parsedValue[guid] && parsedValue[guid].wp ? Object.values(parsedValue[guid].wp) : []; - var resultObjWI = !!guid && storageValue !== undefined && storageValue !== null && parsedValue && parsedValue[guid] && parsedValue[guid].wi ? Object.values(parsedValue[guid].wi) : []; - var today = getToday(); - var todayCwp = 0; - var todayCwi = 0; + const storageValue = StorageManager.read(CAMP_COOKIE_G); + const decodedValue = storageValue ? decodeURIComponent(storageValue) : null; + const parsedValue = decodedValue ? JSON.parse(decodedValue) : null; + const resultObjWP = !!guid && storageValue !== undefined && storageValue !== null && parsedValue && parsedValue[guid] && parsedValue[guid].wp ? Object.values(parsedValue[guid].wp) : []; + const resultObjWI = !!guid && storageValue !== undefined && storageValue !== null && parsedValue && parsedValue[guid] && parsedValue[guid].wi ? Object.values(parsedValue[guid].wi) : []; + const today = getToday(); + let todayCwp = 0; + let todayCwi = 0; if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') { todayCwp = campObj.wp[today].tc; @@ -2315,15 +1929,17 @@ return resultObj; } }; - var isProfileValid = function isProfileValid(profileObj, _ref) { - var logger = _ref.logger; - var valid = false; + const isProfileValid = (profileObj, _ref) => { + let { + logger + } = _ref; + let valid = false; if (isObject(profileObj)) { - for (var profileKey in profileObj) { + for (const profileKey in profileObj) { if (profileObj.hasOwnProperty(profileKey)) { valid = true; - var profileVal = profileObj[profileKey]; + let profileVal = profileObj[profileKey]; if (profileVal == null) { delete profileObj[profileKey]; @@ -2399,8 +2015,8 @@ return valid; }; - var processFBUserObj = function processFBUserObj(user) { - var profileData = {}; + const processFBUserObj = user => { + const profileData = {}; profileData.Name = user.name; if (user.id != null) { @@ -2416,16 +2032,16 @@ profileData.Gender = 'O'; } - var getHighestEducation = function getHighestEducation(eduArr) { + const getHighestEducation = function (eduArr) { if (eduArr != null) { - var college = ''; - var highschool = ''; + let college = ''; + let highschool = ''; - for (var i = 0; i < eduArr.length; i++) { - var _edu = eduArr[i]; + for (let i = 0; i < eduArr.length; i++) { + const edu = eduArr[i]; - if (_edu.type != null) { - var type = _edu.type; + if (edu.type != null) { + const type = edu.type; if (type === 'Graduate School') { return 'Graduate'; @@ -2453,13 +2069,13 @@ } } - var edu = getHighestEducation(user.education); + const edu = getHighestEducation(user.education); if (edu != null) { profileData.Education = edu; } - var work = user.work != null ? user.work.length : 0; + const work = user.work != null ? user.work.length : 0; if (work > 0) { profileData.Employed = 'Y'; @@ -2472,16 +2088,18 @@ } if (user.birthday != null) { - var mmddyy = user.birthday.split('/'); // comes in as "08/15/1947" + const mmddyy = user.birthday.split('/'); // comes in as "08/15/1947" profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1]); } return profileData; }; - var processGPlusUserObj = function processGPlusUserObj(user, _ref2) { - var logger = _ref2.logger; - var profileData = {}; + const processGPlusUserObj = (user, _ref2) => { + let { + logger + } = _ref2; + const profileData = {}; if (user.displayName != null) { profileData.Name = user.displayName; @@ -2508,8 +2126,8 @@ } if (user.emails != null) { - for (var emailIdx = 0; emailIdx < user.emails.length; emailIdx++) { - var emailObj = user.emails[emailIdx]; + for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) { + const emailObj = user.emails[emailIdx]; if (emailObj.type === 'account') { profileData.Email = emailObj.value; @@ -2520,8 +2138,8 @@ if (user.organizations != null) { profileData.Employed = 'N'; - for (var i = 0; i < user.organizations.length; i++) { - var orgObj = user.organizations[i]; + for (let i = 0; i < user.organizations.length; i++) { + const orgObj = user.organizations[i]; if (orgObj.type === 'work') { profileData.Employed = 'Y'; @@ -2530,7 +2148,7 @@ } if (user.birthday != null) { - var yyyymmdd = user.birthday.split('-'); // comes in as "1976-07-27" + const yyyymmdd = user.birthday.split('-'); // comes in as "1976-07-27" profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2]); } @@ -2546,7 +2164,7 @@ logger.debug('gplus usr profile ' + JSON.stringify(profileData)); return profileData; }; - var addToLocalProfileMap = function addToLocalProfileMap(profileObj, override) { + const addToLocalProfileMap = (profileObj, override) => { if (StorageManager._isLocalStorageSupported()) { if ($ct.globalProfileMap == null) { $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE); @@ -2558,9 +2176,9 @@ if (profileObj._custom != null) { - var keys = profileObj._custom; + const keys = profileObj._custom; - for (var key in keys) { + for (const key in keys) { if (keys.hasOwnProperty(key)) { profileObj[key] = keys[key]; } @@ -2569,7 +2187,7 @@ delete profileObj._custom; } - for (var prop in profileObj) { + for (const prop in profileObj) { if (profileObj.hasOwnProperty(prop)) { if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) { continue; @@ -2586,11 +2204,11 @@ StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap); } }; - var closeIframe = function closeIframe(campaignId, divIdIgnored, currentSessionId) { + const closeIframe = (campaignId, divIdIgnored, currentSessionId) => { if (campaignId != null && campaignId !== '-1') { if (StorageManager._isLocalStorageSupported()) { - var campaignObj = getCampaignObject(); - var sessionCampaignObj = campaignObj.wp[currentSessionId]; + const campaignObj = getCampaignObject(); + let sessionCampaignObj = campaignObj.wp[currentSessionId]; if (sessionCampaignObj == null) { sessionCampaignObj = {}; @@ -2603,7 +2221,7 @@ } if ($ct.campaignDivMap != null) { - var divId = $ct.campaignDivMap[campaignId]; + const divId = $ct.campaignDivMap[campaignId]; if (divId != null) { document.getElementById(divId).style.display = 'none'; @@ -2616,24 +2234,24 @@ } } }; - var arp = function arp(jsonMap) { + const arp = jsonMap => { // For unregister calls dont set arp in LS if (jsonMap.skipResARP != null && jsonMap.skipResARP) { console.debug('Update ARP Request rejected', jsonMap); return null; } - var isOULARP = jsonMap[IS_OUL] === true; + const isOULARP = jsonMap[IS_OUL] === true; if (StorageManager._isLocalStorageSupported()) { // Update arp only if it is null or an oul request try { - var arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE); + let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE); if (arpFromStorage == null || isOULARP) { arpFromStorage = {}; - for (var key in jsonMap) { + for (const key in jsonMap) { if (jsonMap.hasOwnProperty(key)) { if (jsonMap[key] === -1) { delete arpFromStorage[key]; @@ -2650,22 +2268,22 @@ } } }; - var setEnum = function setEnum(enumVal, logger) { + const setEnum = (enumVal, logger) => { if (isString(enumVal) || isNumber(enumVal)) { return '$E_' + enumVal; } logger.error(ENUM_FORMAT_ERROR); }; - var handleEmailSubscription = function handleEmailSubscription(subscription, reEncoded, fetchGroups, account, logger) { - var urlParamsAsIs = getURLParams(location.href); // can't use url_params as it is in lowercase above + const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => { + const urlParamsAsIs = getURLParams(location.href); // can't use url_params as it is in lowercase above - var encodedEmailId = urlParamsAsIs.e; - var encodedProfileProps = urlParamsAsIs.p; - var pageType = urlParamsAsIs.page_type; + const encodedEmailId = urlParamsAsIs.e; + const encodedProfileProps = urlParamsAsIs.p; + const pageType = urlParamsAsIs.page_type; if (typeof encodedEmailId !== 'undefined') { - var data = {}; + const data = {}; data.id = account.id; // accountId data.unsubGroups = $ct.unsubGroups; // unsubscribe groups @@ -2674,7 +2292,7 @@ data[categoryLongKey] = $ct.updatedCategoryLong; } - var url = account.emailURL; + let url = account.emailURL; if (fetchGroups) { url = addToURL(url, 'fetchGroups', fetchGroups); @@ -2716,338 +2334,321 @@ var _processProfileArray = _classPrivateFieldLooseKey("processProfileArray"); - var ProfileHandler = /*#__PURE__*/function (_Array) { - _inherits(ProfileHandler, _Array); - - var _super = _createSuper(ProfileHandler); - - function ProfileHandler(_ref, values) { - var _this; - - var logger = _ref.logger, - request = _ref.request, - account = _ref.account, - isPersonalisationActive = _ref.isPersonalisationActive; - - _classCallCheck(this, ProfileHandler); - - _this = _super.call(this); - Object.defineProperty(_assertThisInitialized(_this), _processProfileArray, { + class ProfileHandler extends Array { + constructor(_ref, values) { + let { + logger, + request, + account, + isPersonalisationActive + } = _ref; + super(); + Object.defineProperty(this, _processProfileArray, { value: _processProfileArray2 }); - Object.defineProperty(_assertThisInitialized(_this), _logger$3, { + Object.defineProperty(this, _logger$3, { writable: true, value: void 0 }); - Object.defineProperty(_assertThisInitialized(_this), _request$2, { + Object.defineProperty(this, _request$2, { writable: true, value: void 0 }); - Object.defineProperty(_assertThisInitialized(_this), _account, { + Object.defineProperty(this, _account, { writable: true, value: void 0 }); - Object.defineProperty(_assertThisInitialized(_this), _oldValues$1, { + Object.defineProperty(this, _oldValues$1, { writable: true, value: void 0 }); - Object.defineProperty(_assertThisInitialized(_this), _isPersonalisationActive$1, { + Object.defineProperty(this, _isPersonalisationActive$1, { writable: true, value: void 0 }); - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _logger$3)[_logger$3] = logger; - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _request$2)[_request$2] = request; - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _account)[_account] = account; - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _oldValues$1)[_oldValues$1] = values; - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _isPersonalisationActive$1)[_isPersonalisationActive$1] = isPersonalisationActive; - return _this; + _classPrivateFieldLooseBase(this, _logger$3)[_logger$3] = logger; + _classPrivateFieldLooseBase(this, _request$2)[_request$2] = request; + _classPrivateFieldLooseBase(this, _account)[_account] = account; + _classPrivateFieldLooseBase(this, _oldValues$1)[_oldValues$1] = values; + _classPrivateFieldLooseBase(this, _isPersonalisationActive$1)[_isPersonalisationActive$1] = isPersonalisationActive; } - _createClass(ProfileHandler, [{ - key: "push", - value: function push() { - for (var _len = arguments.length, profilesArr = new Array(_len), _key = 0; _key < _len; _key++) { - profilesArr[_key] = arguments[_key]; - } + push() { + for (var _len = arguments.length, profilesArr = new Array(_len), _key = 0; _key < _len; _key++) { + profilesArr[_key] = arguments[_key]; + } + + _classPrivateFieldLooseBase(this, _processProfileArray)[_processProfileArray](profilesArr); - _classPrivateFieldLooseBase(this, _processProfileArray)[_processProfileArray](profilesArr); + return 0; + } - return 0; + _processOldValues() { + if (_classPrivateFieldLooseBase(this, _oldValues$1)[_oldValues$1]) { + _classPrivateFieldLooseBase(this, _processProfileArray)[_processProfileArray](_classPrivateFieldLooseBase(this, _oldValues$1)[_oldValues$1]); } - }, { - key: "_processOldValues", - value: function _processOldValues() { - if (_classPrivateFieldLooseBase(this, _oldValues$1)[_oldValues$1]) { - _classPrivateFieldLooseBase(this, _processProfileArray)[_processProfileArray](_classPrivateFieldLooseBase(this, _oldValues$1)[_oldValues$1]); - } - _classPrivateFieldLooseBase(this, _oldValues$1)[_oldValues$1] = null; + _classPrivateFieldLooseBase(this, _oldValues$1)[_oldValues$1] = null; + } + + getAttribute(propName) { + if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$1)[_isPersonalisationActive$1]()) { + return; } - }, { - key: "getAttribute", - value: function getAttribute(propName) { - if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$1)[_isPersonalisationActive$1]()) { - return; - } - if ($ct.globalProfileMap == null) { - $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE); - } + if ($ct.globalProfileMap == null) { + $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE); + } - if ($ct.globalProfileMap != null) { - return $ct.globalProfileMap[propName]; - } + if ($ct.globalProfileMap != null) { + return $ct.globalProfileMap[propName]; } - }, { - key: "_handleIncrementDecrementValue", + } - /** - * - * @param {any} key - * @param {number} value - * @param {string} command - * increases or decreases value of the number type properties in profile object - */ - value: function _handleIncrementDecrementValue(key, value, command) { - var _$ct$globalProfileMap; + /** + * + * @param {any} key + * @param {number} value + * @param {string} command + * increases or decreases value of the number type properties in profile object + */ + _handleIncrementDecrementValue(key, value, command) { + var _$ct$globalProfileMap; - // Check if the value is greater than 0 - if ($ct.globalProfileMap == null) { - $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE); - } + // Check if the value is greater than 0 + if ($ct.globalProfileMap == null) { + $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE); + } - if ($ct.globalProfileMap == null && !((_$ct$globalProfileMap = $ct.globalProfileMap) === null || _$ct$globalProfileMap === void 0 ? void 0 : _$ct$globalProfileMap.hasOwnProperty(key))) { - // Check if the profile map already has the propery defined - console.error('Kindly create profile with required proprty to increment/decrement.'); - } else if (!value || typeof value !== 'number' || value <= 0) { - console.error('Value should be a number greater than 0'); + if ($ct.globalProfileMap == null && !((_$ct$globalProfileMap = $ct.globalProfileMap) === null || _$ct$globalProfileMap === void 0 ? void 0 : _$ct$globalProfileMap.hasOwnProperty(key))) { + // Check if the profile map already has the propery defined + console.error('Kindly create profile with required proprty to increment/decrement.'); + } else if (!value || typeof value !== 'number' || value <= 0) { + console.error('Value should be a number greater than 0'); + } else { + // Update the profile property in local storage + if (command === COMMAND_INCREMENT) { + $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value; } else { - // Update the profile property in local storage - if (command === COMMAND_INCREMENT) { - $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value; - } else { - $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value; - } + $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value; + } - StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap); // Send the updated value to LC + StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap); // Send the updated value to LC - var data = {}; - var profileObj = {}; - data.type = 'profile'; - profileObj[key] = _defineProperty({}, command, value); + let data = {}; + const profileObj = {}; + data.type = 'profile'; + profileObj[key] = { + [command]: value + }; - if (profileObj.tz == null) { - // try to auto capture user timezone if not present - profileObj.tz = new Date().toString().match(/([A-Z]+[\+-][0-9]+)/)[1]; - } + if (profileObj.tz == null) { + // try to auto capture user timezone if not present + profileObj.tz = new Date().toString().match(/([A-Z]+[\+-][0-9]+)/)[1]; + } - data.profile = profileObj; - data = _classPrivateFieldLooseBase(this, _request$2)[_request$2].addSystemDataToObject(data, true); + data.profile = profileObj; + data = _classPrivateFieldLooseBase(this, _request$2)[_request$2].addSystemDataToObject(data, true); - _classPrivateFieldLooseBase(this, _request$2)[_request$2].addFlags(data); + _classPrivateFieldLooseBase(this, _request$2)[_request$2].addFlags(data); - var compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$3)[_logger$3]); + const compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$3)[_logger$3]); - var pageLoadUrl = _classPrivateFieldLooseBase(this, _account)[_account].dataPostURL; + let pageLoadUrl = _classPrivateFieldLooseBase(this, _account)[_account].dataPostURL; - pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH); - pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData); + pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH); + pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData); - _classPrivateFieldLooseBase(this, _request$2)[_request$2].saveAndFireRequest(pageLoadUrl, $ct.blockRequest); - } + _classPrivateFieldLooseBase(this, _request$2)[_request$2].saveAndFireRequest(pageLoadUrl, $ct.blockRequest); } - /** - * - * @param {any} key - * @param {array} arrayVal - * @param {string} command - * overwrites/sets new value(s) against a key/property in profile object - */ - - }, { - key: "_handleMultiValueSet", - value: function _handleMultiValueSet(key, arrayVal, command) { - var array = []; + } + /** + * + * @param {any} key + * @param {array} arrayVal + * @param {string} command + * overwrites/sets new value(s) against a key/property in profile object + */ - for (var i = 0; i < arrayVal.length; i++) { - if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) { - array.push(arrayVal[i]); - } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) { - array.push(arrayVal[i].toLowerCase()); - } else { - console.error('array supports only string or number type values'); - } - } - if ($ct.globalProfileMap == null) { - var _StorageManager$readF; + _handleMultiValueSet(key, arrayVal, command) { + const array = []; - $ct.globalProfileMap = (_StorageManager$readF = StorageManager.readFromLSorCookie(PR_COOKIE)) !== null && _StorageManager$readF !== void 0 ? _StorageManager$readF : {}; + for (let i = 0; i < arrayVal.length; i++) { + if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) { + array.push(arrayVal[i]); + } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) { + array.push(arrayVal[i].toLowerCase()); + } else { + console.error('array supports only string or number type values'); } + } + + if ($ct.globalProfileMap == null) { + var _StorageManager$readF; - $ct.globalProfileMap[key] = array; - StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap); - this.sendMultiValueData(key, arrayVal, command); + $ct.globalProfileMap = (_StorageManager$readF = StorageManager.readFromLSorCookie(PR_COOKIE)) !== null && _StorageManager$readF !== void 0 ? _StorageManager$readF : {}; } - /** - * - * @param {any} propKey - the property name to be added in the profile object - * @param {string, number, array} propVal - the property value to be added against the @propkey key - * @param {string} command - * Adds array or single value against a key/property in profile object - */ - }, { - key: "_handleMultiValueAdd", - value: function _handleMultiValueAdd(propKey, propVal, command) { - // Initialize array - var array = []; // Check if globalProfileMap is null, initialize if needed + $ct.globalProfileMap[key] = array; + StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap); + this.sendMultiValueData(key, arrayVal, command); + } + /** + * + * @param {any} propKey - the property name to be added in the profile object + * @param {string, number, array} propVal - the property value to be added against the @propkey key + * @param {string} command + * Adds array or single value against a key/property in profile object + */ + - if ($ct.globalProfileMap == null) { - $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}; - } // Check if the value to be set is either string or number + _handleMultiValueAdd(propKey, propVal, command) { + // Initialize array + var array = []; // Check if globalProfileMap is null, initialize if needed + + if ($ct.globalProfileMap == null) { + $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}; + } // Check if the value to be set is either string or number - if (typeof propVal === 'string' || typeof propVal === 'number') { - if ($ct.globalProfileMap.hasOwnProperty(propKey)) { - array = $ct.globalProfileMap[propKey]; - array.push(typeof propVal === 'number' ? propVal : propVal.toLowerCase()); + if (typeof propVal === 'string' || typeof propVal === 'number') { + if ($ct.globalProfileMap.hasOwnProperty(propKey)) { + array = $ct.globalProfileMap[propKey]; + array.push(typeof propVal === 'number' ? propVal : propVal.toLowerCase()); + } else { + $ct.globalProfileMap[propKey] = propVal; + } + } else { + // Check if propVal is an array + if ($ct.globalProfileMap.hasOwnProperty(propKey)) { + array = Array.isArray($ct.globalProfileMap[propKey]) ? $ct.globalProfileMap[propKey] : [$ct.globalProfileMap[propKey]]; + } // Check for case-sensitive inputs and filter the same ones + + + for (var i = 0; i < propVal.length; i++) { + if (typeof propVal[i] === 'number' && !array.includes(propVal[i])) { + array.push(propVal[i]); + } else if (typeof propVal[i] === 'string' && !array.includes(propVal[i].toLowerCase())) { + array.push(propVal[i].toLowerCase()); + } else if (typeof propVal[i] === 'number' && array.includes(propVal[i]) || typeof propVal[i] === 'string' && array.includes(propVal[i].toLowerCase())) { + console.error('Values already included'); } else { - $ct.globalProfileMap[propKey] = propVal; + console.error('Array supports only string or number type values'); } - } else { - // Check if propVal is an array - if ($ct.globalProfileMap.hasOwnProperty(propKey)) { - array = Array.isArray($ct.globalProfileMap[propKey]) ? $ct.globalProfileMap[propKey] : [$ct.globalProfileMap[propKey]]; - } // Check for case-sensitive inputs and filter the same ones - - - for (var i = 0; i < propVal.length; i++) { - if (typeof propVal[i] === 'number' && !array.includes(propVal[i])) { - array.push(propVal[i]); - } else if (typeof propVal[i] === 'string' && !array.includes(propVal[i].toLowerCase())) { - array.push(propVal[i].toLowerCase()); - } else if (typeof propVal[i] === 'number' && array.includes(propVal[i]) || typeof propVal[i] === 'string' && array.includes(propVal[i].toLowerCase())) { - console.error('Values already included'); - } else { - console.error('Array supports only string or number type values'); - } - } // Update globalProfileMap with the array + } // Update globalProfileMap with the array - $ct.globalProfileMap[propKey] = array; - } // Save to local storage or cookie + $ct.globalProfileMap[propKey] = array; + } // Save to local storage or cookie - StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap); // Call the sendMultiValueData function + StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap); // Call the sendMultiValueData function - this.sendMultiValueData(propKey, propVal, command); - } - /** - * - * @param {any} propKey - * @param {string, number, array} propVal - * @param {string} command - * removes value(s) against a key/property in profile object - */ + this.sendMultiValueData(propKey, propVal, command); + } + /** + * + * @param {any} propKey + * @param {string, number, array} propVal + * @param {string} command + * removes value(s) against a key/property in profile object + */ - }, { - key: "_handleMultiValueRemove", - value: function _handleMultiValueRemove(propKey, propVal, command) { - var _$ct$globalProfileMap2; - if ($ct.globalProfileMap == null) { - $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE); - } + _handleMultiValueRemove(propKey, propVal, command) { + var _$ct$globalProfileMap2; - if (!($ct === null || $ct === void 0 ? void 0 : (_$ct$globalProfileMap2 = $ct.globalProfileMap) === null || _$ct$globalProfileMap2 === void 0 ? void 0 : _$ct$globalProfileMap2.hasOwnProperty(propKey))) { - console.error("The property ".concat(propKey, " does not exist.")); - } else { - if (typeof propVal === 'string' || typeof propVal === 'number') { - var index = $ct.globalProfileMap[propKey].indexOf(propVal); + if ($ct.globalProfileMap == null) { + $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE); + } - if (index !== -1) { - $ct.globalProfileMap[propKey].splice(index, 1); - } - } else { - for (var k = 0; k < propVal.length; k++) { - var idx = $ct.globalProfileMap[propKey].indexOf(propVal[k]); + if (!($ct === null || $ct === void 0 ? void 0 : (_$ct$globalProfileMap2 = $ct.globalProfileMap) === null || _$ct$globalProfileMap2 === void 0 ? void 0 : _$ct$globalProfileMap2.hasOwnProperty(propKey))) { + console.error("The property ".concat(propKey, " does not exist.")); + } else { + if (typeof propVal === 'string' || typeof propVal === 'number') { + var index = $ct.globalProfileMap[propKey].indexOf(propVal); - if (idx !== -1) { - $ct.globalProfileMap[propKey].splice(idx, 1); - } + if (index !== -1) { + $ct.globalProfileMap[propKey].splice(index, 1); + } + } else { + for (var k = 0; k < propVal.length; k++) { + var idx = $ct.globalProfileMap[propKey].indexOf(propVal[k]); + + if (idx !== -1) { + $ct.globalProfileMap[propKey].splice(idx, 1); } } } - - StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap); - this.sendMultiValueData(propKey, propVal, command); } - /** - * - * @param {any} propKey - * @param {string} command - * deletes a key value pair from the profile object - */ - }, { - key: "_handleMultiValueDelete", - value: function _handleMultiValueDelete(propKey, command) { - var _$ct$globalProfileMap3; + StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap); + this.sendMultiValueData(propKey, propVal, command); + } + /** + * + * @param {any} propKey + * @param {string} command + * deletes a key value pair from the profile object + */ + - if ($ct.globalProfileMap == null) { - $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE); - } + _handleMultiValueDelete(propKey, command) { + var _$ct$globalProfileMap3; - if (!($ct === null || $ct === void 0 ? void 0 : (_$ct$globalProfileMap3 = $ct.globalProfileMap) === null || _$ct$globalProfileMap3 === void 0 ? void 0 : _$ct$globalProfileMap3.hasOwnProperty(propKey))) { - console.error("The property ".concat(propKey, " does not exist.")); - } else { - delete $ct.globalProfileMap[propKey]; - } + if ($ct.globalProfileMap == null) { + $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE); + } - StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap); - this.sendMultiValueData(propKey, null, command); + if (!($ct === null || $ct === void 0 ? void 0 : (_$ct$globalProfileMap3 = $ct.globalProfileMap) === null || _$ct$globalProfileMap3 === void 0 ? void 0 : _$ct$globalProfileMap3.hasOwnProperty(propKey))) { + console.error("The property ".concat(propKey, " does not exist.")); + } else { + delete $ct.globalProfileMap[propKey]; } - }, { - key: "sendMultiValueData", - value: function sendMultiValueData(propKey, propVal, command) { - // Send the updated value to LC - var data = {}; - var profileObj = {}; - data.type = 'profile'; // this removes the property at backend - profileObj[propKey] = _defineProperty({}, command, command === COMMAND_DELETE ? true : propVal); + StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap); + this.sendMultiValueData(propKey, null, command); + } - if (profileObj.tz == null) { - profileObj.tz = new Date().toString().match(/([A-Z]+[\+-][0-9]+)/)[1]; - } + sendMultiValueData(propKey, propVal, command) { + // Send the updated value to LC + let data = {}; + const profileObj = {}; + data.type = 'profile'; // this removes the property at backend - data.profile = profileObj; - data = _classPrivateFieldLooseBase(this, _request$2)[_request$2].addSystemDataToObject(data, true); + profileObj[propKey] = { + [command]: command === COMMAND_DELETE ? true : propVal + }; - _classPrivateFieldLooseBase(this, _request$2)[_request$2].addFlags(data); + if (profileObj.tz == null) { + profileObj.tz = new Date().toString().match(/([A-Z]+[\+-][0-9]+)/)[1]; + } - var compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$3)[_logger$3]); + data.profile = profileObj; + data = _classPrivateFieldLooseBase(this, _request$2)[_request$2].addSystemDataToObject(data, true); - var pageLoadUrl = _classPrivateFieldLooseBase(this, _account)[_account].dataPostURL; + _classPrivateFieldLooseBase(this, _request$2)[_request$2].addFlags(data); - pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH); - pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData); + const compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$3)[_logger$3]); - _classPrivateFieldLooseBase(this, _request$2)[_request$2].saveAndFireRequest(pageLoadUrl, $ct.blockRequest); - } - }]); + let pageLoadUrl = _classPrivateFieldLooseBase(this, _account)[_account].dataPostURL; + + pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH); + pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData); + + _classPrivateFieldLooseBase(this, _request$2)[_request$2].saveAndFireRequest(pageLoadUrl, $ct.blockRequest); + } - return ProfileHandler; - }( /*#__PURE__*/_wrapNativeSuper(Array)); + } var _processProfileArray2 = function _processProfileArray2(profileArr) { if (Array.isArray(profileArr) && profileArr.length > 0) { - for (var index in profileArr) { + for (const index in profileArr) { if (profileArr.hasOwnProperty(index)) { - var outerObj = profileArr[index]; - var data = {}; - var profileObj = void 0; + const outerObj = profileArr[index]; + let data = {}; + let profileObj; if (outerObj.Site != null) { // organic data from the site @@ -3060,13 +2661,13 @@ } } else if (outerObj.Facebook != null) { // fb connect data - var FbProfileObj = outerObj.Facebook; // make sure that the object contains any data at all + const FbProfileObj = outerObj.Facebook; // make sure that the object contains any data at all if (!isObjectEmpty(FbProfileObj) && !FbProfileObj.error) { profileObj = processFBUserObj(FbProfileObj); } } else if (outerObj['Google Plus'] != null) { - var GPlusProfileObj = outerObj['Google Plus']; + const GPlusProfileObj = outerObj['Google Plus']; if (!isObjectEmpty(GPlusProfileObj) && !GPlusProfileObj.error) { profileObj = processGPlusUserObj(GPlusProfileObj, { @@ -3090,9 +2691,9 @@ _classPrivateFieldLooseBase(this, _request$2)[_request$2].addFlags(data); - var compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$3)[_logger$3]); + const compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$3)[_logger$3]); - var pageLoadUrl = _classPrivateFieldLooseBase(this, _account)[_account].dataPostURL; + let pageLoadUrl = _classPrivateFieldLooseBase(this, _account)[_account].dataPostURL; pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH); pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData); @@ -3124,113 +2725,97 @@ var _processLoginArray = _classPrivateFieldLooseKey("processLoginArray"); - var UserLoginHandler = /*#__PURE__*/function (_Array) { - _inherits(UserLoginHandler, _Array); - - var _super = _createSuper(UserLoginHandler); - - function UserLoginHandler(_ref, values) { - var _this; - - var request = _ref.request, - account = _ref.account, - session = _ref.session, - logger = _ref.logger, - device = _ref.device; - - _classCallCheck(this, UserLoginHandler); - - _this = _super.call(this); - Object.defineProperty(_assertThisInitialized(_this), _processLoginArray, { + class UserLoginHandler extends Array { + constructor(_ref, values) { + let { + request, + account, + session, + logger, + device + } = _ref; + super(); + Object.defineProperty(this, _processLoginArray, { value: _processLoginArray2 }); - Object.defineProperty(_assertThisInitialized(_this), _deleteUser, { + Object.defineProperty(this, _deleteUser, { value: _deleteUser2 }); - Object.defineProperty(_assertThisInitialized(_this), _handleCookieFromCache, { + Object.defineProperty(this, _handleCookieFromCache, { value: _handleCookieFromCache2 }); - Object.defineProperty(_assertThisInitialized(_this), _processOUL, { + Object.defineProperty(this, _processOUL, { value: _processOUL2 }); - Object.defineProperty(_assertThisInitialized(_this), _request$3, { + Object.defineProperty(this, _request$3, { writable: true, value: void 0 }); - Object.defineProperty(_assertThisInitialized(_this), _logger$4, { + Object.defineProperty(this, _logger$4, { writable: true, value: void 0 }); - Object.defineProperty(_assertThisInitialized(_this), _account$1, { + Object.defineProperty(this, _account$1, { writable: true, value: void 0 }); - Object.defineProperty(_assertThisInitialized(_this), _session$1, { + Object.defineProperty(this, _session$1, { writable: true, value: void 0 }); - Object.defineProperty(_assertThisInitialized(_this), _oldValues$2, { + Object.defineProperty(this, _oldValues$2, { writable: true, value: void 0 }); - Object.defineProperty(_assertThisInitialized(_this), _device$1, { + Object.defineProperty(this, _device$1, { writable: true, value: void 0 }); - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _request$3)[_request$3] = request; - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _account$1)[_account$1] = account; - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _session$1)[_session$1] = session; - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _logger$4)[_logger$4] = logger; - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _oldValues$2)[_oldValues$2] = values; - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _device$1)[_device$1] = device; - return _this; + _classPrivateFieldLooseBase(this, _request$3)[_request$3] = request; + _classPrivateFieldLooseBase(this, _account$1)[_account$1] = account; + _classPrivateFieldLooseBase(this, _session$1)[_session$1] = session; + _classPrivateFieldLooseBase(this, _logger$4)[_logger$4] = logger; + _classPrivateFieldLooseBase(this, _oldValues$2)[_oldValues$2] = values; + _classPrivateFieldLooseBase(this, _device$1)[_device$1] = device; } // On User Login - _createClass(UserLoginHandler, [{ - key: "clear", - value: function clear() { - _classPrivateFieldLooseBase(this, _logger$4)[_logger$4].debug('clear called. Reset flag has been set.'); + clear() { + _classPrivateFieldLooseBase(this, _logger$4)[_logger$4].debug('clear called. Reset flag has been set.'); + + _classPrivateFieldLooseBase(this, _deleteUser)[_deleteUser](); - _classPrivateFieldLooseBase(this, _deleteUser)[_deleteUser](); + StorageManager.setMetaProp(CLEAR, true); + } - StorageManager.setMetaProp(CLEAR, true); + push() { + for (var _len = arguments.length, profilesArr = new Array(_len), _key = 0; _key < _len; _key++) { + profilesArr[_key] = arguments[_key]; } - }, { - key: "push", - value: function push() { - for (var _len = arguments.length, profilesArr = new Array(_len), _key = 0; _key < _len; _key++) { - profilesArr[_key] = arguments[_key]; - } - _classPrivateFieldLooseBase(this, _processLoginArray)[_processLoginArray](profilesArr); + _classPrivateFieldLooseBase(this, _processLoginArray)[_processLoginArray](profilesArr); - return 0; - } - }, { - key: "_processOldValues", - value: function _processOldValues() { - if (_classPrivateFieldLooseBase(this, _oldValues$2)[_oldValues$2]) { - _classPrivateFieldLooseBase(this, _processLoginArray)[_processLoginArray](_classPrivateFieldLooseBase(this, _oldValues$2)[_oldValues$2]); - } + return 0; + } - _classPrivateFieldLooseBase(this, _oldValues$2)[_oldValues$2] = null; + _processOldValues() { + if (_classPrivateFieldLooseBase(this, _oldValues$2)[_oldValues$2]) { + _classPrivateFieldLooseBase(this, _processLoginArray)[_processLoginArray](_classPrivateFieldLooseBase(this, _oldValues$2)[_oldValues$2]); } - }]); - return UserLoginHandler; - }( /*#__PURE__*/_wrapNativeSuper(Array)); + _classPrivateFieldLooseBase(this, _oldValues$2)[_oldValues$2] = null; + } - var _processOUL2 = function _processOUL2(profileArr) { - var _this2 = this; + } - var sendOULFlag = true; + var _processOUL2 = function _processOUL2(profileArr) { + let sendOULFlag = true; StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag); - var addToK = function addToK(ids) { - var k = StorageManager.readFromLSorCookie(KCOOKIE_NAME); - var g = StorageManager.readFromLSorCookie(GCOOKIE_NAME); - var kId; + const addToK = ids => { + let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME); + const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME); + let kId; if (k == null) { k = {}; @@ -3238,8 +2823,8 @@ } else { /* check if already exists */ kId = k.id; - var anonymousUser = false; - var foundInCache = false; + let anonymousUser = false; + let foundInCache = false; if (kId == null) { kId = ids[0]; @@ -3259,9 +2844,9 @@ } else { // check if the id is present in the cache // set foundInCache to true - for (var idx in ids) { + for (const idx in ids) { if (ids.hasOwnProperty(idx)) { - var id = ids[idx]; + const id = ids[idx]; if ($ct.LRU_CACHE.cache[id]) { kId = id; @@ -3276,30 +2861,30 @@ if (kId !== $ct.LRU_CACHE.getLastKey()) { // New User found // remove the entire cache - _classPrivateFieldLooseBase(_this2, _handleCookieFromCache)[_handleCookieFromCache](); + _classPrivateFieldLooseBase(this, _handleCookieFromCache)[_handleCookieFromCache](); } else { sendOULFlag = false; StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag); } - var gFromCache = $ct.LRU_CACHE.get(kId); + const gFromCache = $ct.LRU_CACHE.get(kId); $ct.LRU_CACHE.set(kId, gFromCache); StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache); - _classPrivateFieldLooseBase(_this2, _device$1)[_device$1].gcookie = gFromCache; - var lastK = $ct.LRU_CACHE.getSecondLastKey(); + _classPrivateFieldLooseBase(this, _device$1)[_device$1].gcookie = gFromCache; + const lastK = $ct.LRU_CACHE.getSecondLastKey(); if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) { // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER - var lastGUID = $ct.LRU_CACHE.cache[lastK]; + const lastGUID = $ct.LRU_CACHE.cache[lastK]; - _classPrivateFieldLooseBase(_this2, _request$3)[_request$3].unregisterTokenForGuid(lastGUID); + _classPrivateFieldLooseBase(this, _request$3)[_request$3].unregisterTokenForGuid(lastGUID); } } else { if (!anonymousUser) { - _this2.clear(); + this.clear(); } else { if (g != null) { - _classPrivateFieldLooseBase(_this2, _device$1)[_device$1].gcookie = g; + _classPrivateFieldLooseBase(this, _device$1)[_device$1].gcookie = g; StorageManager.saveToLSorCookie(GCOOKIE_NAME, g); sendOULFlag = false; } @@ -3315,11 +2900,11 @@ }; if (Array.isArray(profileArr) && profileArr.length > 0) { - for (var index in profileArr) { + for (const index in profileArr) { if (profileArr.hasOwnProperty(index)) { - var outerObj = profileArr[index]; - var data = {}; - var profileObj = void 0; + const outerObj = profileArr[index]; + let data = {}; + let profileObj; if (outerObj.Site != null) { // organic data from the site @@ -3332,13 +2917,13 @@ } } else if (outerObj.Facebook != null) { // fb connect data - var FbProfileObj = outerObj.Facebook; // make sure that the object contains any data at all + const FbProfileObj = outerObj.Facebook; // make sure that the object contains any data at all if (!isObjectEmpty(FbProfileObj) && !FbProfileObj.error) { profileObj = processFBUserObj(FbProfileObj); } } else if (outerObj['Google Plus'] != null) { - var GPlusProfileObj = outerObj['Google Plus']; + const GPlusProfileObj = outerObj['Google Plus']; if (isObjectEmpty(GPlusProfileObj) && !GPlusProfileObj.error) { profileObj = processGPlusUserObj(GPlusProfileObj, { @@ -3357,7 +2942,7 @@ } data.profile = profileObj; - var ids = []; + const ids = []; if (StorageManager._isLocalStorageSupported()) { if (profileObj.Identity) { @@ -3393,9 +2978,9 @@ data[IS_OUL] = true; } - var compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$4)[_logger$4]); + const compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$4)[_logger$4]); - var pageLoadUrl = _classPrivateFieldLooseBase(this, _account$1)[_account$1].dataPostURL; + let pageLoadUrl = _classPrivateFieldLooseBase(this, _account$1)[_account$1].dataPostURL; pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH); pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData); // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request) @@ -3463,8 +3048,8 @@ var _processLoginArray2 = function _processLoginArray2(loginArr) { if (Array.isArray(loginArr) && loginArr.length > 0) { - var profileObj = loginArr.pop(); - var processProfile = profileObj != null && isObject(profileObj) && (profileObj.Site != null && Object.keys(profileObj.Site).length > 0 || profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0 || profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0); + const profileObj = loginArr.pop(); + const processProfile = profileObj != null && isObject(profileObj) && (profileObj.Site != null && Object.keys(profileObj.Site).length > 0 || profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0 || profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0); if (processProfile) { StorageManager.setInstantDeleteFlagInK(); @@ -3480,1362 +3065,1185 @@ } }; - var CTWebPersonalisationBanner = /*#__PURE__*/function (_HTMLElement) { - _inherits(CTWebPersonalisationBanner, _HTMLElement); - - var _super = _createSuper(CTWebPersonalisationBanner); - - function CTWebPersonalisationBanner() { - var _this; - - _classCallCheck(this, CTWebPersonalisationBanner); - - _this = _super.call(this); - _this._details = null; - _this.shadow = null; - _this.shadow = _this.attachShadow({ + class CTWebPersonalisationBanner extends HTMLElement { + constructor() { + super(); + this._details = null; + this.shadow = null; + this.shadow = this.attachShadow({ mode: 'open' }); - return _this; } - _createClass(CTWebPersonalisationBanner, [{ - key: "renderBanner", - value: function renderBanner() { - var _this2 = this; + get details() { + return this._details || ''; + } - this.shadow.innerHTML = this.getBannerContent(); + set details(val) { + if (this._details === null) { + this._details = val; + this.renderBanner(); + } + } - if (this.trackClick !== false) { - this.addEventListener('click', function () { - var onClickUrl = _this2.details.onClick; + renderBanner() { + this.shadow.innerHTML = this.getBannerContent(); - if (onClickUrl) { - _this2.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl; - } + if (this.trackClick !== false) { + this.addEventListener('click', () => { + const onClickUrl = this.details.onClick; - window.clevertap.renderNotificationClicked({ - msgId: _this2.msgId, - pivotId: _this2.pivotId - }); - }); - } + if (onClickUrl) { + this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl; + } - window.clevertap.renderNotificationViewed({ - msgId: this.msgId, - pivotId: this.pivotId + window.clevertap.renderNotificationClicked({ + msgId: this.msgId, + pivotId: this.pivotId + }); }); } - }, { - key: "getBannerContent", - value: function getBannerContent() { - return "\n \n
\n \n \n \n \"Please\n \n ").concat(this.details.html ? this.details.html : '', "\n
\n "); - } - }, { - key: "details", - get: function get() { - return this._details || ''; - }, - set: function set(val) { - if (this._details === null) { - this._details = val; - this.renderBanner(); - } - } - }]); - - return CTWebPersonalisationBanner; - }( /*#__PURE__*/_wrapNativeSuper(HTMLElement)); - var CTWebPersonalisationCarousel = /*#__PURE__*/function (_HTMLElement) { - _inherits(CTWebPersonalisationCarousel, _HTMLElement); - - var _super = _createSuper(CTWebPersonalisationCarousel); + window.clevertap.renderNotificationViewed({ + msgId: this.msgId, + pivotId: this.pivotId + }); + } - function CTWebPersonalisationCarousel() { - var _this; + getBannerContent() { + return "\n \n
\n \n \n \n \"Please\n \n ").concat(this.details.html ? this.details.html : '', "\n
\n "); + } - _classCallCheck(this, CTWebPersonalisationCarousel); + } - _this = _super.call(this); - _this._target = null; - _this._carousel = null; - _this.shadow = null; - _this.slides = 0; - _this.previouslySelectedItem = -1; - _this.selectedItem = 1; - _this.autoSlide = null; - _this.stopAutoSlideTimeout = null; - _this.shadow = _this.attachShadow({ + class CTWebPersonalisationCarousel extends HTMLElement { + constructor() { + super(); + this._target = null; + this._carousel = null; + this.shadow = null; + this.slides = 0; + this.previouslySelectedItem = -1; + this.selectedItem = 1; + this.autoSlide = null; + this.stopAutoSlideTimeout = null; + this.shadow = this.attachShadow({ mode: 'open' }); if (customElements.get('ct-web-personalisation-banner') === undefined) { customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner); } + } - return _this; + get target() { + return this._target || ''; } - _createClass(CTWebPersonalisationCarousel, [{ - key: "renderCarousel", - value: function renderCarousel() { - this.slides = this.details.length; - this.shadow.innerHTML = this.getStyles(); - var carousel = this.getCarouselContent(); + set target(val) { + if (this._target === null) { + this._target = val; + this.renderCarousel(); + } + } - if (this.display.showNavBtns) { - carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml); - } + get details() { + return this.target.display.details; + } - if (this.display.showNavArrows) { - carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml); - carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml); - } + get display() { + return this.target.display; + } - this._carousel = carousel; - this.shadow.appendChild(carousel); - this.setupClick(); - this.updateSelectedItem(); // TODO: enable conditionally + renderCarousel() { + this.slides = this.details.length; + this.shadow.innerHTML = this.getStyles(); + const carousel = this.getCarouselContent(); - this.startAutoSlide(); - this.setupOnHover(); - window.clevertap.renderNotificationViewed({ - msgId: this.target.wzrk_id, - pivotId: this.target.wzrk_pivot - }); + if (this.display.showNavBtns) { + carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml); } - }, { - key: "setupClick", - value: function setupClick() { - var _this2 = this; - - this._carousel.addEventListener('click', function (event) { - var eventID = event.target.id; - if (eventID.startsWith('carousel__button')) { - var selected = +eventID.split('-')[1]; + if (this.display.showNavArrows) { + carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml); + carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml); + } - if (selected !== _this2.selectedItem) { - _this2.previouslySelectedItem = _this2.selectedItem; - _this2.selectedItem = selected; + this._carousel = carousel; + this.shadow.appendChild(carousel); + this.setupClick(); + this.updateSelectedItem(); // TODO: enable conditionally - _this2.updateSelectedItem(); + this.startAutoSlide(); + this.setupOnHover(); + window.clevertap.renderNotificationViewed({ + msgId: this.target.wzrk_id, + pivotId: this.target.wzrk_pivot + }); + } - _this2.startAutoSlide(); - } - } else if (eventID.startsWith('carousel__arrow')) { - eventID.endsWith('right') ? _this2.goToNext() : _this2.goToPrev(); - - _this2.startAutoSlide(); - } else if (eventID.indexOf('-') > -1) { - var item = +eventID.split('-')[1]; - var index = item - 1; - - if (window.parent.clevertap) { - // console.log('Raise notification clicked event for ', item) - window.clevertap.renderNotificationClicked({ - msgId: _this2.target.wzrk_id, - pivotId: _this2.target.wzrk_pivot, - wzrk_slideNo: item - }); - } + setupClick() { + this._carousel.addEventListener('click', event => { + const eventID = event.target.id; - var url = _this2.details[index].onClick; + if (eventID.startsWith('carousel__button')) { + const selected = +eventID.split('-')[1]; - if (url !== '') { - _this2.details[index].window ? window.open(url, '_blank') : window.location.href = url; - } + if (selected !== this.selectedItem) { + this.previouslySelectedItem = this.selectedItem; + this.selectedItem = selected; + this.updateSelectedItem(); + this.startAutoSlide(); } - }); - } - }, { - key: "setupOnHover", - value: function setupOnHover() { - var _this3 = this; - - this._carousel.addEventListener('mouseenter', function (event) { - _this3.stopAutoSlideTimeout = setTimeout(function () { - _this3.autoSlide = clearInterval(_this3.autoSlide); - }, 500); - }); + } else if (eventID.startsWith('carousel__arrow')) { + eventID.endsWith('right') ? this.goToNext() : this.goToPrev(); + this.startAutoSlide(); + } else if (eventID.indexOf('-') > -1) { + const item = +eventID.split('-')[1]; + const index = item - 1; - this._carousel.addEventListener('mouseleave', function (event) { - clearTimeout(_this3.stopAutoSlideTimeout); - - if (_this3.autoSlide === undefined) { - _this3.startAutoSlide(); + if (window.parent.clevertap) { + // console.log('Raise notification clicked event for ', item) + window.clevertap.renderNotificationClicked({ + msgId: this.target.wzrk_id, + pivotId: this.target.wzrk_pivot, + wzrk_slideNo: item + }); } - }); - } - }, { - key: "getCarouselContent", - value: function getCarouselContent() { - var carousel = document.createElement('div'); - carousel.setAttribute('class', 'carousel'); - this.details.forEach(function (detail, i) { - var banner = document.createElement('ct-web-personalisation-banner'); - banner.classList.add('carousel__item'); - banner.trackClick = false; - banner.setAttribute('id', "carousel__item-".concat(i + 1)); - banner.details = detail; - carousel.appendChild(banner); - }); - return carousel; - } - }, { - key: "getStyles", - value: function getStyles() { - var _this$target, _this$target$display; - return "\n \n "); - } - }, { - key: "updateSelectedItem", - value: function updateSelectedItem() { - if (this.previouslySelectedItem !== -1) { - var prevItem = this.shadow.getElementById("carousel__item-".concat(this.previouslySelectedItem)); - var prevButton = this.shadow.getElementById("carousel__button-".concat(this.previouslySelectedItem)); - prevItem.classList.remove('carousel__item--selected'); + const url = this.details[index].onClick; - if (prevButton) { - prevButton.classList.remove('carousel__button--selected'); + if (url !== '') { + this.details[index].window ? window.open(url, '_blank') : window.location.href = url; } } + }); + } - var item = this.shadow.getElementById("carousel__item-".concat(this.selectedItem)); - var button = this.shadow.getElementById("carousel__button-".concat(this.selectedItem)); - item.classList.add('carousel__item--selected'); + setupOnHover() { + this._carousel.addEventListener('mouseenter', event => { + this.stopAutoSlideTimeout = setTimeout(() => { + this.autoSlide = clearInterval(this.autoSlide); + }, 500); + }); + + this._carousel.addEventListener('mouseleave', event => { + clearTimeout(this.stopAutoSlideTimeout); - if (button) { - button.classList.add('carousel__button--selected'); + if (this.autoSlide === undefined) { + this.startAutoSlide(); } - } - }, { - key: "startAutoSlide", - value: function startAutoSlide() { - var _this4 = this; + }); + } - clearInterval(this.autoSlide); - this.autoSlide = setInterval(function () { - _this4.goToNext(); - }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000); - } - }, { - key: "goToNext", - value: function goToNext() { - this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides); - } - }, { - key: "goToPrev", - value: function goToPrev() { - this.goTo(this.selectedItem, this.selectedItem - 1); - } - }, { - key: "goTo", - value: function goTo(prev, cur) { - this.previouslySelectedItem = prev; - this.selectedItem = cur; + getCarouselContent() { + const carousel = document.createElement('div'); + carousel.setAttribute('class', 'carousel'); + this.details.forEach((detail, i) => { + const banner = document.createElement('ct-web-personalisation-banner'); + banner.classList.add('carousel__item'); + banner.trackClick = false; + banner.setAttribute('id', "carousel__item-".concat(i + 1)); + banner.details = detail; + carousel.appendChild(banner); + }); + return carousel; + } - if (cur === 0) { - this.selectedItem = this.slides; - } + getStyles() { + var _this$target, _this$target$display; - this.updateSelectedItem(); - } - }, { - key: "target", - get: function get() { - return this._target || ''; - }, - set: function set(val) { - if (this._target === null) { - this._target = val; - this.renderCarousel(); + return "\n \n "); + } + + updateSelectedItem() { + if (this.previouslySelectedItem !== -1) { + const prevItem = this.shadow.getElementById("carousel__item-".concat(this.previouslySelectedItem)); + const prevButton = this.shadow.getElementById("carousel__button-".concat(this.previouslySelectedItem)); + prevItem.classList.remove('carousel__item--selected'); + + if (prevButton) { + prevButton.classList.remove('carousel__button--selected'); } } - }, { - key: "details", - get: function get() { - return this.target.display.details; - } - }, { - key: "display", - get: function get() { - return this.target.display; + + const item = this.shadow.getElementById("carousel__item-".concat(this.selectedItem)); + const button = this.shadow.getElementById("carousel__button-".concat(this.selectedItem)); + item.classList.add('carousel__item--selected'); + + if (button) { + button.classList.add('carousel__button--selected'); } - }]); + } - return CTWebPersonalisationCarousel; - }( /*#__PURE__*/_wrapNativeSuper(HTMLElement)); + startAutoSlide() { + clearInterval(this.autoSlide); + this.autoSlide = setInterval(() => { + this.goToNext(); + }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000); + } + + goToNext() { + this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides); + } + + goToPrev() { + this.goTo(this.selectedItem, this.selectedItem - 1); + } - var CTWebPopupImageOnly = /*#__PURE__*/function (_HTMLElement) { - _inherits(CTWebPopupImageOnly, _HTMLElement); + goTo(prev, cur) { + this.previouslySelectedItem = prev; + this.selectedItem = cur; - var _super = _createSuper(CTWebPopupImageOnly); + if (cur === 0) { + this.selectedItem = this.slides; + } - function CTWebPopupImageOnly() { - var _this; + this.updateSelectedItem(); + } - _classCallCheck(this, CTWebPopupImageOnly); + } - _this = _super.call(this); - _this._target = null; - _this._session = null; - _this.shadow = null; - _this.popup = null; - _this.container = null; - _this.resizeObserver = null; - _this.shadow = _this.attachShadow({ + class CTWebPopupImageOnly extends HTMLElement { + constructor() { + super(); + this._target = null; + this._session = null; + this.shadow = null; + this.popup = null; + this.container = null; + this.resizeObserver = null; + this.shadow = this.attachShadow({ mode: 'open' }); - return _this; } - _createClass(CTWebPopupImageOnly, [{ - key: "renderImageOnlyPopup", - value: function renderImageOnlyPopup() { - var _this2 = this; + get target() { + return this._target || ''; + } - var campaignId = this.target.wzrk_id.split('_')[0]; - var currentSessionId = this.session.sessionId; - this.shadow.innerHTML = this.getImageOnlyPopupContent(); - this.popup = this.shadowRoot.getElementById('imageOnlyPopup'); - this.container = this.shadowRoot.getElementById('container'); - this.closeIcon = this.shadowRoot.getElementById('close'); - this.popup.addEventListener('load', this.updateImageAndContainerWidth()); - this.resizeObserver = new ResizeObserver(function () { - return _this2.handleResize(_this2.popup, _this2.container); - }); - this.resizeObserver.observe(this.popup); - this.closeIcon.addEventListener('click', function () { - _this2.resizeObserver.unobserve(_this2.popup); + set target(val) { + if (this._target === null) { + this._target = val; + this.renderImageOnlyPopup(); + } + } - document.getElementById('wzrkImageOnlyDiv').style.display = 'none'; + get session() { + return this._session || ''; + } - _this2.remove(); + set session(val) { + this._session = val; + } - if (campaignId != null && campaignId !== '-1') { - if (StorageManager._isLocalStorageSupported()) { - var campaignObj = getCampaignObject(); - var sessionCampaignObj = campaignObj.wp[currentSessionId]; + get msgId() { + return this.target.wzrk_id; + } - if (sessionCampaignObj == null) { - sessionCampaignObj = {}; - campaignObj[currentSessionId] = sessionCampaignObj; - } + get pivotId() { + return this.target.wzrk_pivot; + } + + get onClickUrl() { + return this.target.display.onClickUrl; + } - sessionCampaignObj[campaignId] = 'dnd'; - saveCampaignObject(campaignObj); + renderImageOnlyPopup() { + const campaignId = this.target.wzrk_id.split('_')[0]; + const currentSessionId = this.session.sessionId; + this.shadow.innerHTML = this.getImageOnlyPopupContent(); + this.popup = this.shadowRoot.getElementById('imageOnlyPopup'); + this.container = this.shadowRoot.getElementById('container'); + this.closeIcon = this.shadowRoot.getElementById('close'); + this.popup.addEventListener('load', this.updateImageAndContainerWidth()); + this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container)); + this.resizeObserver.observe(this.popup); + this.closeIcon.addEventListener('click', () => { + this.resizeObserver.unobserve(this.popup); + document.getElementById('wzrkImageOnlyDiv').style.display = 'none'; + this.remove(); + + if (campaignId != null && campaignId !== '-1') { + if (StorageManager._isLocalStorageSupported()) { + const campaignObj = getCampaignObject(); + let sessionCampaignObj = campaignObj.wp[currentSessionId]; + + if (sessionCampaignObj == null) { + sessionCampaignObj = {}; + campaignObj[currentSessionId] = sessionCampaignObj; } + + sessionCampaignObj[campaignId] = 'dnd'; + saveCampaignObject(campaignObj); } - }); - window.clevertap.renderNotificationViewed({ - msgId: this.msgId, - pivotId: this.pivotId - }); + } + }); + window.clevertap.renderNotificationViewed({ + msgId: this.msgId, + pivotId: this.pivotId + }); - if (this.onClickUrl) { - this.popup.addEventListener('click', function () { - _this2.target.display.window ? window.open(_this2.onClickUrl, '_blank') : window.parent.location.href = _this2.onClickUrl; - window.clevertap.renderNotificationClicked({ - msgId: _this2.msgId, - pivotId: _this2.pivotId - }); + if (this.onClickUrl) { + this.popup.addEventListener('click', () => { + this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl; + window.clevertap.renderNotificationClicked({ + msgId: this.msgId, + pivotId: this.pivotId }); - } - } - }, { - key: "handleResize", - value: function handleResize(popup, container) { - var width = this.getRenderedImageWidth(popup); - container.style.setProperty('width', "".concat(width, "px")); - } - }, { - key: "getImageOnlyPopupContent", - value: function getImageOnlyPopupContent() { - return "\n ".concat(this.target.msgContent.css, "\n ").concat(this.target.msgContent.html, "\n "); + }); } - }, { - key: "updateImageAndContainerWidth", - value: function updateImageAndContainerWidth() { - var _this3 = this; - - return function () { - var width = _this3.getRenderedImageWidth(_this3.popup); + } - _this3.popup.style.setProperty('width', "".concat(width, "px")); + handleResize(popup, container) { + const width = this.getRenderedImageWidth(popup); + container.style.setProperty('width', "".concat(width, "px")); + } - _this3.container.style.setProperty('width', "".concat(width, "px")); + getImageOnlyPopupContent() { + return "\n ".concat(this.target.msgContent.css, "\n ").concat(this.target.msgContent.html, "\n "); + } - _this3.container.style.setProperty('height', 'auto'); + updateImageAndContainerWidth() { + return () => { + const width = this.getRenderedImageWidth(this.popup); + this.popup.style.setProperty('width', "".concat(width, "px")); + this.container.style.setProperty('width', "".concat(width, "px")); + this.container.style.setProperty('height', 'auto'); + this.container.style.setProperty('position', 'fixed'); + this.popup.style.setProperty('visibility', 'visible'); + this.closeIcon.style.setProperty('visibility', 'visible'); + document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'; + }; + } - _this3.container.style.setProperty('position', 'fixed'); + getRenderedImageWidth(img) { + const ratio = img.naturalWidth / img.naturalHeight; + return img.height * ratio; + } - _this3.popup.style.setProperty('visibility', 'visible'); + } - _this3.closeIcon.style.setProperty('visibility', 'visible'); + class Message extends HTMLElement { + constructor(config, message) { + super(); + this.wrapper = null; + this.snackBar = null; + this.shadow = this.attachShadow({ + mode: 'open' + }); + this.config = config; + this.message = message; + this.renderMessage(message); + } - document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'; - }; - } - }, { - key: "getRenderedImageWidth", - value: function getRenderedImageWidth(img) { - var ratio = img.naturalWidth / img.naturalHeight; - return img.height * ratio; - } - }, { - key: "target", - get: function get() { - return this._target || ''; - }, - set: function set(val) { - if (this._target === null) { - this._target = val; - this.renderImageOnlyPopup(); - } - } - }, { - key: "session", - get: function get() { - return this._session || ''; - }, - set: function set(val) { - this._session = val; - } - }, { - key: "msgId", - get: function get() { - return this.target.wzrk_id; - } - }, { - key: "pivotId", - get: function get() { - return this.target.wzrk_pivot; - } - }, { - key: "onClickUrl", - get: function get() { - return this.target.display.onClickUrl; - } - }]); + get pivotId() { + return this.message.wzrk_pivot; + } - return CTWebPopupImageOnly; - }( /*#__PURE__*/_wrapNativeSuper(HTMLElement)); + get campaignId() { + return this.message.wzrk_id; + } - var Message = /*#__PURE__*/function (_HTMLElement) { - _inherits(Message, _HTMLElement); + createEl(type, id, part) { + const _el = document.createElement(type); - var _super = _createSuper(Message); + _el.setAttribute('id', id); - function Message(config, message) { - var _this; + _el.setAttribute('part', part || id); - _classCallCheck(this, Message); + return _el; + } - _this = _super.call(this); - _this.wrapper = null; - _this.snackBar = null; - _this.shadow = _this.attachShadow({ - mode: 'open' - }); - _this.config = config; - _this.message = message; + renderMessage(msg) { + this.wrapper = this.createEl('div', 'messageWrapper'); - _this.renderMessage(message); + switch (msg.templateType) { + case 'text-only': + case 'text-with-icon': + case 'text-with-icon-and-image': + { + const message = this.prepareBasicMessage(msg.msg[0]); + this.wrapper.appendChild(message); + } + } - return _this; - } + const timeStamp = this.createEl('div', 'timeStamp'); + timeStamp.innerHTML = "".concat(determineTimeStampText(msg.id.split('_')[1]), ""); - _createClass(Message, [{ - key: "createEl", - value: function createEl(type, id, part) { - var _el = document.createElement(type); + if (!msg.viewed) { + const unreadMarker = this.createEl('span', 'unreadMarker'); + timeStamp.appendChild(unreadMarker); + } - _el.setAttribute('id', id); + this.wrapper.appendChild(timeStamp); + this.shadow.appendChild(this.wrapper); + } - _el.setAttribute('part', part || id); + prepareBasicMessage(msg) { + const message = this.createEl('div', 'message'); - return _el; + if (msg.imageUrl) { + const imageContainer = this.addImage(msg.imageUrl, 'mainImg'); + message.appendChild(imageContainer); } - }, { - key: "renderMessage", - value: function renderMessage(msg) { - this.wrapper = this.createEl('div', 'messageWrapper'); - switch (msg.templateType) { - case 'text-only': - case 'text-with-icon': - case 'text-with-icon-and-image': - { - var message = this.prepareBasicMessage(msg.msg[0]); - this.wrapper.appendChild(message); - } - } + const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper'); - var timeStamp = this.createEl('div', 'timeStamp'); - timeStamp.innerHTML = "".concat(determineTimeStampText(msg.id.split('_')[1]), ""); + if (msg.iconUrl) { + const iconContainer = this.addImage(msg.iconUrl, 'iconImg'); + iconTitleDescWrapper.appendChild(iconContainer); + } - if (!msg.viewed) { - var unreadMarker = this.createEl('span', 'unreadMarker'); - timeStamp.appendChild(unreadMarker); - } + const titleDescWrapper = this.createEl('div', 'titleDescWrapper'); - this.wrapper.appendChild(timeStamp); - this.shadow.appendChild(this.wrapper); + if (msg.title) { + const title = this.createEl('div', 'title'); + title.innerText = msg.title; + titleDescWrapper.appendChild(title); } - }, { - key: "prepareBasicMessage", - value: function prepareBasicMessage(msg) { - var message = this.createEl('div', 'message'); - if (msg.imageUrl) { - var imageContainer = this.addImage(msg.imageUrl, 'mainImg'); - message.appendChild(imageContainer); - } + if (msg.description) { + const description = this.createEl('div', 'description'); + description.innerText = msg.description; + titleDescWrapper.appendChild(description); + } - var iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper'); + if (msg.title || msg.description) { + iconTitleDescWrapper.appendChild(titleDescWrapper); + } - if (msg.iconUrl) { - var iconContainer = this.addImage(msg.iconUrl, 'iconImg'); - iconTitleDescWrapper.appendChild(iconContainer); - } + if (msg.iconUrl || msg.title || msg.description) { + message.appendChild(iconTitleDescWrapper); + } - var titleDescWrapper = this.createEl('div', 'titleDescWrapper'); + if (msg.buttons && msg.buttons.length) { + const buttonsContainer = this.addButtons(msg.buttons); + message.appendChild(buttonsContainer); + } - if (msg.title) { - var title = this.createEl('div', 'title'); - title.innerText = msg.title; - titleDescWrapper.appendChild(title); - } + return message; + } - if (msg.description) { - var description = this.createEl('div', 'description'); - description.innerText = msg.description; - titleDescWrapper.appendChild(description); - } + addButtons() { + let buttons = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + const buttonsContainer = this.createEl('div', 'buttonsContainer'); + let hasCopyAction = false; + buttons.forEach((b, i) => { + const button = this.createEl('button', "button-".concat(i), 'button'); + button.innerText = b.text; - if (msg.title || msg.description) { - iconTitleDescWrapper.appendChild(titleDescWrapper); + if (i > 0) { + button.style.cssText += 'margin-left: 2px;'; } - if (msg.iconUrl || msg.title || msg.description) { - message.appendChild(iconTitleDescWrapper); + if (b.action === 'copy') { + hasCopyAction = true; } - if (msg.buttons && msg.buttons.length) { - var buttonsContainer = this.addButtons(msg.buttons); - message.appendChild(buttonsContainer); - } + buttonsContainer.appendChild(button); + }); - return message; + if (hasCopyAction) { + this.addSnackbar(buttonsContainer); } - }, { - key: "addButtons", - value: function addButtons() { - var _this2 = this; - - var buttons = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - var buttonsContainer = this.createEl('div', 'buttonsContainer'); - var hasCopyAction = false; - buttons.forEach(function (b, i) { - var button = _this2.createEl('button', "button-".concat(i), 'button'); - button.innerText = b.text; + return buttonsContainer; + } - if (i > 0) { - button.style.cssText += 'margin-left: 2px;'; - } + addSnackbar(buttonsContainer) { + this.snackBar = this.createEl('div', "snackbar-".concat(this.campaignId), 'snackbar'); + this.snackBar.innerHTML = greenTickSvg; + const clipboardMsg = this.createEl('span', "snackbar-msg-".concat(this.campaignId), 'snackbar-msg'); + clipboardMsg.innerText = 'Copied to clipboard'; + this.snackBar.appendChild(clipboardMsg); + buttonsContainer.appendChild(this.snackBar); + } - if (b.action === 'copy') { - hasCopyAction = true; - } + addImage(url, type) { + const imageContainer = this.createEl('div', "".concat(type, "Container")); + const image = this.createEl('img', type); + image.setAttribute('src', url); // images will be fetched as and when the element comes into the viewport - buttonsContainer.appendChild(button); - }); + image.setAttribute('loading', 'lazy'); + imageContainer.appendChild(image); + return imageContainer; + } - if (hasCopyAction) { - this.addSnackbar(buttonsContainer); - } - - return buttonsContainer; - } - }, { - key: "addSnackbar", - value: function addSnackbar(buttonsContainer) { - this.snackBar = this.createEl('div', "snackbar-".concat(this.campaignId), 'snackbar'); - this.snackBar.innerHTML = greenTickSvg; - var clipboardMsg = this.createEl('span', "snackbar-msg-".concat(this.campaignId), 'snackbar-msg'); - clipboardMsg.innerText = 'Copied to clipboard'; - this.snackBar.appendChild(clipboardMsg); - buttonsContainer.appendChild(this.snackBar); - } - }, { - key: "addImage", - value: function addImage(url, type) { - var imageContainer = this.createEl('div', "".concat(type, "Container")); - var image = this.createEl('img', type); - image.setAttribute('src', url); // images will be fetched as and when the element comes into the viewport - - image.setAttribute('loading', 'lazy'); - imageContainer.appendChild(image); - return imageContainer; - } - }, { - key: "raiseClickedEvent", - value: function raiseClickedEvent(path, isPreview) { - switch (this.message.templateType) { - case 'text-only': - case 'text-with-icon': - case 'text-with-icon-and-image': - { - this.raiseClickedForBasicTemplates(path, isPreview); - } - } + raiseClickedEvent(path, isPreview) { + switch (this.message.templateType) { + case 'text-only': + case 'text-with-icon': + case 'text-with-icon-and-image': + { + this.raiseClickedForBasicTemplates(path, isPreview); + } } - }, { - key: "raiseClickedForBasicTemplates", - value: function raiseClickedForBasicTemplates(path, isPreview) { - var _this3 = this; - - var msg = this.message.msg[0]; - var payload = { - msgId: this.campaignId, - pivotId: this.pivotId - }; + } - if (path.tagName === 'BUTTON') { - var id = path.id.split('-')[1]; - var button = msg.buttons[id]; - payload.kv = { - wzrk_c2a: button.text - }; + raiseClickedForBasicTemplates(path, isPreview) { + const msg = this.message.msg[0]; + const payload = { + msgId: this.campaignId, + pivotId: this.pivotId + }; - if (button.action === 'url') { - button.openUrlInNewTab ? window.open(button.url, '_blank') : window.location = button.url; - } else if (button.action === 'copy') { - window.focus(); - navigator.clipboard.writeText(button.clipboardText); - this.snackBar.style.setProperty('display', 'flex', 'important'); - setTimeout(function () { - _this3.snackBar.style.setProperty('display', 'none', 'important'); - }, 2000); - } - } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) { - msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : window.location = msg.onClickUrl; - } + if (path.tagName === 'BUTTON') { + const id = path.id.split('-')[1]; + const button = msg.buttons[id]; + payload.kv = { + wzrk_c2a: button.text + }; - if (isPreview) { - console.log('Notifiction clicked event will be raised at run time with payload ::', payload); - } else { - window.clevertap.renderNotificationClicked(payload); + if (button.action === 'url') { + button.openUrlInNewTab ? window.open(button.url, '_blank') : window.location = button.url; + } else if (button.action === 'copy') { + window.focus(); + navigator.clipboard.writeText(button.clipboardText); + this.snackBar.style.setProperty('display', 'flex', 'important'); + setTimeout(() => { + this.snackBar.style.setProperty('display', 'none', 'important'); + }, 2000); } + } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) { + msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : window.location = msg.onClickUrl; } - }, { - key: "pivotId", - get: function get() { - return this.message.wzrk_pivot; - } - }, { - key: "campaignId", - get: function get() { - return this.message.wzrk_id; + + if (isPreview) { + console.log('Notifiction clicked event will be raised at run time with payload ::', payload); + } else { + window.clevertap.renderNotificationClicked(payload); } - }]); + } - return Message; - }( /*#__PURE__*/_wrapNativeSuper(HTMLElement)); + } - var messageStyles = function messageStyles(_ref) { - var backgroundColor = _ref.backgroundColor, - borderColor = _ref.borderColor, - titleColor = _ref.titleColor, - descriptionColor = _ref.descriptionColor, - buttonColor = _ref.buttonColor, - buttonTextColor = _ref.buttonTextColor, - unreadMarkerColor = _ref.unreadMarkerColor; + const messageStyles = (_ref) => { + let { + backgroundColor, + borderColor, + titleColor, + descriptionColor, + buttonColor, + buttonTextColor, + unreadMarkerColor + } = _ref; return "\n \n "); }; - var inboxContainerStyles = function inboxContainerStyles(_ref2) { - var panelBackgroundColor = _ref2.panelBackgroundColor, - panelBorderColor = _ref2.panelBorderColor, - headerBackgroundColor = _ref2.headerBackgroundColor, - headerTitleColor = _ref2.headerTitleColor, - closeIconColor = _ref2.closeIconColor, - categoriesTabColor = _ref2.categoriesTabColor, - categoriesTitleColor = _ref2.categoriesTitleColor, - categoriesBorderColor = _ref2.categoriesBorderColor, - selectedCategoryTabColor = _ref2.selectedCategoryTabColor, - selectedCategoryTitleColor = _ref2.selectedCategoryTitleColor, - selectedCategoryBorderColor = _ref2.selectedCategoryBorderColor, - headerCategoryHeight = _ref2.headerCategoryHeight; + const inboxContainerStyles = (_ref2) => { + let { + panelBackgroundColor, + panelBorderColor, + headerBackgroundColor, + headerTitleColor, + closeIconColor, + categoriesTabColor, + categoriesTitleColor, + categoriesBorderColor, + selectedCategoryTabColor, + selectedCategoryTitleColor, + selectedCategoryBorderColor, + headerCategoryHeight + } = _ref2; return "\n \n "); }; - var Inbox = /*#__PURE__*/function (_HTMLElement) { - _inherits(Inbox, _HTMLElement); - - var _super = _createSuper(Inbox); - - function Inbox(logger) { - var _this; - - _classCallCheck(this, Inbox); - - _this = _super.call(this); - _this.isInboxOpen = false; - _this.isInboxFromFlutter = false; - _this.selectedCategory = null; - _this.unviewedMessages = {}; - _this.unviewedCounter = 0; - _this.isPreview = false; - _this.inboxConfigForPreview = {}; - _this.inboxSelector = null; - _this.inbox = null; - _this.emptyInboxMsg = null; - _this.inboxCard = null; - _this.unviewedBadge = null; - _this.observer = null; - _this.selectedCategoryRef = null; - - _this.addClickListenerOnDocument = function () { - return function (e) { - if (e.composedPath().includes(_this.inbox)) { + class Inbox extends HTMLElement { + constructor(logger) { + super(); + this.isInboxOpen = false; + this.isInboxFromFlutter = false; + this.selectedCategory = null; + this.unviewedMessages = {}; + this.unviewedCounter = 0; + this.isPreview = false; + this.inboxConfigForPreview = {}; + this.inboxSelector = null; + this.inbox = null; + this.emptyInboxMsg = null; + this.inboxCard = null; + this.unviewedBadge = null; + this.observer = null; + this.selectedCategoryRef = null; + + this.addClickListenerOnDocument = (() => { + return e => { + if (e.composedPath().includes(this.inbox)) { // path is not supported on FF. So we fallback to e.composedPath - var path = e.path || e.composedPath && e.composedPath(); + const path = e.path || e.composedPath && e.composedPath(); if (path.length) { - var id = path[0].id; + const id = path[0].id; if (id === 'closeInbox') { - _this.toggleInbox(); + this.toggleInbox(); } else if (id.startsWith('category-')) { - _this.prevCategoryRef = _this.selectedCategoryRef; - _this.selectedCategoryRef = path[0]; - - _this.updateActiveCategory(path[0].innerText); + this.prevCategoryRef = this.selectedCategoryRef; + this.selectedCategoryRef = path[0]; + this.updateActiveCategory(path[0].innerText); } else { - var _path = path.filter(function (p) { + const _path = path.filter(p => { var _p$id; return ((_p$id = p.id) === null || _p$id === void 0 ? void 0 : _p$id.startsWith('button-')) || p.tagName === 'CT-INBOX-MESSAGE'; }); if (_path.length) { - var messageEl = _path[_path.length - 1]; - messageEl.raiseClickedEvent(_path[0], _this.isPreview); + const messageEl = _path[_path.length - 1]; + messageEl.raiseClickedEvent(_path[0], this.isPreview); } } } - } else if (_this.inboxSelector.contains(e.target) || _this.isInboxOpen) { - if (_this.isInboxFromFlutter) { - _this.isInboxFromFlutter = false; + } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) { + if (this.isInboxFromFlutter) { + this.isInboxFromFlutter = false; } else { - _this.toggleInbox(e); + this.toggleInbox(e); } } }; - }(); + })(); - _this.setBadgeStyle = function (msgCount) { - if (_this.unviewedBadge !== null) { - _this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount; - _this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'; + this.setBadgeStyle = msgCount => { + if (this.unviewedBadge !== null) { + this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount; + this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'; } }; - _this.logger = logger; - _this.shadow = _this.attachShadow({ + this.logger = logger; + this.shadow = this.attachShadow({ mode: 'open' }); - return _this; } - _createClass(Inbox, [{ - key: "connectedCallback", - value: function connectedCallback() { - this.init(); - } - }, { - key: "init", - value: function init() { - this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}; - - if (Object.keys(this.config).length === 0) { - return; - } - - this.inboxSelector = document.getElementById(this.config.inboxSelector); + get incomingMessages() { + return []; + } - if (this.inboxSelector === null) { - return; - } + set incomingMessages(msgs) { + if (msgs === void 0) { + msgs = []; + } - if (this.config.styles.notificationsBadge) { - this.addUnviewedBadge(); - } else if (this.unviewedBadge) { - this.unviewedBadge.remove(); - } + if (msgs.length > 0 && this.inbox) { + this.updateInboxMessages(msgs); + } + } - this.createinbox(); - /** - * We need to remove the listener as there could be a scenario where init would be called when - * we get updated web inbox settings from LC after the inbox has been initialised. - * It can so happen that the inbox-selector would have changed. - */ + get incomingMessagesForPreview() { + return []; + } - document.removeEventListener('click', this.addClickListenerOnDocument); - document.addEventListener('click', this.addClickListenerOnDocument); - this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText); - this.shadow.innerHTML = this.getInboxStyles(); - this.shadow.appendChild(this.inbox); + set incomingMessagesForPreview(msgs) { + if (msgs === void 0) { + msgs = []; } - }, { - key: "addMsgsToInboxFromLS", - value: function addMsgsToInboxFromLS() { - var _this2 = this; - var messages = this.deleteExpiredAndGetUnexpiredMsgs(false); - var msgIds = messages ? Object.keys(messages) : []; - - if (msgIds.length === 0) { - return; - } + const previewMsgs = {}; - msgIds.forEach(function (m) { - if (!messages[m].viewed) { - _this2.unviewedMessages[m] = messages[m]; - _this2.unviewedCounter++; - } + if (msgs.length > 0 && this.inbox) { + this.isPreview = true; + this.unviewedCounter = 0; + msgs.forEach(m => { + const key = "".concat(m.wzrk_id.split('_')[0], "_").concat(Date.now()); + m.id = key; + previewMsgs[key] = m; + this.unviewedMessages[key] = m; + this.unviewedCounter++; }); - this.buildUIForMessages(messages); + this.buildUIForMessages(previewMsgs); this.updateUnviewedBadgeCounter(); } - /** - * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM - * It'll be false when you are building the inbox layout for the very first time. - * - * This method reads the inbox messages from LS, - * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed, - * sorts the messages based on the date, - * saves the unexpired messages to LS - * and returns the sorted unexpired messages - * - * Scenarios when we encounter expired messages - - * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering - * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox - * a. You'll find the expired msg in inbox - * b. You'll not find the expired msg in inbox. - * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.) - * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed. - */ - - }, { - key: "deleteExpiredAndGetUnexpiredMsgs", - value: function deleteExpiredAndGetUnexpiredMsgs() { - var deleteMsgsFromUI = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; - var messages = getInboxMessages(); - var now = Math.floor(Date.now() / 1000); - - for (var msg in messages) { - if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) { - if (deleteMsgsFromUI) { - var el = this.shadowRoot.getElementById(messages[msg].id); - el && el.remove(); - - if (!messages[msg].viewed) { - this.unviewedCounter--; - this.updateUnviewedBadgeCounter(); - } - } + } - delete messages[msg]; - } - } + connectedCallback() { + this.init(); + } - if (messages && messages.length > 0) { - messages = Object.values(messages).sort(function (a, b) { - return b.date - a.date; - }).reduce(function (acc, m) { - acc[m.id] = m; - return acc; - }, {}); - } + init() { + this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}; - saveInboxMessages(messages); - return messages; - } - }, { - key: "updateInboxMessages", - value: function updateInboxMessages() { - var _this3 = this; - - var msgs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - var inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs(); - var date = Date.now(); - var incomingMsgs = {}; - msgs.forEach(function (m, i) { - var key = "".concat(m.wzrk_id.split('_')[0], "_").concat(Date.now()); - m.id = key; // We are doing this to preserve the order of the messages - - m.date = date - i; - m.viewed = 0; - inboxMsgs[key] = m; - incomingMsgs[key] = m; - _this3.unviewedMessages[key] = m; - _this3.unviewedCounter++; - }); - saveInboxMessages(inboxMsgs); - this.buildUIForMessages(incomingMsgs); - this.updateUnviewedBadgeCounter(); + if (Object.keys(this.config).length === 0) { + return; } - }, { - key: "createEl", - value: function createEl(type, id, part) { - var _el = document.createElement(type); - _el.setAttribute('id', id); + this.inboxSelector = document.getElementById(this.config.inboxSelector); - _el.setAttribute('part', part || id); + if (this.inboxSelector === null) { + return; + } - return _el; + if (this.config.styles.notificationsBadge) { + this.addUnviewedBadge(); + } else if (this.unviewedBadge) { + this.unviewedBadge.remove(); } - }, { - key: "addUnviewedBadge", - value: function addUnviewedBadge() { - var _this4 = this; - if (!this.unviewedBadge) { - this.unviewedBadge = this.createEl('div', 'unviewedBadge'); // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles + this.createinbox(); + /** + * We need to remove the listener as there could be a scenario where init would be called when + * we get updated web inbox settings from LC after the inbox has been initialised. + * It can so happen that the inbox-selector would have changed. + */ - this.unviewedBadge.style.cssText = "display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ".concat(this.config.styles.notificationsBadge.backgroundColor, "; font-size: 12px; color: ").concat(this.config.styles.notificationsBadge.textColor, "; font-weight: bold; align-items: center; justify-content: center;"); - document.body.appendChild(this.unviewedBadge); - } + document.removeEventListener('click', this.addClickListenerOnDocument); + document.addEventListener('click', this.addClickListenerOnDocument); + this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText); + this.shadow.innerHTML = this.getInboxStyles(); + this.shadow.appendChild(this.inbox); + } - this.updateUnviewedBadgePosition(); // called when user switches b/w portrait and landscape mode. + addMsgsToInboxFromLS() { + const messages = this.deleteExpiredAndGetUnexpiredMsgs(false); + const msgIds = messages ? Object.keys(messages) : []; - window.addEventListener('resize', function () { - _this4.updateUnviewedBadgePosition(); - }); + if (msgIds.length === 0) { + return; } - }, { - key: "updateUnviewedBadgePosition", - value: function updateUnviewedBadgePosition() { - var _this$inboxSelector$g = this.inboxSelector.getBoundingClientRect(), - top = _this$inboxSelector$g.top, - right = _this$inboxSelector$g.right; - - this.unviewedBadge.style.top = "".concat(top - 8, "px"); - this.unviewedBadge.style.left = "".concat(right - 8, "px"); - } - }, { - key: "createinbox", - value: function createinbox() { - var _this5 = this; - - this.inbox = this.createEl('div', 'inbox'); - var header = this.createEl('div', 'header'); - var headerTitle = this.createEl('div', 'headerTitle'); - headerTitle.innerText = this.config.title; - var closeIcon = this.createEl('div', 'closeInbox'); - closeIcon.innerHTML = '×'; - header.appendChild(headerTitle); - header.appendChild(closeIcon); - this.inbox.appendChild(header); - if (this.config.categories.length) { - var categories = this.createCategories(); - this.inbox.appendChild(categories); + msgIds.forEach(m => { + if (!messages[m].viewed) { + this.unviewedMessages[m] = messages[m]; + this.unviewedCounter++; } + }); + this.buildUIForMessages(messages); + this.updateUnviewedBadgeCounter(); + } + /** + * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM + * It'll be false when you are building the inbox layout for the very first time. + * + * This method reads the inbox messages from LS, + * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed, + * sorts the messages based on the date, + * saves the unexpired messages to LS + * and returns the sorted unexpired messages + * + * Scenarios when we encounter expired messages - + * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering + * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox + * a. You'll find the expired msg in inbox + * b. You'll not find the expired msg in inbox. + * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.) + * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed. + */ - this.inboxCard = this.createEl('div', 'inboxCard'); - this.inbox.appendChild(this.inboxCard); - this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg'); - this.emptyInboxMsg.innerText = 'All messages will be displayed here.'; - this.inboxCard.appendChild(this.emptyInboxMsg); // Intersection observer for notification viewed - - var options = { - root: this.inboxCard, - rootMargin: '0px', - threshold: 0.5 - }; - this.observer = new IntersectionObserver(function (entries, observer) { - _this5.handleMessageViewed(entries); - }, options); - this.addMsgsToInboxFromLS(); - } - }, { - key: "createCategories", - value: function createCategories() { - var _this6 = this; - - var categoriesContainer = this.createEl('div', 'categoriesContainer'); - var leftArrow = this.createEl('div', 'leftArrow'); - leftArrow.innerHTML = arrowSvg; - leftArrow.children[0].style = 'transform: rotate(180deg)'; - leftArrow.addEventListener('click', function () { - _this6.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0); - }); - categoriesContainer.appendChild(leftArrow); - var categoriesWrapper = this.createEl('div', 'categoriesWrapper'); - - var _categories = ['All'].concat(_toConsumableArray(this.config.categories)); - - _categories.forEach(function (c, i) { - var category = _this6.createEl('div', "category-".concat(i), 'category'); - - category.innerText = c; - - if (i === 0) { - _this6.selectedCategoryRef = category; - } - - categoriesWrapper.appendChild(category); - }); - categoriesContainer.appendChild(categoriesWrapper); - var rightArrow = this.createEl('div', 'rightArrow'); - rightArrow.innerHTML = arrowSvg; - rightArrow.addEventListener('click', function () { - _this6.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0); - }); - categoriesContainer.appendChild(rightArrow); - var options = { - root: categoriesContainer, - threshold: 0.9 - }; - var firstCategory = categoriesWrapper.children[0]; - var lastCategory = categoriesWrapper.children[this.config.categories.length]; - var firstCategoryObserver = new IntersectionObserver(function (e) { - _this6.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9); - }, options); - firstCategoryObserver.observe(firstCategory); - var lastCategoryObserver = new IntersectionObserver(function (e) { - _this6.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9); - }, options); - lastCategoryObserver.observe(lastCategory); - return categoriesContainer; - } - }, { - key: "categoryObserverCb", - value: function categoryObserverCb(el, hide) { - if (!el) { - return; - } + deleteExpiredAndGetUnexpiredMsgs() { + let deleteMsgsFromUI = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + let messages = getInboxMessages(); + const now = Math.floor(Date.now() / 1000); - el.style.display = hide ? 'none' : 'flex'; - } - }, { - key: "updateActiveCategory", - value: function updateActiveCategory(activeCategory) { - var _this7 = this; + for (const msg in messages) { + if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) { + if (deleteMsgsFromUI) { + const el = this.shadowRoot.getElementById(messages[msg].id); + el && el.remove(); - this.selectedCategory = activeCategory; - this.inboxCard.scrollTop = 0; - var counter = 0; - this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false'); - this.selectedCategoryRef.setAttribute('selected', 'true'); - this.inboxCard.childNodes.forEach(function (c) { - if (c.getAttribute('id') !== 'emptyInboxMsg') { - c.style.display = _this7.selectedCategory === 'All' || c.getAttribute('category') === _this7.selectedCategory ? 'block' : 'none'; - - if (c.style.display === 'block') { - counter++; + if (!messages[msg].viewed) { + this.unviewedCounter--; + this.updateUnviewedBadgeCounter(); } } - }); - if (counter === 0) { - this.emptyInboxMsg.innerText = "".concat(activeCategory, " messages will be displayed here."); - this.emptyInboxMsg.style.display = 'block'; - } else { - this.emptyInboxMsg.style.display = 'none'; + delete messages[msg]; } } - }, { - key: "buildUIForMessages", - value: function buildUIForMessages() { - var _this$config$maxMsgsI; - var messages = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - !this.isPreview && this.updateTSForRenderedMsgs(); - this.inboxCard.scrollTop = 0; - var maxMsgsInInbox = (_this$config$maxMsgsI = this.config.maxMsgsInInbox) !== null && _this$config$maxMsgsI !== void 0 ? _this$config$maxMsgsI : MAX_INBOX_MSG; - var firstChild = this.inboxCard.firstChild; - var sortedMsgs = Object.values(messages).sort(function (a, b) { - return b.date - a.date; - }).map(function (m) { - return m.id; - }); + if (messages && messages.length > 0) { + messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { + acc[m.id] = m; + return acc; + }, {}); + } - var _iterator = _createForOfIteratorHelper(sortedMsgs), - _step; + saveInboxMessages(messages); + return messages; + } - try { - for (_iterator.s(); !(_step = _iterator.n()).done;) { - var m = _step.value; - var item = new Message(this.config, messages[m]); - item.setAttribute('id', messages[m].id); - item.setAttribute('pivot', messages[m].wzrk_pivot); - item.setAttribute('part', 'ct-inbox-message'); - - if (this.config.categories.length > 0) { - item.setAttribute('category', messages[m].tags[0] || ''); - item.style.display = this.selectedCategory === 'All' || messages[m].category === this.selectedCategory ? 'block' : 'none'; - } else { - item.style.display = 'block'; - } + updateInboxMessages() { + let msgs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs(); + const date = Date.now(); + const incomingMsgs = {}; + msgs.forEach((m, i) => { + const key = "".concat(m.wzrk_id.split('_')[0], "_").concat(Date.now()); + m.id = key; // We are doing this to preserve the order of the messages + + m.date = date - i; + m.viewed = 0; + inboxMsgs[key] = m; + incomingMsgs[key] = m; + this.unviewedMessages[key] = m; + this.unviewedCounter++; + }); + saveInboxMessages(inboxMsgs); + this.buildUIForMessages(incomingMsgs); + this.updateUnviewedBadgeCounter(); + } - this.inboxCard.insertBefore(item, firstChild); - this.observer.observe(item); - } - } catch (err) { - _iterator.e(err); - } finally { - _iterator.f(); - } + createEl(type, id, part) { + const _el = document.createElement(type); - var msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length; + _el.setAttribute('id', id); - while (msgTotalCount > maxMsgsInInbox) { - var ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message'); + _el.setAttribute('part', part || id); - if (ctInboxMsgs.length > 0) { - ctInboxMsgs[ctInboxMsgs.length - 1].remove(); - } + return _el; + } - msgTotalCount--; - } + addUnviewedBadge() { + if (!this.unviewedBadge) { + this.unviewedBadge = this.createEl('div', 'unviewedBadge'); // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles - var hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*="display: block"]').length; - this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'; + this.unviewedBadge.style.cssText = "display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ".concat(this.config.styles.notificationsBadge.backgroundColor, "; font-size: 12px; color: ").concat(this.config.styles.notificationsBadge.textColor, "; font-weight: bold; align-items: center; justify-content: center;"); + document.body.appendChild(this.unviewedBadge); } - /** - * Adds a click listener on the document. For every click we check - * 1. if the click has happenned within the inbox - * - on close button, we close the inbox - * - on any of the category, we set that as the activeCategory - * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-') - * 2. if the user has clicked on the inboxSelector, we toggle inbox - * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it - */ - }, { - key: "handleMessageViewed", + this.updateUnviewedBadgePosition(); // called when user switches b/w portrait and landscape mode. - /** - * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50% - * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event - */ - value: function handleMessageViewed(entries) { - var _this8 = this; + window.addEventListener('resize', () => { + this.updateUnviewedBadgePosition(); + }); + } - var raiseViewedEvent = !this.isPreview; + updateUnviewedBadgePosition() { + const { + top, + right + } = this.inboxSelector.getBoundingClientRect(); + this.unviewedBadge.style.top = "".concat(top - 8, "px"); + this.unviewedBadge.style.left = "".concat(right - 8, "px"); + } - if (this.isInboxOpen) { - entries.forEach(function (e) { - if (e.isIntersecting && _this8.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) { - e.target.message.viewed = 1; + createinbox() { + this.inbox = this.createEl('div', 'inbox'); + const header = this.createEl('div', 'header'); + const headerTitle = this.createEl('div', 'headerTitle'); + headerTitle.innerText = this.config.title; + const closeIcon = this.createEl('div', 'closeInbox'); + closeIcon.innerHTML = '×'; + header.appendChild(headerTitle); + header.appendChild(closeIcon); + this.inbox.appendChild(header); + + if (this.config.categories.length) { + const categories = this.createCategories(); + this.inbox.appendChild(categories); + } + + this.inboxCard = this.createEl('div', 'inboxCard'); + this.inbox.appendChild(this.inboxCard); + this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg'); + this.emptyInboxMsg.innerText = 'All messages will be displayed here.'; + this.inboxCard.appendChild(this.emptyInboxMsg); // Intersection observer for notification viewed + + const options = { + root: this.inboxCard, + rootMargin: '0px', + threshold: 0.5 + }; + this.observer = new IntersectionObserver((entries, observer) => { + this.handleMessageViewed(entries); + }, options); + this.addMsgsToInboxFromLS(); + } - if (raiseViewedEvent) { - window.clevertap.renderNotificationViewed({ - msgId: e.target.campaignId, - pivotId: e.target.pivotId - }); + createCategories() { + const categoriesContainer = this.createEl('div', 'categoriesContainer'); + const leftArrow = this.createEl('div', 'leftArrow'); + leftArrow.innerHTML = arrowSvg; + leftArrow.children[0].style = 'transform: rotate(180deg)'; + leftArrow.addEventListener('click', () => { + this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0); + }); + categoriesContainer.appendChild(leftArrow); + const categoriesWrapper = this.createEl('div', 'categoriesWrapper'); + const _categories = ['All', ...this.config.categories]; - _this8.updateMessageInLS(e.target.id, _objectSpread2(_objectSpread2({}, e.target.message), {}, { - viewed: 1 - })); + _categories.forEach((c, i) => { + const category = this.createEl('div', "category-".concat(i), 'category'); + category.innerText = c; - setTimeout(function () { - e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'; - }, 1000); - } else { - console.log('Notifiction viewed event will be raised at run time with payload ::', { - msgId: e.target.campaignId, - pivotId: e.target.pivotId - }); - } + if (i === 0) { + this.selectedCategoryRef = category; + } - _this8.unviewedCounter--; + categoriesWrapper.appendChild(category); + }); - _this8.updateUnviewedBadgeCounter(); + categoriesContainer.appendChild(categoriesWrapper); + const rightArrow = this.createEl('div', 'rightArrow'); + rightArrow.innerHTML = arrowSvg; + rightArrow.addEventListener('click', () => { + this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0); + }); + categoriesContainer.appendChild(rightArrow); + const options = { + root: categoriesContainer, + threshold: 0.9 + }; + const firstCategory = categoriesWrapper.children[0]; + const lastCategory = categoriesWrapper.children[this.config.categories.length]; + const firstCategoryObserver = new IntersectionObserver(e => { + this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9); + }, options); + firstCategoryObserver.observe(firstCategory); + const lastCategoryObserver = new IntersectionObserver(e => { + this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9); + }, options); + lastCategoryObserver.observe(lastCategory); + return categoriesContainer; + } - delete _this8.unviewedMessages[e.target.id]; - } - }); - } + categoryObserverCb(el, hide) { + if (!el) { + return; } - }, { - key: "updateMessageInLS", - value: function updateMessageInLS(key, value) { - if (!this.isPreview) { - var messages = getInboxMessages(); - messages[key] = value; - saveInboxMessages(messages); - } - } // create a separte fn fro refactoring - - }, { - key: "toggleInbox", - value: function toggleInbox(e) { - this.isInboxOpen = !this.isInboxOpen; - this.isInboxFromFlutter = !!(e === null || e === void 0 ? void 0 : e.rect); - - if (this.isInboxOpen) { - this.inboxCard.scrollTop = 0; - !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs(); - this.inbox.style.display = 'block'; - this.inbox.style.zIndex = '2147483647'; // zIndex should be max for the inbox to be rendered on top of all elements - - if (this.config.categories.length) { - this.selectedCategoryRef.setAttribute('selected', 'false'); - this.selectedCategoryRef = this.shadowRoot.getElementById('category-0'); - this.updateActiveCategory(this.selectedCategoryRef.innerText); - this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth; + + el.style.display = hide ? 'none' : 'flex'; + } + + updateActiveCategory(activeCategory) { + this.selectedCategory = activeCategory; + this.inboxCard.scrollTop = 0; + let counter = 0; + this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false'); + this.selectedCategoryRef.setAttribute('selected', 'true'); + this.inboxCard.childNodes.forEach(c => { + if (c.getAttribute('id') !== 'emptyInboxMsg') { + c.style.display = this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory ? 'block' : 'none'; + + if (c.style.display === 'block') { + counter++; } + } + }); + + if (counter === 0) { + this.emptyInboxMsg.innerText = "".concat(activeCategory, " messages will be displayed here."); + this.emptyInboxMsg.style.display = 'block'; + } else { + this.emptyInboxMsg.style.display = 'none'; + } + } - this.setInboxPosition(e); + buildUIForMessages() { + var _this$config$maxMsgsI; + + let messages = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + !this.isPreview && this.updateTSForRenderedMsgs(); + this.inboxCard.scrollTop = 0; + const maxMsgsInInbox = (_this$config$maxMsgsI = this.config.maxMsgsInInbox) !== null && _this$config$maxMsgsI !== void 0 ? _this$config$maxMsgsI : MAX_INBOX_MSG; + const firstChild = this.inboxCard.firstChild; + const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map(m => m.id); + + for (const m of sortedMsgs) { + const item = new Message(this.config, messages[m]); + item.setAttribute('id', messages[m].id); + item.setAttribute('pivot', messages[m].wzrk_pivot); + item.setAttribute('part', 'ct-inbox-message'); + + if (this.config.categories.length > 0) { + item.setAttribute('category', messages[m].tags[0] || ''); + item.style.display = this.selectedCategory === 'All' || messages[m].category === this.selectedCategory ? 'block' : 'none'; } else { - this.inbox.style.display = 'none'; + item.style.display = 'block'; } + + this.inboxCard.insertBefore(item, firstChild); + this.observer.observe(item); } - }, { - key: "setInboxPosition", - value: function setInboxPosition(e) { - var windowWidth = window.outerWidth; - var customInboxStyles = getComputedStyle($ct.inbox); - var top = customInboxStyles.getPropertyValue('--inbox-top'); - var bottom = customInboxStyles.getPropertyValue('--inbox-bottom'); - var left = customInboxStyles.getPropertyValue('--inbox-left'); - var right = customInboxStyles.getPropertyValue('--inbox-right'); - var hasPositionDefined = top || bottom || left || right; - if (windowWidth > 481 && !hasPositionDefined) { - var res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth); - var xPos = res.xPos; - var yPos = res.yPos; - this.inbox.style.top = yPos + 'px'; - this.inbox.style.left = xPos + 'px'; + let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length; + + while (msgTotalCount > maxMsgsInInbox) { + const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message'); + + if (ctInboxMsgs.length > 0) { + ctInboxMsgs[ctInboxMsgs.length - 1].remove(); } + + msgTotalCount--; } - /** - * Updates the UI with the number of unviewed messages - * If there are more than 9 unviewed messages, we show the count as 9+ - */ - }, { - key: "updateUnviewedBadgeCounter", - value: function updateUnviewedBadgeCounter() { - if (this.isPreview) { - this.setBadgeStyle(this.unviewedCounter); - return; - } + const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*="display: block"]').length; + this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'; + } + /** + * Adds a click listener on the document. For every click we check + * 1. if the click has happenned within the inbox + * - on close button, we close the inbox + * - on any of the category, we set that as the activeCategory + * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-') + * 2. if the user has clicked on the inboxSelector, we toggle inbox + * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it + */ - var counter = 0; - this.inboxCard.querySelectorAll('ct-inbox-message').forEach(function (m) { - var messages = getInboxMessages(); - if (messages[m.id] && messages[m.id].viewed === 0) { - counter++; + /** + * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50% + * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event + */ + handleMessageViewed(entries) { + const raiseViewedEvent = !this.isPreview; + + if (this.isInboxOpen) { + entries.forEach(e => { + if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) { + e.target.message.viewed = 1; + + if (raiseViewedEvent) { + window.clevertap.renderNotificationViewed({ + msgId: e.target.campaignId, + pivotId: e.target.pivotId + }); + this.updateMessageInLS(e.target.id, { ...e.target.message, + viewed: 1 + }); + setTimeout(() => { + e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'; + }, 1000); + } else { + console.log('Notifiction viewed event will be raised at run time with payload ::', { + msgId: e.target.campaignId, + pivotId: e.target.pivotId + }); + } + + this.unviewedCounter--; + this.updateUnviewedBadgeCounter(); + delete this.unviewedMessages[e.target.id]; } }); - this.setBadgeStyle(counter); - } - }, { - key: "updateTSForRenderedMsgs", - value: function updateTSForRenderedMsgs() { - this.inboxCard.querySelectorAll('ct-inbox-message').forEach(function (m) { - var ts = m.id.split('_')[1]; - m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts); - }); } - }, { - key: "getInboxStyles", - value: function getInboxStyles() { - var headerHeight = 36; - var categoriesHeight = this.config.categories.length ? 64 : 16; - var styles = { - panelBackgroundColor: this.config.styles.panelBackgroundColor, - panelBorderColor: this.config.styles.panelBorderColor, - headerBackgroundColor: this.config.styles.header.backgroundColor, - headerTitleColor: this.config.styles.header.titleColor, - closeIconColor: this.config.styles.closeIconColor, - categoriesTabColor: this.config.styles.categories.tabColor, - categoriesTitleColor: this.config.styles.categories.titleColor, - selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor, - selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor, - headerCategoryHeight: headerHeight + categoriesHeight - }; + } - if (this.config.styles.categories.borderColor) { - styles.categoriesBorderColor = this.config.styles.categories.borderColor; - } + updateMessageInLS(key, value) { + if (!this.isPreview) { + const messages = getInboxMessages(); + messages[key] = value; + saveInboxMessages(messages); + } + } // create a separte fn fro refactoring - if (this.config.styles.categories.selectedTab.borderColor) { - styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor; + + toggleInbox(e) { + this.isInboxOpen = !this.isInboxOpen; + this.isInboxFromFlutter = !!(e === null || e === void 0 ? void 0 : e.rect); + + if (this.isInboxOpen) { + this.inboxCard.scrollTop = 0; + !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs(); + this.inbox.style.display = 'block'; + this.inbox.style.zIndex = '2147483647'; // zIndex should be max for the inbox to be rendered on top of all elements + + if (this.config.categories.length) { + this.selectedCategoryRef.setAttribute('selected', 'false'); + this.selectedCategoryRef = this.shadowRoot.getElementById('category-0'); + this.updateActiveCategory(this.selectedCategoryRef.innerText); + this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth; } - var inboxStyles = inboxContainerStyles(styles); - var cardStyles = this.config.styles.cards; - var msgStyles = messageStyles({ - backgroundColor: cardStyles.backgroundColor, - borderColor: cardStyles.borderColor, - titleColor: cardStyles.titleColor, - descriptionColor: cardStyles.descriptionColor, - buttonColor: cardStyles.buttonColor, - buttonTextColor: cardStyles.buttonTextColor, - unreadMarkerColor: cardStyles.unreadMarkerColor - }); - return inboxStyles + msgStyles; + this.setInboxPosition(e); + } else { + this.inbox.style.display = 'none'; } - }, { - key: "incomingMessages", - get: function get() { - return []; - }, - set: function set() { - var msgs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + } - if (msgs.length > 0 && this.inbox) { - this.updateInboxMessages(msgs); - } + setInboxPosition(e) { + const windowWidth = window.outerWidth; + const customInboxStyles = getComputedStyle($ct.inbox); + const top = customInboxStyles.getPropertyValue('--inbox-top'); + const bottom = customInboxStyles.getPropertyValue('--inbox-bottom'); + const left = customInboxStyles.getPropertyValue('--inbox-left'); + const right = customInboxStyles.getPropertyValue('--inbox-right'); + const hasPositionDefined = top || bottom || left || right; + + if (windowWidth > 481 && !hasPositionDefined) { + const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth); + const xPos = res.xPos; + const yPos = res.yPos; + this.inbox.style.top = yPos + 'px'; + this.inbox.style.left = xPos + 'px'; } - }, { - key: "incomingMessagesForPreview", - get: function get() { - return []; - }, - set: function set() { - var _this9 = this; - - var msgs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - var previewMsgs = {}; - - if (msgs.length > 0 && this.inbox) { - this.isPreview = true; - this.unviewedCounter = 0; - msgs.forEach(function (m) { - var key = "".concat(m.wzrk_id.split('_')[0], "_").concat(Date.now()); - m.id = key; - previewMsgs[key] = m; - _this9.unviewedMessages[key] = m; - _this9.unviewedCounter++; - }); - this.buildUIForMessages(previewMsgs); - this.updateUnviewedBadgeCounter(); + } + /** + * Updates the UI with the number of unviewed messages + * If there are more than 9 unviewed messages, we show the count as 9+ + */ + + + updateUnviewedBadgeCounter() { + if (this.isPreview) { + this.setBadgeStyle(this.unviewedCounter); + return; + } + + let counter = 0; + this.inboxCard.querySelectorAll('ct-inbox-message').forEach(m => { + const messages = getInboxMessages(); + + if (messages[m.id] && messages[m.id].viewed === 0) { + counter++; } + }); + this.setBadgeStyle(counter); + } + + updateTSForRenderedMsgs() { + this.inboxCard.querySelectorAll('ct-inbox-message').forEach(m => { + const ts = m.id.split('_')[1]; + m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts); + }); + } + + getInboxStyles() { + const headerHeight = 36; + const categoriesHeight = this.config.categories.length ? 64 : 16; + const styles = { + panelBackgroundColor: this.config.styles.panelBackgroundColor, + panelBorderColor: this.config.styles.panelBorderColor, + headerBackgroundColor: this.config.styles.header.backgroundColor, + headerTitleColor: this.config.styles.header.titleColor, + closeIconColor: this.config.styles.closeIconColor, + categoriesTabColor: this.config.styles.categories.tabColor, + categoriesTitleColor: this.config.styles.categories.titleColor, + selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor, + selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor, + headerCategoryHeight: headerHeight + categoriesHeight + }; + + if (this.config.styles.categories.borderColor) { + styles.categoriesBorderColor = this.config.styles.categories.borderColor; + } + + if (this.config.styles.categories.selectedTab.borderColor) { + styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor; } - }]); - return Inbox; - }( /*#__PURE__*/_wrapNativeSuper(HTMLElement)); + const inboxStyles = inboxContainerStyles(styles); + const cardStyles = this.config.styles.cards; + const msgStyles = messageStyles({ + backgroundColor: cardStyles.backgroundColor, + borderColor: cardStyles.borderColor, + titleColor: cardStyles.titleColor, + descriptionColor: cardStyles.descriptionColor, + buttonColor: cardStyles.buttonColor, + buttonTextColor: cardStyles.buttonTextColor, + unreadMarkerColor: cardStyles.unreadMarkerColor + }); + return inboxStyles + msgStyles; + } + + } - var processWebInboxSettings = function processWebInboxSettings(webInboxSetting) { - var isPreview = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + const processWebInboxSettings = function (webInboxSetting) { + let isPreview = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - var _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}; + const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}; if (isPreview) { $ct.inbox.inboxConfigForPreview = webInboxSetting; @@ -4846,26 +4254,26 @@ $ct.inbox && $ct.inbox.init(); } }; - var processInboxNotifs = function processInboxNotifs(msg) { + const processInboxNotifs = msg => { if (msg.inbox_preview) { $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs; } else { $ct.inbox.incomingMessages = msg; } }; - var addWebInbox = function addWebInbox(logger) { + const addWebInbox = logger => { checkAndRegisterWebInboxElements(); $ct.inbox = new Inbox({ - logger: logger + logger }); document.body.appendChild($ct.inbox); }; - var getAndMigrateInboxMessages = function getAndMigrateInboxMessages(guid) { - var messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}; // Doing this to migrate message to guid level + const getAndMigrateInboxMessages = guid => { + const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}; // Doing this to migrate message to guid level if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) { - var gudInboxObj = {}; + const gudInboxObj = {}; gudInboxObj[guid] = messages; StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj); return gudInboxObj; @@ -4874,38 +4282,38 @@ return messages; }; - var getInboxMessages = function getInboxMessages() { - var guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME))); + const getInboxMessages = () => { + const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME))); if (!isValueValid(guid)) { return {}; } - var messages = getAndMigrateInboxMessages(guid); + const messages = getAndMigrateInboxMessages(guid); return messages.hasOwnProperty(guid) ? messages[guid] : {}; }; - var saveInboxMessages = function saveInboxMessages(messages) { - var guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME))); + const saveInboxMessages = messages => { + const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME))); if (!isValueValid(guid)) { return; } - var storedInboxObj = getAndMigrateInboxMessages(guid); - - var newObj = _objectSpread2(_objectSpread2({}, storedInboxObj), {}, _defineProperty({}, guid, messages)); - + const storedInboxObj = getAndMigrateInboxMessages(guid); + const newObj = { ...storedInboxObj, + [guid]: messages + }; StorageManager.saveToLSorCookie(WEBINBOX, newObj); }; - var initializeWebInbox = function initializeWebInbox(logger) { - return new Promise(function (resolve, reject) { + const initializeWebInbox = logger => { + return new Promise((resolve, reject) => { if (document.readyState === 'complete') { addWebInbox(logger); resolve(); } else { - var config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}; + const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}; - var onLoaded = function onLoaded() { + const onLoaded = () => { /** * We need this null check here because $ct.inbox could be initialised via init method too on document load. * In that case we don't need to call addWebInbox method @@ -4917,7 +4325,7 @@ resolve(); }; - window.addEventListener('load', function () { + window.addEventListener('load', () => { /** * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet * We will to check element for 10 seconds and give up @@ -4926,10 +4334,10 @@ onLoaded(); } else { // check for element for next 10 seconds - var count = 0; + let count = 0; if (count < 20) { - var t = setInterval(function () { + const t = setInterval(() => { if (document.getElementById(config.inboxSelector)) { onLoaded(); clearInterval(t); @@ -4947,36 +4355,36 @@ } }); }; - var checkAndRegisterWebInboxElements = function checkAndRegisterWebInboxElements() { + const checkAndRegisterWebInboxElements = () => { if (customElements.get('ct-web-inbox') === undefined) { customElements.define('ct-web-inbox', Inbox); customElements.define('ct-inbox-message', Message); } }; - var getInboxPosition = function getInboxPosition(e, inboxHeight, inboxWidth) { - var horizontalScroll = document.scrollingElement.scrollLeft; - var verticalScroll = document.scrollingElement.scrollTop; - var windowWidth = window.innerWidth + horizontalScroll; - var windowHeight = window.innerHeight + verticalScroll; - var selectorRect = e.rect || e.target.getBoundingClientRect(); - var selectorX = selectorRect.x + horizontalScroll; - var selectorY = selectorRect.y + verticalScroll; - var selectorLeft = selectorRect.left + horizontalScroll; - var selectorRight = selectorRect.right + horizontalScroll; - var selectorTop = selectorRect.top + verticalScroll; // const selectorBottom = selectorRect.bottom + verticalScroll - - var selectorBottom = selectorRect.bottom; - var selectorHeight = selectorRect.height; - var selectorWidth = selectorRect.width; - var selectorCenter = { + const getInboxPosition = (e, inboxHeight, inboxWidth) => { + const horizontalScroll = document.scrollingElement.scrollLeft; + const verticalScroll = document.scrollingElement.scrollTop; + const windowWidth = window.innerWidth + horizontalScroll; + const windowHeight = window.innerHeight + verticalScroll; + const selectorRect = e.rect || e.target.getBoundingClientRect(); + const selectorX = selectorRect.x + horizontalScroll; + const selectorY = selectorRect.y + verticalScroll; + const selectorLeft = selectorRect.left + horizontalScroll; + const selectorRight = selectorRect.right + horizontalScroll; + const selectorTop = selectorRect.top + verticalScroll; // const selectorBottom = selectorRect.bottom + verticalScroll + + const selectorBottom = selectorRect.bottom; + const selectorHeight = selectorRect.height; + const selectorWidth = selectorRect.width; + const selectorCenter = { x: selectorX + selectorWidth / 2, y: selectorY + selectorHeight / 2 }; - var halfOfInboxHeight = inboxHeight / 2; - var halfOfInboxWidth = inboxWidth / 2; - var inboxOnSide = false; - var xPos, yPos; - var padding = 16; + const halfOfInboxHeight = inboxHeight / 2; + const halfOfInboxWidth = inboxWidth / 2; + let inboxOnSide = false; + let xPos, yPos; + const padding = 16; /** * y co-ordinates: * Try to push the card downwards @@ -4999,13 +4407,12 @@ if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down - var availableHeight = windowHeight - (selectorBottom + inboxHeight); + const availableHeight = windowHeight - (selectorBottom + inboxHeight); yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight; } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up - var _availableHeight = selectorTop - inboxHeight; - - yPos = _availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - _availableHeight; + const availableHeight = selectorTop - inboxHeight; + yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight; } else { inboxOnSide = true; yPos = selectorCenter.y - halfOfInboxHeight; // with this the y co-ordinate of the selector center and the inbox card center become the same @@ -5019,17 +4426,15 @@ if (inboxOnSide) { // See if we can place the card to the right of the selector - var inboxRight = selectorRight + inboxWidth; + const inboxRight = selectorRight + inboxWidth; if (inboxRight <= windowWidth) { - var availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight; + const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight; xPos = selectorRight + availableWidth; } else { - var inboxLeft = selectorLeft - inboxWidth; - - var _availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll; - - xPos = inboxLeft - _availableWidth; + const inboxLeft = selectorLeft - inboxWidth; + const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll; + xPos = inboxLeft - availableWidth; } } else { xPos = selectorCenter.x - halfOfInboxWidth; @@ -5050,13 +4455,13 @@ } return { - xPos: xPos, - yPos: yPos + xPos, + yPos }; }; - var determineTimeStampText = function determineTimeStampText(ts) { - var now = Date.now(); - var diff = Math.floor((now - ts) / 60000); + const determineTimeStampText = ts => { + const now = Date.now(); + let diff = Math.floor((now - ts) / 60000); if (diff < 5) { return 'Just now'; @@ -5066,39 +4471,234 @@ return "".concat(diff, " minute").concat(diff > 1 ? 's' : '', " ago"); } - diff = Math.floor(diff / 60); + diff = Math.floor(diff / 60); + + if (diff < 24) { + return "".concat(diff, " hour").concat(diff > 1 ? 's' : '', " ago"); + } + + diff = Math.floor(diff / 24); + return "".concat(diff, " day").concat(diff > 1 ? 's' : '', " ago"); + }; + const hasWebInboxSettingsInLS = () => { + return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0; + }; + const arrowSvg = "\n\n\n"; + const greenTickSvg = "\n\n\n"; + + const initialiseCTBuilder = () => { + // const overlayPath = 'https://kkyusuftk-clevertap.s3.amazonaws.com/sampleIndex.js' + // addOverlayScript(overlayPath).onload = async function () { + // try { + // const module = await import(overlayPath) + // const { default: isEven } = module + // console.log(isEven(4)) + // console.log(isEven(5)) + // } catch (error) { + // console.error('Error fetching data:', error) + // } + // } + document.addEventListener('DOMContentLoaded', onContentLoad); + }; + let container; + + function onContentLoad() { + document.body.innerHTML = ''; + container = document.createElement('div'); + container.id = 'app2'; + container.style.position = 'relative'; // Ensure relative positioning for absolute positioning of form + + container.style.display = 'flex'; + document.body.appendChild(container); + const overlayPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js'; + loadOverlayScript(overlayPath).then(() => { + console.log('Overlay script loaded successfully.'); + }).catch(error => { + console.error('Error loading overlay script:', error); + }); + loadCSS(); + loadTypeKit(); + } + + function loadCSS() { + var link = document.createElement('link'); + link.rel = 'stylesheet'; + link.type = 'text/css'; + link.href = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css'; + document.head.appendChild(link); + } + + function loadOverlayScript(overlayPath) { + return new Promise((resolve, reject) => { + var script = document.createElement('script'); + script.type = 'module'; + script.src = overlayPath; + + script.onload = function () { + if (typeof window.Overlay === 'function') { + window.Overlay('#app2', 'http://localhost:8080/randomPage'); + resolve(); + } else { + reject(new Error('ContentLayout not found in overlay.js')); + } + }; + + script.onerror = function (error) { + reject(error); + }; + + document.head.appendChild(script); + }); + } + + function loadTypeKit() { + var config = { + kitId: 'eqj6nom', + scriptTimeout: 3000, + async: true + }; + var d = document; + var h = d.documentElement; + var t = setTimeout(function () { + h.className = h.className.replace(/\bwf-loading\b/g, '') + ' wf-inactive'; // $(document).trigger("TypeKitReady"); + }, config.scriptTimeout); + var tk = d.createElement('script'); + var f = false; + var s = d.getElementsByTagName('script')[0]; + var a; + h.className += ' wf-loading'; + tk.src = 'https://use.typekit.net/' + config.kitId + '.js'; + tk.async = true; + + tk.onload = tk.onreadystatechange = function () { + a = this.readyState; + if (f || a && a !== 'complete' && a !== 'loaded') return; + f = true; + clearTimeout(t); + + try { + // eslint-disable-next-line no-undef + Typekit.load(config); + } catch (e) {} + }; + + s.parentNode.insertBefore(tk, s); + } + + const renderVisualBuilder = (targetingMsgJson, isPreview) => { + const details = targetingMsgJson.display.details[0]; + const siteUrl = Object.keys(details)[0]; + const selectors = details[siteUrl]; + + if (siteUrl === window.location.href) { + for (const selector in selectors) { + const element = document.querySelector(selector); + + if (element) { + element.outerHTML = selectors[selector].html; + + if (!isPreview) { + window.clevertap.renderNotificationViewed({ + msgId: targetingMsgJson.wzrk_id, + pivotId: targetingMsgJson.wzrk_pivot + }); + } + } else { + let count = 0; + const intervalId = setInterval(() => { + const retryElement = document.querySelector(selector); + + if (retryElement) { + retryElement.outerHTML = selectors[selector].html; + + if (!isPreview) { + window.clevertap.renderNotificationViewed({ + msgId: targetingMsgJson.wzrk_id, + pivotId: targetingMsgJson.wzrk_pivot + }); + } + + clearInterval(intervalId); + } else { + count++; - if (diff < 24) { - return "".concat(diff, " hour").concat(diff > 1 ? 's' : '', " ago"); + if (count >= 20) { + console.log("No element present on DOM with selector '".concat(selector, "'.")); + clearInterval(intervalId); + } + } + }, 500); + } + } } + }; // function addOverlayScript (overlayPath) { + // const scriptTag = document.createElement('script') + // scriptTag.setAttribute('type', 'text/javascript') + // scriptTag.setAttribute('id', 'wzrk-alert-js') + // scriptTag.setAttribute('src', overlayPath) + // document.getElementsByTagName('body')[0].appendChild(scriptTag) + // return scriptTag + // } + + const _tr = (msg, _ref) => { + let { + device, + session, + request, + logger + } = _ref; + const _device = device; + const _session = session; + const _request = request; + const _logger = logger; + let _wizCounter = 0; + msg = { + arp: { + j_n: 'Zw==', + i_n: 'Y2NmewICAw==', + d_ts: 0, + dh: 0, + v: 1, + j_s: '{ }', + id: 'WWW-WWW-WWRZ', + e_ts: 0, + r_ts: 1649748826, + rc_w: 60, + rc_n: 5 + }, + inapp_notifs: [{ + msgContent: { + templateType: 'point-and-click', + type: 4 + }, + display: { + divId: 'hero-banner', + details: [{ + 'http://localhost:3000/': { + '.heroDi1v': { + html: 'Hello Sonam' + }, + '#selector_2': { + html: '

Hello Sonam

' + } + } + }], + wtarget_type: 2, + wmc: 1, + ff: 'Desktop' + }, + wzrk_id: '1655316906_20220620', + wzrk_pivot: 'wzrk_default' + }] + }; // Campaign House keeping - diff = Math.floor(diff / 24); - return "".concat(diff, " day").concat(diff > 1 ? 's' : '', " ago"); - }; - var hasWebInboxSettingsInLS = function hasWebInboxSettingsInLS() { - return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0; - }; - var arrowSvg = "\n\n\n"; - var greenTickSvg = "\n\n\n"; - - var _tr = function _tr(msg, _ref) { - var device = _ref.device, - session = _ref.session, - request = _ref.request, - logger = _ref.logger; - var _device = device; - var _session = session; - var _request = request; - var _logger = logger; - var _wizCounter = 0; // Campaign House keeping - - var doCampHouseKeeping = function doCampHouseKeeping(targetingMsgJson) { - var campaignId = targetingMsgJson.wzrk_id.split('_')[0]; - var today = getToday(); - - var incrCount = function incrCount(obj, campaignId, excludeFromFreqCaps) { - var currentCount = 0; - var totalCount = 0; + const doCampHouseKeeping = targetingMsgJson => { + const campaignId = targetingMsgJson.wzrk_id.split('_')[0]; + const today = getToday(); + + const incrCount = (obj, campaignId, excludeFromFreqCaps) => { + let currentCount = 0; + let totalCount = 0; if (obj[campaignId] != null) { currentCount = obj[campaignId]; @@ -5122,7 +4722,7 @@ if (StorageManager._isLocalStorageSupported()) { delete sessionStorage[CAMP_COOKIE_NAME]; var campTypeObj = {}; - var campObj = getCampaignObject(); + const campObj = getCampaignObject(); if (targetingMsgJson.display.wtarget_type === 3 && campObj.hasOwnProperty('wi')) { campTypeObj = campObj.wi; @@ -5148,16 +4748,16 @@ var excludeFromFreqCaps = -1; // efc - Exclude from frequency caps - var campaignSessionLimit = -1; // mdc - Once per session + let campaignSessionLimit = -1; // mdc - Once per session - var campaignDailyLimit = -1; // tdc - Once per day + let campaignDailyLimit = -1; // tdc - Once per day - var campaignTotalLimit = -1; // tlc - Once per user for the duration of campaign + let campaignTotalLimit = -1; // tlc - Once per user for the duration of campaign - var totalDailyLimit = -1; - var totalSessionLimit = -1; // wmc - Web Popup Global Session Limit + let totalDailyLimit = -1; + let totalSessionLimit = -1; // wmc - Web Popup Global Session Limit - var totalInboxSessionLimit = -1; // wimc - Web Inbox Global Session Limit + let totalInboxSessionLimit = -1; // wimc - Web Inbox Global Session Limit if (targetingMsgJson[DISPLAY].efc != null) { // exclude from frequency cap @@ -5198,8 +4798,8 @@ var sessionObj = campTypeObj[_session.sessionId]; if (sessionObj) { - var campaignSessionCount = sessionObj[campaignId]; - var totalSessionCount = sessionObj.tc; // dnd + const campaignSessionCount = sessionObj[campaignId]; + const totalSessionCount = sessionObj.tc; // dnd if (campaignSessionCount === 'dnd' && !$ct.dismissSpamControl) { return false; @@ -5230,8 +4830,8 @@ var dailyObj = campTypeObj[today]; if (dailyObj != null) { - var campaignDailyCount = dailyObj[campaignId]; - var totalDailyCount = dailyObj.tc; // daily + const campaignDailyCount = dailyObj[campaignId]; + const totalDailyCount = dailyObj.tc; // daily if (totalDailyLimit > 0 && totalDailyCount >= totalDailyLimit && excludeFromFreqCaps < 0) { return false; @@ -5249,7 +4849,7 @@ var globalObj = campTypeObj[GLOBAL]; if (globalObj != null) { - var campaignTotalCount = globalObj[campaignId]; // campaign total + const campaignTotalCount = globalObj[campaignId]; // campaign total if (campaignTotalLimit > 0 && campaignTotalCount >= campaignTotalLimit) { return false; @@ -5262,7 +4862,7 @@ if (targetingMsgJson[DISPLAY].delay != null && targetingMsgJson[DISPLAY].delay > 0) { - var delay = targetingMsgJson[DISPLAY].delay; + const delay = targetingMsgJson[DISPLAY].delay; targetingMsgJson[DISPLAY].delay = 0; setTimeout(_tr, delay * 1000, msg, { device: _device, @@ -5276,32 +4876,34 @@ incrCount(sessionObj, campaignId, excludeFromFreqCaps); incrCount(dailyObj, campaignId, excludeFromFreqCaps); incrCount(globalObj, campaignId, excludeFromFreqCaps); - var campKey = 'wp'; + let campKey = 'wp'; if (targetingMsgJson[DISPLAY].wtarget_type === 3) { campKey = 'wi'; } // get ride of stale sessions and day entries - var newCampObj = {}; + const newCampObj = {}; newCampObj[_session.sessionId] = sessionObj; newCampObj[today] = dailyObj; newCampObj[GLOBAL] = globalObj; - saveCampaignObject(_defineProperty({}, campKey, newCampObj)); + saveCampaignObject({ + [campKey]: newCampObj + }); }; - var getCookieParams = function getCookieParams() { - var gcookie = _device.getGuid(); + const getCookieParams = () => { + const gcookie = _device.getGuid(); - var scookieObj = _session.getSessionCookieObject(); + const scookieObj = _session.getSessionCookieObject(); return '&t=wc&d=' + encodeURIComponent(compressToBase64(gcookie + '|' + scookieObj.p + '|' + scookieObj.s)); }; - var setupClickEvent = function setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy) { + const setupClickEvent = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => { if (onClick !== '' && onClick != null) { - var ctaElement; - var jsCTAElements; + let ctaElement; + let jsCTAElements; if (isLegacy) { ctaElement = contentDiv; @@ -5313,15 +4915,15 @@ } } - var jsFunc = targetingMsgJson.display.jsFunc; - var isPreview = targetingMsgJson.display.preview; + const jsFunc = targetingMsgJson.display.jsFunc; + const isPreview = targetingMsgJson.display.preview; if (isPreview == null) { onClick += getCookieParams(); } if (ctaElement != null) { - ctaElement.onclick = function () { + ctaElement.onclick = () => { // invoke js function call if (jsFunc != null) { // track notification clicked event @@ -5346,8 +4948,8 @@ } }; - var invokeExternalJs = function invokeExternalJs(jsFunc, targetingMsgJson) { - var func = window.parent[jsFunc]; + const invokeExternalJs = (jsFunc, targetingMsgJson) => { + const func = window.parent[jsFunc]; if (typeof func === 'function') { if (targetingMsgJson.display.kv != null) { @@ -5358,79 +4960,81 @@ } }; - var setupClickUrl = function setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, isLegacy) { + const setupClickUrl = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => { incrementImpression(targetingMsgJson); setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy); }; - var incrementImpression = function incrementImpression(targetingMsgJson) { - var data = {}; + const incrementImpression = targetingMsgJson => { + const data = {}; data.type = 'event'; data.evtName = NOTIFICATION_VIEWED; - data.evtData = _defineProperty({}, WZRK_ID, targetingMsgJson.wzrk_id); + data.evtData = { + [WZRK_ID]: targetingMsgJson.wzrk_id + }; if (targetingMsgJson.wzrk_pivot) { - data.evtData = _objectSpread2(_objectSpread2({}, data.evtData), {}, { + data.evtData = { ...data.evtData, wzrk_pivot: targetingMsgJson.wzrk_pivot - }); + }; } _request.processEvent(data); }; - var renderPersonalisationBanner = function renderPersonalisationBanner(targetingMsgJson) { + const renderPersonalisationBanner = targetingMsgJson => { var _targetingMsgJson$dis; if (customElements.get('ct-web-personalisation-banner') === undefined) { customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner); } - var divId = (_targetingMsgJson$dis = targetingMsgJson.display.divId) !== null && _targetingMsgJson$dis !== void 0 ? _targetingMsgJson$dis : targetingMsgJson.display.divSelector; - var bannerEl = document.createElement('ct-web-personalisation-banner'); + const divId = (_targetingMsgJson$dis = targetingMsgJson.display.divId) !== null && _targetingMsgJson$dis !== void 0 ? _targetingMsgJson$dis : targetingMsgJson.display.divSelector; + const bannerEl = document.createElement('ct-web-personalisation-banner'); bannerEl.msgId = targetingMsgJson.wzrk_id; bannerEl.pivotId = targetingMsgJson.wzrk_pivot; bannerEl.divHeight = targetingMsgJson.display.divHeight; bannerEl.details = targetingMsgJson.display.details[0]; - var containerEl = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId); + const containerEl = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId); containerEl.innerHTML = ''; containerEl.appendChild(bannerEl); }; - var renderPersonalisationCarousel = function renderPersonalisationCarousel(targetingMsgJson) { + const renderPersonalisationCarousel = targetingMsgJson => { var _targetingMsgJson$dis2; if (customElements.get('ct-web-personalisation-carousel') === undefined) { customElements.define('ct-web-personalisation-carousel', CTWebPersonalisationCarousel); } - var divId = (_targetingMsgJson$dis2 = targetingMsgJson.display.divId) !== null && _targetingMsgJson$dis2 !== void 0 ? _targetingMsgJson$dis2 : targetingMsgJson.display.divSelector; - var carousel = document.createElement('ct-web-personalisation-carousel'); + const divId = (_targetingMsgJson$dis2 = targetingMsgJson.display.divId) !== null && _targetingMsgJson$dis2 !== void 0 ? _targetingMsgJson$dis2 : targetingMsgJson.display.divSelector; + const carousel = document.createElement('ct-web-personalisation-carousel'); carousel.target = targetingMsgJson; - var container = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId); + const container = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId); container.innerHTML = ''; container.appendChild(carousel); }; - var renderPopUpImageOnly = function renderPopUpImageOnly(targetingMsgJson) { - var divId = 'wzrkImageOnlyDiv'; - var popupImageOnly = document.createElement('ct-web-popup-imageonly'); + const renderPopUpImageOnly = targetingMsgJson => { + const divId = 'wzrkImageOnlyDiv'; + const popupImageOnly = document.createElement('ct-web-popup-imageonly'); popupImageOnly.session = _session; popupImageOnly.target = targetingMsgJson; - var containerEl = document.getElementById(divId); + const containerEl = document.getElementById(divId); containerEl.innerHTML = ''; containerEl.style.visibility = 'hidden'; containerEl.appendChild(popupImageOnly); }; - var renderFooterNotification = function renderFooterNotification(targetingMsgJson) { - var campaignId = targetingMsgJson.wzrk_id.split('_')[0]; - var displayObj = targetingMsgJson.display; + const renderFooterNotification = targetingMsgJson => { + const campaignId = targetingMsgJson.wzrk_id.split('_')[0]; + const displayObj = targetingMsgJson.display; if (displayObj.wtarget_type === 2) { // Handling Web Native display // Logic for kv pair data if (targetingMsgJson.msgContent.type === 1) { - var inaObj = {}; + const inaObj = {}; inaObj.msgId = targetingMsgJson.wzrk_id; if (targetingMsgJson.wzrk_pivot) { @@ -5441,7 +5045,7 @@ inaObj.kv = targetingMsgJson.msgContent.kv; } - var kvPairsEvent = new CustomEvent('CT_web_native_display', { + const kvPairsEvent = new CustomEvent('CT_web_native_display', { detail: inaObj }); document.dispatchEvent(kvPairsEvent); @@ -5456,26 +5060,25 @@ if (displayObj.layout === 3) { // Handling Web Popup Image Only - var _divId = 'wzrkImageOnlyDiv'; + const divId = 'wzrkImageOnlyDiv'; if (doCampHouseKeeping(targetingMsgJson) === false) { return; } - if ($ct.dismissSpamControl && document.getElementById(_divId) != null) { - var element = document.getElementById(_divId); + if ($ct.dismissSpamControl && document.getElementById(divId) != null) { + const element = document.getElementById(divId); element.remove(); } // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist - if (document.getElementById(_divId) != null || document.getElementById('intentPreview') != null) { + if (document.getElementById(divId) != null || document.getElementById('intentPreview') != null) { return; } - var _msgDiv = document.createElement('div'); - - _msgDiv.id = _divId; - document.body.appendChild(_msgDiv); + const msgDiv = document.createElement('div'); + msgDiv.id = divId; + document.body.appendChild(msgDiv); if (customElements.get('ct-web-popup-imageonly') === undefined) { customElements.define('ct-web-popup-imageonly', CTWebPopupImageOnly); @@ -5488,12 +5091,11 @@ return; } - var divId = 'wizParDiv' + displayObj.layout; + const divId = 'wizParDiv' + displayObj.layout; if ($ct.dismissSpamControl && document.getElementById(divId) != null) { - var _element = document.getElementById(divId); - - _element.remove(); + const element = document.getElementById(divId); + element.remove(); } if (document.getElementById(divId) != null) { @@ -5501,20 +5103,20 @@ } $ct.campaignDivMap[campaignId] = divId; - var isBanner = displayObj.layout === 2; - var msgDiv = document.createElement('div'); + const isBanner = displayObj.layout === 2; + const msgDiv = document.createElement('div'); msgDiv.id = divId; - var viewHeight = window.innerHeight; - var viewWidth = window.innerWidth; - var legacy = false; + const viewHeight = window.innerHeight; + const viewWidth = window.innerWidth; + let legacy = false; if (!isBanner) { - var marginBottom = viewHeight * 5 / 100; + const marginBottom = viewHeight * 5 / 100; var contentHeight = 10; - var right = viewWidth * 5 / 100; - var bottomPosition = contentHeight + marginBottom; - var width = viewWidth * 30 / 100 + 20; - var widthPerct = 'width:30%;'; // for small devices - mobile phones + let right = viewWidth * 5 / 100; + let bottomPosition = contentHeight + marginBottom; + let width = viewWidth * 30 / 100 + 20; + let widthPerct = 'width:30%;'; // for small devices - mobile phones if ((/mobile/i.test(navigator.userAgent) || /mini/i.test(navigator.userAgent)) && /iPad/i.test(navigator.userAgent) === false) { width = viewWidth * 85 / 100 + 20; @@ -5540,29 +5142,29 @@ } document.body.appendChild(msgDiv); - var iframe = document.createElement('iframe'); - var borderRadius = displayObj.br === false ? '0' : '8'; + const iframe = document.createElement('iframe'); + const borderRadius = displayObj.br === false ? '0' : '8'; iframe.frameborder = '0px'; iframe.marginheight = '0px'; iframe.marginwidth = '0px'; iframe.scrolling = 'no'; iframe.id = 'wiz-iframe'; - var onClick = targetingMsgJson.display.onClick; - var pointerCss = ''; + const onClick = targetingMsgJson.display.onClick; + let pointerCss = ''; if (onClick !== '' && onClick != null) { pointerCss = 'cursor:pointer;'; } - var html; // direct html + let html; // direct html if (targetingMsgJson.msgContent.type === 1) { html = targetingMsgJson.msgContent.html; html = html.replace(/##campaignId##/g, campaignId); html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id); } else { - var css = '' + ''; - var bgColor, textColor, btnBg, leftTd, btColor; + const css = '' + ''; + let bgColor, textColor, btnBg, leftTd, btColor; if (targetingMsgJson.display.theme === 'dark') { bgColor = '#2d2d2e'; @@ -5578,27 +5180,27 @@ btColor = '#ffffff'; } - var titleText = targetingMsgJson.msgContent.title; - var descriptionText = targetingMsgJson.msgContent.description; - var imageTd = ''; + const titleText = targetingMsgJson.msgContent.title; + const descriptionText = targetingMsgJson.msgContent.description; + let imageTd = ''; if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') { imageTd = ""; } - var onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + ",'" + divId + "');"; - var title = "
" + "×" + "
" + "" + // ""+ + const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + ",'" + divId + "');"; + const title = "
" + "×" + "
" + "
" + // ""+ '' + imageTd + "
" + "
" + titleText + '
'; - var body = "
" + descriptionText + '
'; + const body = "
" + descriptionText + '
'; html = css + title + body; } iframe.setAttribute('style', 'z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;'); msgDiv.appendChild(iframe); - var ifrm = iframe.contentWindow ? iframe.contentWindow : iframe.contentDocument.document ? iframe.contentDocument.document : iframe.contentDocument; - var doc = ifrm.document; // Dispatch event for popup box/banner close + const ifrm = iframe.contentWindow ? iframe.contentWindow : iframe.contentDocument.document ? iframe.contentDocument.document : iframe.contentDocument; + const doc = ifrm.document; // Dispatch event for popup box/banner close - var closeCampaign = new Event('CT_campaign_rendered'); + const closeCampaign = new Event('CT_campaign_rendered'); document.dispatchEvent(closeCampaign); doc.open(); doc.write(html); @@ -5609,7 +5211,7 @@ doc.close(); - var adjustIFrameHeight = function adjustIFrameHeight() { + const adjustIFrameHeight = () => { // adjust iframe and body height of html inside correctly contentHeight = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv').scrollHeight; @@ -5621,57 +5223,57 @@ document.getElementById('wiz-iframe').style.height = contentHeight + 'px'; }; - var ua = navigator.userAgent.toLowerCase(); + const ua = navigator.userAgent.toLowerCase(); if (ua.indexOf('safari') !== -1) { if (ua.indexOf('chrome') > -1) { - iframe.onload = function () { + iframe.onload = () => { adjustIFrameHeight(); - var contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv'); + const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv'); setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy); }; } else { - var inDoc = iframe.contentDocument || iframe.contentWindow; + let inDoc = iframe.contentDocument || iframe.contentWindow; if (inDoc.document) inDoc = inDoc.document; // safari iphone 7+ needs this. adjustIFrameHeight(); - var _timer = setInterval(function () { + const _timer = setInterval(() => { if (inDoc.readyState === 'complete') { clearInterval(_timer); // adjust iframe and body height of html inside correctly adjustIFrameHeight(); - var contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv'); + const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv'); setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy); } }, 10); } } else { - iframe.onload = function () { + iframe.onload = () => { // adjust iframe and body height of html inside correctly adjustIFrameHeight(); - var contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv'); + const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv'); setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy); }; } }; - var appendScriptForCustomEvent = function appendScriptForCustomEvent(targetingMsgJson, doc) { - var script = doc.createElement('script'); + const appendScriptForCustomEvent = (targetingMsgJson, doc) => { + const script = doc.createElement('script'); script.innerHTML = "\n const ct__camapignId = '".concat(targetingMsgJson.wzrk_id, "';\n const ct__formatVal = (v) => {\n return v && v.trim().substring(0, 20);\n }\n const ct__parentOrigin = window.parent.origin;\n document.body.addEventListener('click', (event) => {\n const elem = event.target.closest?.('a[wzrk_c2a], button[wzrk_c2a]');\n if (elem) {\n const {innerText, id, name, value, href} = elem;\n const clickAttr = elem.getAttribute('onclick') || elem.getAttribute('click');\n const onclickURL = clickAttr?.match(/(window.open)[(](\"|')(.*)(\"|',)/)?.[3] || clickAttr?.match(/(location.href *= *)(\"|')(.*)(\"|')/)?.[3];\n const props = {innerText, id, name, value};\n let msgCTkv = Object.keys(props).reduce((acc, c) => {\n const formattedVal = ct__formatVal(props[c]);\n formattedVal && (acc['wzrk_click_' + c] = formattedVal);\n return acc;\n }, {});\n if(onclickURL) { msgCTkv['wzrk_click_' + 'url'] = onclickURL; }\n if(href) { msgCTkv['wzrk_click_' + 'c2a'] = href; }\n const notifData = { msgId: ct__camapignId, msgCTkv, pivotId: '").concat(targetingMsgJson.wzrk_pivot, "' };\n window.parent.clevertap.renderNotificationClicked(notifData);\n }\n });\n "); doc.body.appendChild(script); }; - var _callBackCalled = false; + let _callBackCalled = false; - var showFooterNotification = function showFooterNotification(targetingMsgJson) { - var onClick = targetingMsgJson.display.onClick; // TODO: Needs wizrocket as a global variable + const showFooterNotification = targetingMsgJson => { + let onClick = targetingMsgJson.display.onClick; // TODO: Needs wizrocket as a global variable if (window.clevertap.hasOwnProperty('notificationCallback') && typeof window.clevertap.notificationCallback !== 'undefined' && typeof window.clevertap.notificationCallback === 'function') { - var notificationCallback = window.clevertap.notificationCallback; + const notificationCallback = window.clevertap.notificationCallback; if (!_callBackCalled) { - var inaObj = {}; + const inaObj = {}; inaObj.msgContent = targetingMsgJson.msgContent; inaObj.msgId = targetingMsgJson.wzrk_id; @@ -5683,9 +5285,9 @@ inaObj.kv = targetingMsgJson.display.kv; } - window.clevertap.raiseNotificationClicked = function () { + window.clevertap.raiseNotificationClicked = () => { if (onClick !== '' && onClick != null) { - var jsFunc = targetingMsgJson.display.jsFunc; + const jsFunc = targetingMsgJson.display.jsFunc; onClick += getCookieParams(); // invoke js function call if (jsFunc != null) { @@ -5704,7 +5306,7 @@ } }; - window.clevertap.raiseNotificationViewed = function () { + window.clevertap.raiseNotificationViewed = () => { incrementImpression(targetingMsgJson); }; @@ -5716,13 +5318,13 @@ renderFooterNotification(targetingMsgJson); if (window.clevertap.hasOwnProperty('popupCallbacks') && typeof window.clevertap.popupCallbacks !== 'undefined' && typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') { - var popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]; - var _inaObj = {}; - _inaObj.msgContent = targetingMsgJson.msgContent; - _inaObj.msgId = targetingMsgJson.wzrk_id; + const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]; + const inaObj = {}; + inaObj.msgContent = targetingMsgJson.msgContent; + inaObj.msgId = targetingMsgJson.wzrk_id; if (targetingMsgJson.wzrk_pivot) { - _inaObj.pivotId = targetingMsgJson.wzrk_pivot; + inaObj.pivotId = targetingMsgJson.wzrk_pivot; } var msgCTkv = []; @@ -5730,66 +5332,61 @@ for (var wzrkPrefixKey in targetingMsgJson) { // ADD WZRK PREFIX KEY VALUE PAIRS if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) { - var wzrkJson = _defineProperty({}, wzrkPrefixKey, targetingMsgJson[wzrkPrefixKey]); - + const wzrkJson = { + [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] + }; msgCTkv.push(wzrkJson); } } if (msgCTkv.length > 0) { - _inaObj.msgCTkv = msgCTkv; + inaObj.msgCTkv = msgCTkv; } if (targetingMsgJson.display.kv != null) { - _inaObj.kv = targetingMsgJson.display.kv; + inaObj.kv = targetingMsgJson.display.kv; } // PUBLIC API TO RECORD CLICKED EVENT - window.clevertap.raisePopupNotificationClicked = function (notificationData) { + window.clevertap.raisePopupNotificationClicked = notificationData => { if (!notificationData || !notificationData.msgId) { return; } - var eventData = {}; + const eventData = {}; eventData.type = 'event'; eventData.evtName = NOTIFICATION_CLICKED; - eventData.evtData = _defineProperty({}, WZRK_ID, notificationData.msgId); + eventData.evtData = { + [WZRK_ID]: notificationData.msgId + }; if (targetingMsgJson.wzrk_pivot) { - eventData.evtData = _objectSpread2(_objectSpread2({}, eventData.evtData), {}, { + eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId - }); + }; } // WZRK PREFIX KEY VALUE PAIRS if (notificationData.msgCTkv) { - var _iterator = _createForOfIteratorHelper(notificationData.msgCTkv), - _step; - - try { - for (_iterator.s(); !(_step = _iterator.n()).done;) { - var wzrkPrefixObj = _step.value; - eventData.evtData = _objectSpread2(_objectSpread2({}, eventData.evtData), wzrkPrefixObj); - } - } catch (err) { - _iterator.e(err); - } finally { - _iterator.f(); + for (var wzrkPrefixObj of notificationData.msgCTkv) { + eventData.evtData = { ...eventData.evtData, + ...wzrkPrefixObj + }; } } _request.processEvent(eventData); }; - popupCallback(_inaObj); + popupCallback(inaObj); } } }; - var exitintentObj; + let exitintentObj; - var showExitIntent = function showExitIntent(event, targetObj) { - var targetingMsgJson; + const showExitIntent = (event, targetObj) => { + let targetingMsgJson; if (event != null && event.clientY > 0) { return; @@ -5802,7 +5399,7 @@ } if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) { - var element = document.getElementById('intentPreview'); + const element = document.getElementById('intentPreview'); element.remove(); document.getElementById('intentOpacityDiv').remove(); } // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist @@ -5821,16 +5418,16 @@ return; } - var campaignId = targetingMsgJson.wzrk_id.split('_')[0]; + const campaignId = targetingMsgJson.wzrk_id.split('_')[0]; $ct.campaignDivMap[campaignId] = 'intentPreview'; - var legacy = false; - var opacityDiv = document.createElement('div'); + let legacy = false; + const opacityDiv = document.createElement('div'); opacityDiv.id = 'intentOpacityDiv'; - var opacity = targetingMsgJson.display.opacity || 0.7; - var rgbaColor = "rgba(0,0,0,".concat(opacity, ")"); + const opacity = targetingMsgJson.display.opacity || 0.7; + const rgbaColor = "rgba(0,0,0,".concat(opacity, ")"); opacityDiv.setAttribute('style', "position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ".concat(rgbaColor, ";")); document.body.appendChild(opacityDiv); - var msgDiv = document.createElement('div'); + const msgDiv = document.createElement('div'); msgDiv.id = 'intentPreview'; if (targetingMsgJson.display.proto == null) { @@ -5841,29 +5438,29 @@ } document.body.appendChild(msgDiv); - var iframe = document.createElement('iframe'); - var borderRadius = targetingMsgJson.display.br === false ? '0' : '8'; + const iframe = document.createElement('iframe'); + const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'; iframe.frameborder = '0px'; iframe.marginheight = '0px'; iframe.marginwidth = '0px'; iframe.scrolling = 'no'; iframe.id = 'wiz-iframe-intent'; - var onClick = targetingMsgJson.display.onClick; - var pointerCss = ''; + const onClick = targetingMsgJson.display.onClick; + let pointerCss = ''; if (onClick !== '' && onClick != null) { pointerCss = 'cursor:pointer;'; } - var html; // direct html + let html; // direct html if (targetingMsgJson.msgContent.type === 1) { html = targetingMsgJson.msgContent.html; html = html.replace(/##campaignId##/g, campaignId); html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id); } else { - var css = '' + ''; - var bgColor, textColor, btnBg, btColor; + const css = '' + ''; + let bgColor, textColor, btnBg, btColor; if (targetingMsgJson.display.theme === 'dark') { bgColor = '#2d2d2e'; @@ -5877,32 +5474,32 @@ btColor = '#ffffff'; } - var titleText = targetingMsgJson.msgContent.title; - var descriptionText = targetingMsgJson.msgContent.description; - var ctaText = ''; + const titleText = targetingMsgJson.msgContent.title; + const descriptionText = targetingMsgJson.msgContent.description; + let ctaText = ''; if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') { ctaText = "'; } - var imageTd = ''; + let imageTd = ''; if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') { imageTd = "
 + titleText + ' /></div>';
         }
 
-        var onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + " + "×" + "
" + "
" + titleText + '
'; - var body = "
" + descriptionText + '
' + imageTd + ctaText + '
'; + const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + ",'intentPreview');"; + const title = "
" + "×" + "
" + "
" + titleText + '
'; + const body = "
" + descriptionText + '
' + imageTd + ctaText + '
'; html = css + title + body; } iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;'); msgDiv.appendChild(iframe); - var ifrm = iframe.contentWindow ? iframe.contentWindow : iframe.contentDocument.document ? iframe.contentDocument.document : iframe.contentDocument; - var doc = ifrm.document; // Dispatch event for interstitial/exit intent close + const ifrm = iframe.contentWindow ? iframe.contentWindow : iframe.contentDocument.document ? iframe.contentDocument.document : iframe.contentDocument; + const doc = ifrm.document; // Dispatch event for interstitial/exit intent close - var closeCampaign = new Event('CT_campaign_rendered'); + const closeCampaign = new Event('CT_campaign_rendered'); document.dispatchEvent(closeCampaign); doc.open(); doc.write(html); @@ -5912,7 +5509,7 @@ } doc.close(); - var contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv'); + const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv'); setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy); }; @@ -5930,8 +5527,8 @@ return; } - var processNativeDisplayArr = function processNativeDisplayArr(arrInAppNotifs) { - Object.keys(arrInAppNotifs).map(function (key) { + const processNativeDisplayArr = arrInAppNotifs => { + Object.keys(arrInAppNotifs).map(key => { var elementId, id; if (arrInAppNotifs[key].display.divId) { @@ -5949,12 +5546,12 @@ }); }; - var addLoadListener = function addLoadListener(arrInAppNotifs) { - window.addEventListener('load', function () { - var count = 0; + const addLoadListener = arrInAppNotifs => { + window.addEventListener('load', () => { + let count = 0; if (count < 20) { - var t = setInterval(function () { + const t = setInterval(() => { processNativeDisplayArr(arrInAppNotifs); if (Object.keys(arrInAppNotifs).length === 0 || count === 20) { @@ -5966,13 +5563,43 @@ }, 500); } }); - }; + }; // const renderVisualBuilder = (targetingMsgJson) => { + // const details = targetingMsgJson.display.details[0] + // const siteUrl = Object.keys(details)[0] + // const selectors = details[siteUrl] + // if (siteUrl === window.location.href) { + // for (const selector in selectors) { + // const element = document.querySelector(selector) + // if (element) { + // element.outerHTML = selectors[selector].html + // window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot }) + // } else { + // let count = 0 + // const intervalId = setInterval(() => { + // const retryElement = document.querySelector(selector) + // if (retryElement) { + // retryElement.outerHTML = selectors[selector].html + // window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot }) + // clearInterval(intervalId) + // } else { + // count++ + // if (count >= 20) { + // console.log(`No element present on DOM with selector '${selector}'.`) + // clearInterval(intervalId) + // } + // } + // }, 500) + // } + // } + // } + // } + if (msg.inapp_notifs != null) { - var arrInAppNotifs = {}; + const arrInAppNotifs = {}; - for (var index = 0; index < msg.inapp_notifs.length; index++) { - var targetNotif = msg.inapp_notifs[index]; + for (let index = 0; index < msg.inapp_notifs.length; index++) { + const targetNotif = msg.inapp_notifs[index]; if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) { showFooterNotification(targetNotif); @@ -5984,13 +5611,15 @@ // if display['wtarget_type']==2 then web native display if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel - var element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector); + const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector); if (element !== null) { targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif); } else { arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif; // Add targetNotif to object } + } else if (targetNotif.msgContent.type === 4) { + renderVisualBuilder(targetNotif, false); } else { showFooterNotification(targetNotif); } @@ -6007,7 +5636,7 @@ } } - var mergeEventMap = function mergeEventMap(newEvtMap) { + const mergeEventMap = newEvtMap => { if ($ct.globalEventsMap == null) { $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE); @@ -6017,10 +5646,10 @@ } } - for (var key in newEvtMap) { + for (const key in newEvtMap) { if (newEvtMap.hasOwnProperty(key)) { - var oldEvtObj = $ct.globalEventsMap[key]; - var newEvtObj = newEvtMap[key]; + const oldEvtObj = $ct.globalEventsMap[key]; + const newEvtObj = newEvtMap[key]; if ($ct.globalEventsMap[key] != null) { if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) { @@ -6033,18 +5662,18 @@ } }; - var handleInboxNotifications = function handleInboxNotifications() { + const handleInboxNotifications = () => { if (msg.inbox_preview) { processInboxNotifs(msg); return; } if (msg.inbox_notifs) { - var msgArr = []; + const msgArr = []; - for (var _index = 0; _index < msg.inbox_notifs.length; _index++) { - if (doCampHouseKeeping(msg.inbox_notifs[_index]) !== false) { - msgArr.push(msg.inbox_notifs[_index]); + for (let index = 0; index < msg.inbox_notifs.length; index++) { + if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) { + msgArr.push(msg.inbox_notifs[index]); } } @@ -6064,9 +5693,9 @@ if ($ct.inbox === null) { msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting); - initializeWebInbox(_logger).then(function () { + initializeWebInbox(_logger).then(() => { handleInboxNotifications(); - }).catch(function (e) {}); + }).catch(e => {}); } else { handleInboxNotifications(); } @@ -6077,18 +5706,18 @@ return; } - var staleDataUpdate = function staleDataUpdate(staledata, campType) { - var campObj = getCampaignObject(); - var globalObj = campObj[campType].global; + const staleDataUpdate = (staledata, campType) => { + const campObj = getCampaignObject(); + const globalObj = campObj[campType].global; if (globalObj != null && campType) { - for (var idx in staledata) { + for (const idx in staledata) { if (staledata.hasOwnProperty(idx)) { delete globalObj[staledata[idx]]; if (StorageManager.read(CAMP_COOKIE_G)) { - var guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))); - var guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME))); + const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))); + const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME))); if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) { delete guidCampObj[guid][campType][staledata[idx]]; @@ -6105,10 +5734,10 @@ if (StorageManager._isLocalStorageSupported()) { try { if (msg.evpr != null) { - var eventsMap = msg.evpr.events; - var profileMap = msg.evpr.profile; - var syncExpiry = msg.evpr.expires_in; - var now = getNow(); + const eventsMap = msg.evpr.events; + const profileMap = msg.evpr.profile; + const syncExpiry = msg.evpr.expires_in; + const now = getNow(); StorageManager.setMetaProp('lsTime', now); StorageManager.setMetaProp('exTs', syncExpiry); mergeEventMap(eventsMap); @@ -6142,12 +5771,11 @@ var _isPersonalisationActive$2 = _classPrivateFieldLooseKey("isPersonalisationActive"); - var User = /*#__PURE__*/function () { - function User(_ref) { - var isPersonalisationActive = _ref.isPersonalisationActive; - - _classCallCheck(this, User); - + class User { + constructor(_ref) { + let { + isPersonalisationActive + } = _ref; Object.defineProperty(this, _isPersonalisationActive$2, { writable: true, value: void 0 @@ -6155,40 +5783,35 @@ _classPrivateFieldLooseBase(this, _isPersonalisationActive$2)[_isPersonalisationActive$2] = isPersonalisationActive; } - _createClass(User, [{ - key: "getTotalVisits", - value: function getTotalVisits() { - if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$2)[_isPersonalisationActive$2]()) { - return; - } + getTotalVisits() { + if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$2)[_isPersonalisationActive$2]()) { + return; + } - var visitCount = StorageManager.getMetaProp('sc'); + let visitCount = StorageManager.getMetaProp('sc'); - if (visitCount == null) { - visitCount = 1; - } + if (visitCount == null) { + visitCount = 1; + } + + return visitCount; + } - return visitCount; + getLastVisit() { + if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$2)[_isPersonalisationActive$2]()) { + return; } - }, { - key: "getLastVisit", - value: function getLastVisit() { - if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$2)[_isPersonalisationActive$2]()) { - return; - } - var prevSession = StorageManager.getMetaProp('ps'); + const prevSession = StorageManager.getMetaProp('ps'); - if (prevSession != null) { - return new Date(prevSession * 1000); - } + if (prevSession != null) { + return new Date(prevSession * 1000); } - }]); + } - return User; - }(); + } - var logLevels = { + const logLevels = { DISABLE: 0, ERROR: 1, INFO: 2, @@ -6202,10 +5825,8 @@ var _isLegacyDebug = _classPrivateFieldLooseKey("isLegacyDebug"); - var Logger = /*#__PURE__*/function () { - function Logger(logLevel) { - _classCallCheck(this, Logger); - + class Logger { + constructor(logLevel) { Object.defineProperty(this, _isLegacyDebug, { get: _get_isLegacyDebug, set: void 0 @@ -6222,64 +5843,56 @@ this.wzrkError = {}; } - _createClass(Logger, [{ - key: "error", - value: function error(message) { - if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.ERROR) { - _classPrivateFieldLooseBase(this, _log)[_log]('error', message); - } - } - }, { - key: "info", - value: function info(message) { - if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.INFO) { - _classPrivateFieldLooseBase(this, _log)[_log]('log', message); - } - } - }, { - key: "debug", - value: function debug(message) { - if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.DEBUG || _classPrivateFieldLooseBase(this, _isLegacyDebug)[_isLegacyDebug]) { - _classPrivateFieldLooseBase(this, _log)[_log]('debug', message); - } + get logLevel() { + return _classPrivateFieldLooseBase(this, _logLevel)[_logLevel]; + } + + set logLevel(logLevel) { + _classPrivateFieldLooseBase(this, _logLevel)[_logLevel] = logLevel; + } + + error(message) { + if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.ERROR) { + _classPrivateFieldLooseBase(this, _log)[_log]('error', message); } - }, { - key: "debugPE", - value: function debugPE(message) { - if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.DEBUG_PE) { - _classPrivateFieldLooseBase(this, _log)[_log]('debug_pe', message); - } + } + + info(message) { + if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.INFO) { + _classPrivateFieldLooseBase(this, _log)[_log]('log', message); } - }, { - key: "reportError", - value: function reportError(code, description) { - this.wzrkError.c = code; - this.wzrkError.d = description; - this.error("".concat(CLEVERTAP_ERROR_PREFIX, " ").concat(code, ": ").concat(description)); + } + + debug(message) { + if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.DEBUG || _classPrivateFieldLooseBase(this, _isLegacyDebug)[_isLegacyDebug]) { + _classPrivateFieldLooseBase(this, _log)[_log]('debug', message); } - }, { - key: "logLevel", - get: function get() { - return _classPrivateFieldLooseBase(this, _logLevel)[_logLevel]; - }, - set: function set(logLevel) { - _classPrivateFieldLooseBase(this, _logLevel)[_logLevel] = logLevel; + } + + debugPE(message) { + if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.DEBUG_PE) { + _classPrivateFieldLooseBase(this, _log)[_log]('debug_pe', message); } - }]); + } + + reportError(code, description) { + this.wzrkError.c = code; + this.wzrkError.d = description; + this.error("".concat(CLEVERTAP_ERROR_PREFIX, " ").concat(code, ": ").concat(description)); + } - return Logger; - }(); + } var _log2 = function _log2(level, message) { if (window.console) { try { - var ts = new Date().getTime(); + const ts = new Date().getTime(); console[level]("CleverTap [".concat(ts, "]: ").concat(message)); } catch (e) {} } }; - var _get_isLegacyDebug = function _get_isLegacyDebug() { + var _get_isLegacyDebug = function () { return typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === ''; }; @@ -6289,14 +5902,13 @@ var _isPersonalisationActive$3 = _classPrivateFieldLooseKey("isPersonalisationActive"); - var SessionManager = /*#__PURE__*/function () { + class SessionManager { // SCOOKIE_NAME - function SessionManager(_ref) { - var logger = _ref.logger, - isPersonalisationActive = _ref.isPersonalisationActive; - - _classCallCheck(this, SessionManager); - + constructor(_ref) { + let { + logger, + isPersonalisationActive + } = _ref; Object.defineProperty(this, _logger$5, { writable: true, value: void 0 @@ -6316,120 +5928,112 @@ _classPrivateFieldLooseBase(this, _isPersonalisationActive$3)[_isPersonalisationActive$3] = isPersonalisationActive; } - _createClass(SessionManager, [{ - key: "getSessionCookieObject", - value: function getSessionCookieObject() { - var scookieStr = StorageManager.readCookie(this.cookieName); - var obj = {}; + get sessionId() { + return _classPrivateFieldLooseBase(this, _sessionId)[_sessionId]; + } + + set sessionId(sessionId) { + _classPrivateFieldLooseBase(this, _sessionId)[_sessionId] = sessionId; + } - if (scookieStr != null) { - // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera - scookieStr = scookieStr.replace(singleQuoteRegex, '"'); - obj = JSON.parse(scookieStr); + getSessionCookieObject() { + let scookieStr = StorageManager.readCookie(this.cookieName); + let obj = {}; - if (!isObject(obj)) { - obj = {}; - } else { - if (typeof obj.t !== 'undefined') { - // check time elapsed since last request - var lastTime = obj.t; - var now = getNow(); - - if (now - lastTime > SCOOKIE_EXP_TIME_IN_SECS + 60) { - // adding 60 seconds to compensate for in-journey requests - // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read - // hence we shouldn't use it. - obj = {}; - } + if (scookieStr != null) { + // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera + scookieStr = scookieStr.replace(singleQuoteRegex, '"'); + obj = JSON.parse(scookieStr); + + if (!isObject(obj)) { + obj = {}; + } else { + if (typeof obj.t !== 'undefined') { + // check time elapsed since last request + const lastTime = obj.t; + const now = getNow(); + + if (now - lastTime > SCOOKIE_EXP_TIME_IN_SECS + 60) { + // adding 60 seconds to compensate for in-journey requests + // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read + // hence we shouldn't use it. + obj = {}; } } } + } - this.scookieObj = obj; - return obj; - } - }, { - key: "setSessionCookieObject", - value: function setSessionCookieObject(obj) { - var objStr = JSON.stringify(obj); - StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName()); - } - }, { - key: "manageSession", - value: function manageSession(session) { - // first time. check if current session id in localstorage is same - // if not same then prev = current and current = this new session - if (typeof this.sessionId === 'undefined' || this.sessionId !== session) { - var currentSessionInLS = StorageManager.getMetaProp('cs'); // if sessionId in meta is undefined - set current to both - - if (typeof currentSessionInLS === 'undefined') { - StorageManager.setMetaProp('ps', session); - StorageManager.setMetaProp('cs', session); - StorageManager.setMetaProp('sc', 1); - } else if (currentSessionInLS !== session) { - // not same as session in local storage. new session - StorageManager.setMetaProp('ps', currentSessionInLS); - StorageManager.setMetaProp('cs', session); - var sessionCount = StorageManager.getMetaProp('sc'); - - if (typeof sessionCount === 'undefined') { - sessionCount = 0; - } + this.scookieObj = obj; + return obj; + } + + setSessionCookieObject(obj) { + const objStr = JSON.stringify(obj); + StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName()); + } + + manageSession(session) { + // first time. check if current session id in localstorage is same + // if not same then prev = current and current = this new session + if (typeof this.sessionId === 'undefined' || this.sessionId !== session) { + const currentSessionInLS = StorageManager.getMetaProp('cs'); // if sessionId in meta is undefined - set current to both + + if (typeof currentSessionInLS === 'undefined') { + StorageManager.setMetaProp('ps', session); + StorageManager.setMetaProp('cs', session); + StorageManager.setMetaProp('sc', 1); + } else if (currentSessionInLS !== session) { + // not same as session in local storage. new session + StorageManager.setMetaProp('ps', currentSessionInLS); + StorageManager.setMetaProp('cs', session); + let sessionCount = StorageManager.getMetaProp('sc'); - StorageManager.setMetaProp('sc', sessionCount + 1); + if (typeof sessionCount === 'undefined') { + sessionCount = 0; } - this.sessionId = session; - } - } - }, { - key: "getTimeElapsed", - value: function getTimeElapsed() { - if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$3)[_isPersonalisationActive$3]()) { - return; + StorageManager.setMetaProp('sc', sessionCount + 1); } - if (this.scookieObj != null) { - // TODO: check logic? - this.scookieObj = this.getSessionCookieObject(); - } + this.sessionId = session; + } + } - var sessionStart = this.scookieObj.s; + getTimeElapsed() { + if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$3)[_isPersonalisationActive$3]()) { + return; + } - if (sessionStart != null) { - var ts = getNow(); - return Math.floor(ts - sessionStart); - } + if (this.scookieObj != null) { + // TODO: check logic? + this.scookieObj = this.getSessionCookieObject(); } - }, { - key: "getPageCount", - value: function getPageCount() { - if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$3)[_isPersonalisationActive$3]()) { - return; - } - if (this.scookieObj != null) { - // TODO: check logic - this.scookieObj = this.getSessionCookieObject(); - } + const sessionStart = this.scookieObj.s; - return this.scookieObj.p; + if (sessionStart != null) { + const ts = getNow(); + return Math.floor(ts - sessionStart); } - }, { - key: "sessionId", - get: function get() { - return _classPrivateFieldLooseBase(this, _sessionId)[_sessionId]; - }, - set: function set(sessionId) { - _classPrivateFieldLooseBase(this, _sessionId)[_sessionId] = sessionId; + } + + getPageCount() { + if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$3)[_isPersonalisationActive$3]()) { + return; } - }]); - return SessionManager; - }(); + if (this.scookieObj != null) { + // TODO: check logic + this.scookieObj = this.getSessionCookieObject(); + } + + return this.scookieObj.p; + } + + } - var seqNo = 0; - var requestTime = 0; + let seqNo = 0; + let requestTime = 0; var _logger$6 = _classPrivateFieldLooseKey("logger"); @@ -6445,16 +6049,15 @@ var _addToLocalEventMap = _classPrivateFieldLooseKey("addToLocalEventMap"); - var RequestManager = /*#__PURE__*/function () { - function RequestManager(_ref) { - var logger = _ref.logger, - account = _ref.account, - device = _ref.device, - session = _ref.session, - isPersonalisationActive = _ref.isPersonalisationActive; - - _classCallCheck(this, RequestManager); - + class RequestManager { + constructor(_ref) { + let { + logger, + account, + device, + session, + isPersonalisationActive + } = _ref; Object.defineProperty(this, _addToLocalEventMap, { value: _addToLocalEventMap2 }); @@ -6493,234 +6096,222 @@ RequestDispatcher.account = account; } - _createClass(RequestManager, [{ - key: "processBackupEvents", - value: function processBackupEvents() { - var backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME); - - if (typeof backupMap === 'undefined' || backupMap === null) { - return; - } + processBackupEvents() { + const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME); - this.processingBackup = true; + if (typeof backupMap === 'undefined' || backupMap === null) { + return; + } - for (var idx in backupMap) { - if (backupMap.hasOwnProperty(idx)) { - var backupEvent = backupMap[idx]; + this.processingBackup = true; - if (typeof backupEvent.fired === 'undefined') { - _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].debug('Processing backup event : ' + backupEvent.q); + for (const idx in backupMap) { + if (backupMap.hasOwnProperty(idx)) { + const backupEvent = backupMap[idx]; - if (typeof backupEvent.q !== 'undefined') { - RequestDispatcher.fireRequest(backupEvent.q); - } + if (typeof backupEvent.fired === 'undefined') { + _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].debug('Processing backup event : ' + backupEvent.q); - backupEvent.fired = true; + if (typeof backupEvent.q !== 'undefined') { + RequestDispatcher.fireRequest(backupEvent.q); } + + backupEvent.fired = true; } } + } + + StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap); + this.processingBackup = false; + } - StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap); - this.processingBackup = false; + addSystemDataToObject(dataObject, ignoreTrim) { + // ignore trim for chrome notifications; undefined everywhere else + if (typeof ignoreTrim === 'undefined') { + dataObject = removeUnsupportedChars(dataObject, _classPrivateFieldLooseBase(this, _logger$6)[_logger$6]); } - }, { - key: "addSystemDataToObject", - value: function addSystemDataToObject(dataObject, ignoreTrim) { - // ignore trim for chrome notifications; undefined everywhere else - if (typeof ignoreTrim === 'undefined') { - dataObject = removeUnsupportedChars(dataObject, _classPrivateFieldLooseBase(this, _logger$6)[_logger$6]); - } - if (!isObjectEmpty(_classPrivateFieldLooseBase(this, _logger$6)[_logger$6].wzrkError)) { - dataObject.wzrk_error = _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].wzrkError; - _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].wzrkError = {}; - } + if (!isObjectEmpty(_classPrivateFieldLooseBase(this, _logger$6)[_logger$6].wzrkError)) { + dataObject.wzrk_error = _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].wzrkError; + _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].wzrkError = {}; + } - dataObject.id = _classPrivateFieldLooseBase(this, _account$2)[_account$2].id; + dataObject.id = _classPrivateFieldLooseBase(this, _account$2)[_account$2].id; - if (isValueValid(_classPrivateFieldLooseBase(this, _device$2)[_device$2].gcookie)) { - dataObject.g = _classPrivateFieldLooseBase(this, _device$2)[_device$2].gcookie; - } + if (isValueValid(_classPrivateFieldLooseBase(this, _device$2)[_device$2].gcookie)) { + dataObject.g = _classPrivateFieldLooseBase(this, _device$2)[_device$2].gcookie; + } - var obj = _classPrivateFieldLooseBase(this, _session$2)[_session$2].getSessionCookieObject(); + const obj = _classPrivateFieldLooseBase(this, _session$2)[_session$2].getSessionCookieObject(); - dataObject.s = obj.s; // session cookie + dataObject.s = obj.s; // session cookie - dataObject.pg = typeof obj.p === 'undefined' ? 1 : obj.p; // Page count + dataObject.pg = typeof obj.p === 'undefined' ? 1 : obj.p; // Page count - var proto = document.location.protocol; - proto = proto.replace(':', ''); - dataObject.af = _objectSpread2({ - lib: 'web-sdk-v1.7.3', - protocol: proto - }, $ct.flutterVersion); // app fields + let proto = document.location.protocol; + proto = proto.replace(':', ''); + dataObject.af = { + lib: 'web-sdk-v1.7.3', + protocol: proto, + ...$ct.flutterVersion + }; // app fields - if (sessionStorage.hasOwnProperty('WZRK_D')) { - dataObject.debug = true; - } + if (sessionStorage.hasOwnProperty('WZRK_D')) { + dataObject.debug = true; + } + + return dataObject; + } + + addFlags(data) { + // check if cookie should be cleared. + _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie] = StorageManager.getAndClearMetaProp(CLEAR); - return dataObject; + if (_classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie] !== undefined && _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie]) { + data.rc = true; + + _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].debug('reset cookie sent in request and cleared from meta for future requests.'); } - }, { - key: "addFlags", - value: function addFlags(data) { - // check if cookie should be cleared. - _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie] = StorageManager.getAndClearMetaProp(CLEAR); - if (_classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie] !== undefined && _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie]) { - data.rc = true; + if (_classPrivateFieldLooseBase(this, _isPersonalisationActive$4)[_isPersonalisationActive$4]()) { + const lastSyncTime = StorageManager.getMetaProp('lsTime'); + const expirySeconds = StorageManager.getMetaProp('exTs'); // dsync not found in local storage - get data from server - _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].debug('reset cookie sent in request and cleared from meta for future requests.'); + if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') { + data.dsync = true; + return; } - if (_classPrivateFieldLooseBase(this, _isPersonalisationActive$4)[_isPersonalisationActive$4]()) { - var lastSyncTime = StorageManager.getMetaProp('lsTime'); - var expirySeconds = StorageManager.getMetaProp('exTs'); // dsync not found in local storage - get data from server + const now = getNow(); // last sync time has expired - get fresh data from server - if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') { - data.dsync = true; - return; - } + if (lastSyncTime + expirySeconds < now) { + data.dsync = true; + } + } + } // saves url to backup cache and fires the request - var now = getNow(); // last sync time has expired - get fresh data from server + /** + * + * @param {string} url + * @param {boolean} override whether the request can go through or not + * @param {Boolean} sendOULFlag - true in case of a On User Login request + */ - if (lastSyncTime + expirySeconds < now) { - data.dsync = true; - } - } - } // saves url to backup cache and fires the request - /** - * - * @param {string} url - * @param {boolean} override whether the request can go through or not - * @param {Boolean} sendOULFlag - true in case of a On User Login request - */ + saveAndFireRequest(url, override, sendOULFlag, evtName) { + const now = getNow(); + url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N); + const data = url + '&i=' + now + '&sn=' + seqNo; + StorageManager.backupEvent(data, $ct.globalCache.REQ_N, _classPrivateFieldLooseBase(this, _logger$6)[_logger$6]); // if offline is set to true, save the request in backup and return - }, { - key: "saveAndFireRequest", - value: function saveAndFireRequest(url, override, sendOULFlag, evtName) { - var now = getNow(); - url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N); - var data = url + '&i=' + now + '&sn=' + seqNo; - StorageManager.backupEvent(data, $ct.globalCache.REQ_N, _classPrivateFieldLooseBase(this, _logger$6)[_logger$6]); // if offline is set to true, save the request in backup and return - - if ($ct.offline) return; // if there is no override - // and an OUL request is not in progress - // then process the request as it is - // else block the request - // note - $ct.blockRequest should ideally be used for override - - if ((!override || _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie] !== undefined && _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie]) && !window.isOULInProgress) { - if (now === requestTime) { - seqNo++; - } else { - requestTime = now; - seqNo = 0; - } + if ($ct.offline) return; // if there is no override + // and an OUL request is not in progress + // then process the request as it is + // else block the request + // note - $ct.blockRequest should ideally be used for override - window.oulReqN = $ct.globalCache.REQ_N; - RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName); + if ((!override || _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie] !== undefined && _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie]) && !window.isOULInProgress) { + if (now === requestTime) { + seqNo++; } else { - _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].debug("Not fired due to override - ".concat($ct.blockRequest, " or clearCookie - ").concat(_classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie], " or OUL request in progress - ").concat(window.isOULInProgress)); + requestTime = now; + seqNo = 0; } + + window.oulReqN = $ct.globalCache.REQ_N; + RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName); + } else { + _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].debug("Not fired due to override - ".concat($ct.blockRequest, " or clearCookie - ").concat(_classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie], " or OUL request in progress - ").concat(window.isOULInProgress)); } - }, { - key: "unregisterTokenForGuid", - value: function unregisterTokenForGuid(givenGUID) { - var payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA); // Send unregister event only when token is available + } - if (payload) { - var data = {}; - data.type = 'data'; + unregisterTokenForGuid(givenGUID) { + const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA); // Send unregister event only when token is available - if (isValueValid(givenGUID)) { - data.g = givenGUID; - } + if (payload) { + const data = {}; + data.type = 'data'; - data.action = 'unregister'; - data.id = _classPrivateFieldLooseBase(this, _account$2)[_account$2].id; + if (isValueValid(givenGUID)) { + data.g = givenGUID; + } - var obj = _classPrivateFieldLooseBase(this, _session$2)[_session$2].getSessionCookieObject(); + data.action = 'unregister'; + data.id = _classPrivateFieldLooseBase(this, _account$2)[_account$2].id; - data.s = obj.s; // session cookie + const obj = _classPrivateFieldLooseBase(this, _session$2)[_session$2].getSessionCookieObject(); - var compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$6)[_logger$6]); + data.s = obj.s; // session cookie - var pageLoadUrl = _classPrivateFieldLooseBase(this, _account$2)[_account$2].dataPostURL; + const compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$6)[_logger$6]); - pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data'); - pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData); - RequestDispatcher.fireRequest(pageLoadUrl, true); - StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false); - } // REGISTER TOKEN + let pageLoadUrl = _classPrivateFieldLooseBase(this, _account$2)[_account$2].dataPostURL; + pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data'); + pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData); + RequestDispatcher.fireRequest(pageLoadUrl, true); + StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false); + } // REGISTER TOKEN - this.registerToken(payload); - } - }, { - key: "registerToken", - value: function registerToken(payload) { - if (!payload) return; // add gcookie etc to the payload - payload = this.addSystemDataToObject(payload, true); - payload = JSON.stringify(payload); + this.registerToken(payload); + } - var pageLoadUrl = _classPrivateFieldLooseBase(this, _account$2)[_account$2].dataPostURL; + registerToken(payload) { + if (!payload) return; // add gcookie etc to the payload - pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data'); - pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, _classPrivateFieldLooseBase(this, _logger$6)[_logger$6])); - RequestDispatcher.fireRequest(pageLoadUrl); // set in localstorage + payload = this.addSystemDataToObject(payload, true); + payload = JSON.stringify(payload); - StorageManager.save(WEBPUSH_LS_KEY, 'ok'); - } - }, { - key: "processEvent", - value: function processEvent(data) { - _classPrivateFieldLooseBase(this, _addToLocalEventMap)[_addToLocalEventMap](data.evtName); + let pageLoadUrl = _classPrivateFieldLooseBase(this, _account$2)[_account$2].dataPostURL; - data = this.addSystemDataToObject(data, undefined); - this.addFlags(data); - data[CAMP_COOKIE_NAME] = getCampaignObjForLc(); - var compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$6)[_logger$6]); + pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data'); + pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, _classPrivateFieldLooseBase(this, _logger$6)[_logger$6])); + RequestDispatcher.fireRequest(pageLoadUrl); // set in localstorage - var pageLoadUrl = _classPrivateFieldLooseBase(this, _account$2)[_account$2].dataPostURL; + StorageManager.save(WEBPUSH_LS_KEY, 'ok'); + } - pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH); - pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData); - this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName); - } - }, { - key: "post", - value: function post(url, body) { - var _this = this; - - return fetch(url, { - method: 'post', - headers: { - 'Content-Type': 'application/json' - }, - body: body - }).then(function (response) { - if (response.ok) { - return response.json(); - } + processEvent(data) { + _classPrivateFieldLooseBase(this, _addToLocalEventMap)[_addToLocalEventMap](data.evtName); - throw response; - }).then(function (data) { - _classPrivateFieldLooseBase(_this, _logger$6)[_logger$6].debug('Sync data successful', data); + data = this.addSystemDataToObject(data, undefined); + this.addFlags(data); + data[CAMP_COOKIE_NAME] = getCampaignObjForLc(); + const compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$6)[_logger$6]); - return data; - }).catch(function (e) { - _classPrivateFieldLooseBase(_this, _logger$6)[_logger$6].debug('Error in syncing variables', e); + let pageLoadUrl = _classPrivateFieldLooseBase(this, _account$2)[_account$2].dataPostURL; - throw e; - }); - } - }]); + pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH); + pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData); + this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName); + } + + post(url, body) { + return fetch(url, { + method: 'post', + headers: { + 'Content-Type': 'application/json' + }, + body: body + }).then(response => { + if (response.ok) { + return response.json(); + } + + throw response; + }).then(data => { + _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].debug('Sync data successful', data); + + return data; + }).catch(e => { + _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].debug('Error in syncing variables', e); + + throw e; + }); + } - return RequestManager; - }(); + } var _addToLocalEventMap2 = function _addToLocalEventMap2(evtName) { if (StorageManager._isLocalStorageSupported()) { @@ -6732,8 +6323,8 @@ } } - var nowTs = getNow(); - var evtDetail = $ct.globalEventsMap[evtName]; + const nowTs = getNow(); + let evtDetail = $ct.globalEventsMap[evtName]; if (typeof evtDetail !== 'undefined') { evtDetail[2] = nowTs; @@ -6760,85 +6351,70 @@ var _processPrivacyArray = _classPrivateFieldLooseKey("processPrivacyArray"); - var Privacy = /*#__PURE__*/function (_Array) { - _inherits(Privacy, _Array); - - var _super = _createSuper(Privacy); - - function Privacy(_ref, values) { - var _this; - - var request = _ref.request, - account = _ref.account, - logger = _ref.logger; - - _classCallCheck(this, Privacy); - - _this = _super.call(this); - Object.defineProperty(_assertThisInitialized(_this), _processPrivacyArray, { + class Privacy extends Array { + constructor(_ref, values) { + let { + request, + account, + logger + } = _ref; + super(); + Object.defineProperty(this, _processPrivacyArray, { value: _processPrivacyArray2 }); - Object.defineProperty(_assertThisInitialized(_this), _request$4, { + Object.defineProperty(this, _request$4, { writable: true, value: void 0 }); - Object.defineProperty(_assertThisInitialized(_this), _account$3, { + Object.defineProperty(this, _account$3, { writable: true, value: void 0 }); - Object.defineProperty(_assertThisInitialized(_this), _oldValues$3, { + Object.defineProperty(this, _oldValues$3, { writable: true, value: void 0 }); - Object.defineProperty(_assertThisInitialized(_this), _logger$7, { + Object.defineProperty(this, _logger$7, { writable: true, value: void 0 }); - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _logger$7)[_logger$7] = logger; - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _request$4)[_request$4] = request; - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _account$3)[_account$3] = account; - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _oldValues$3)[_oldValues$3] = values; - return _this; + _classPrivateFieldLooseBase(this, _logger$7)[_logger$7] = logger; + _classPrivateFieldLooseBase(this, _request$4)[_request$4] = request; + _classPrivateFieldLooseBase(this, _account$3)[_account$3] = account; + _classPrivateFieldLooseBase(this, _oldValues$3)[_oldValues$3] = values; } - _createClass(Privacy, [{ - key: "push", - value: function push() { - for (var _len = arguments.length, privacyArr = new Array(_len), _key = 0; _key < _len; _key++) { - privacyArr[_key] = arguments[_key]; - } + push() { + for (var _len = arguments.length, privacyArr = new Array(_len), _key = 0; _key < _len; _key++) { + privacyArr[_key] = arguments[_key]; + } - if ($ct.isPrivacyArrPushed) { - _classPrivateFieldLooseBase(this, _processPrivacyArray)[_processPrivacyArray]($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr); - } else { - var _$ct$privacyArray; + if ($ct.isPrivacyArrPushed) { + _classPrivateFieldLooseBase(this, _processPrivacyArray)[_processPrivacyArray]($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr); + } else { + $ct.privacyArray.push(...privacyArr); + } - (_$ct$privacyArray = $ct.privacyArray).push.apply(_$ct$privacyArray, privacyArr); - } + return 0; + } - return 0; + _processOldValues() { + if (_classPrivateFieldLooseBase(this, _oldValues$3)[_oldValues$3]) { + _classPrivateFieldLooseBase(this, _processPrivacyArray)[_processPrivacyArray](_classPrivateFieldLooseBase(this, _oldValues$3)[_oldValues$3]); } - }, { - key: "_processOldValues", - value: function _processOldValues() { - if (_classPrivateFieldLooseBase(this, _oldValues$3)[_oldValues$3]) { - _classPrivateFieldLooseBase(this, _processPrivacyArray)[_processPrivacyArray](_classPrivateFieldLooseBase(this, _oldValues$3)[_oldValues$3]); - } - _classPrivateFieldLooseBase(this, _oldValues$3)[_oldValues$3] = null; - } - }]); + _classPrivateFieldLooseBase(this, _oldValues$3)[_oldValues$3] = null; + } - return Privacy; - }( /*#__PURE__*/_wrapNativeSuper(Array)); + } var _processPrivacyArray2 = function _processPrivacyArray2(privacyArr) { if (Array.isArray(privacyArr) && privacyArr.length > 0) { - var privacyObj = privacyArr.reduce(function (prev, curr) { - return _objectSpread2(_objectSpread2({}, prev), curr); - }, {}); - var data = {}; - var profileObj = {}; + const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, + ...curr + }), {}); + let data = {}; + const profileObj = {}; var optOut = false; if (privacyObj.hasOwnProperty(OPTOUT_KEY)) { @@ -6852,8 +6428,8 @@ } if (privacyObj.hasOwnProperty(USEIP_KEY)) { - var useIP = privacyObj[USEIP_KEY]; - var shouldUseIP = typeof useIP === 'boolean' ? useIP : false; + const useIP = privacyObj[USEIP_KEY]; + const shouldUseIP = typeof useIP === 'boolean' ? useIP : false; StorageManager.setMetaProp(USEIP_KEY, shouldUseIP); } @@ -6861,9 +6437,9 @@ data.type = 'profile'; data.profile = profileObj; data = _classPrivateFieldLooseBase(this, _request$4)[_request$4].addSystemDataToObject(data, undefined); - var compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$7)[_logger$7]); + const compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$7)[_logger$7]); - var pageLoadUrl = _classPrivateFieldLooseBase(this, _account$3)[_account$3].dataPostURL; + let pageLoadUrl = _classPrivateFieldLooseBase(this, _account$3)[_account$3].dataPostURL; pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH); pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData); @@ -6904,118 +6480,104 @@ var _handleNotificationRegistration = _classPrivateFieldLooseKey("handleNotificationRegistration"); - var NotificationHandler = /*#__PURE__*/function (_Array) { - _inherits(NotificationHandler, _Array); - - var _super = _createSuper(NotificationHandler); - - function NotificationHandler(_ref, values) { - var _this; - - var logger = _ref.logger, - session = _ref.session, - request = _ref.request, - account = _ref.account; - - _classCallCheck(this, NotificationHandler); - - _this = _super.call(this); - Object.defineProperty(_assertThisInitialized(_this), _handleNotificationRegistration, { + class NotificationHandler extends Array { + constructor(_ref, values) { + let { + logger, + session, + request, + account + } = _ref; + super(); + Object.defineProperty(this, _handleNotificationRegistration, { value: _handleNotificationRegistration2 }); - Object.defineProperty(_assertThisInitialized(_this), _removeWizAlertJS, { + Object.defineProperty(this, _removeWizAlertJS, { value: _removeWizAlertJS2 }); - Object.defineProperty(_assertThisInitialized(_this), _addWizAlertJS, { + Object.defineProperty(this, _addWizAlertJS, { value: _addWizAlertJS2 }); - Object.defineProperty(_assertThisInitialized(_this), _setUpChromeFirefoxNotifications, { + Object.defineProperty(this, _setUpChromeFirefoxNotifications, { value: _setUpChromeFirefoxNotifications2 }); - Object.defineProperty(_assertThisInitialized(_this), _setUpSafariNotifications, { + Object.defineProperty(this, _setUpSafariNotifications, { value: _setUpSafariNotifications2 }); - Object.defineProperty(_assertThisInitialized(_this), _setApplicationServerKey, { + Object.defineProperty(this, _setApplicationServerKey, { value: _setApplicationServerKey2 }); - Object.defineProperty(_assertThisInitialized(_this), _setUpWebPushNotifications, { + Object.defineProperty(this, _setUpWebPushNotifications, { value: _setUpWebPushNotifications2 }); - Object.defineProperty(_assertThisInitialized(_this), _setUpWebPush, { + Object.defineProperty(this, _setUpWebPush, { value: _setUpWebPush2 }); - Object.defineProperty(_assertThisInitialized(_this), _oldValues$4, { + Object.defineProperty(this, _oldValues$4, { writable: true, value: void 0 }); - Object.defineProperty(_assertThisInitialized(_this), _logger$8, { + Object.defineProperty(this, _logger$8, { writable: true, value: void 0 }); - Object.defineProperty(_assertThisInitialized(_this), _request$5, { + Object.defineProperty(this, _request$5, { writable: true, value: void 0 }); - Object.defineProperty(_assertThisInitialized(_this), _account$4, { + Object.defineProperty(this, _account$4, { writable: true, value: void 0 }); - Object.defineProperty(_assertThisInitialized(_this), _wizAlertJSPath, { + Object.defineProperty(this, _wizAlertJSPath, { writable: true, value: void 0 }); - Object.defineProperty(_assertThisInitialized(_this), _fcmPublicKey, { + Object.defineProperty(this, _fcmPublicKey, { writable: true, value: void 0 }); - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _wizAlertJSPath)[_wizAlertJSPath] = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'; - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _fcmPublicKey)[_fcmPublicKey] = null; - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _oldValues$4)[_oldValues$4] = values; - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _logger$8)[_logger$8] = logger; - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _request$5)[_request$5] = request; - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _account$4)[_account$4] = account; - return _this; + _classPrivateFieldLooseBase(this, _wizAlertJSPath)[_wizAlertJSPath] = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'; + _classPrivateFieldLooseBase(this, _fcmPublicKey)[_fcmPublicKey] = null; + _classPrivateFieldLooseBase(this, _oldValues$4)[_oldValues$4] = values; + _classPrivateFieldLooseBase(this, _logger$8)[_logger$8] = logger; + _classPrivateFieldLooseBase(this, _request$5)[_request$5] = request; + _classPrivateFieldLooseBase(this, _account$4)[_account$4] = account; } - _createClass(NotificationHandler, [{ - key: "push", - value: function push() { - for (var _len = arguments.length, displayArgs = new Array(_len), _key = 0; _key < _len; _key++) { - displayArgs[_key] = arguments[_key]; - } + push() { + for (var _len = arguments.length, displayArgs = new Array(_len), _key = 0; _key < _len; _key++) { + displayArgs[_key] = arguments[_key]; + } - _classPrivateFieldLooseBase(this, _setUpWebPush)[_setUpWebPush](displayArgs); + _classPrivateFieldLooseBase(this, _setUpWebPush)[_setUpWebPush](displayArgs); - return 0; - } - }, { - key: "_processOldValues", - value: function _processOldValues() { - if (_classPrivateFieldLooseBase(this, _oldValues$4)[_oldValues$4]) { - _classPrivateFieldLooseBase(this, _setUpWebPush)[_setUpWebPush](_classPrivateFieldLooseBase(this, _oldValues$4)[_oldValues$4]); - } + return 0; + } - _classPrivateFieldLooseBase(this, _oldValues$4)[_oldValues$4] = null; + _processOldValues() { + if (_classPrivateFieldLooseBase(this, _oldValues$4)[_oldValues$4]) { + _classPrivateFieldLooseBase(this, _setUpWebPush)[_setUpWebPush](_classPrivateFieldLooseBase(this, _oldValues$4)[_oldValues$4]); } - }, { - key: "_enableWebPush", - value: function _enableWebPush(enabled, applicationServerKey) { - $ct.webPushEnabled = enabled; - if (applicationServerKey != null) { - _classPrivateFieldLooseBase(this, _setApplicationServerKey)[_setApplicationServerKey](applicationServerKey); - } + _classPrivateFieldLooseBase(this, _oldValues$4)[_oldValues$4] = null; + } - if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) { - _classPrivateFieldLooseBase(this, _handleNotificationRegistration)[_handleNotificationRegistration]($ct.notifApi.displayArgs); - } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) { - _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].error('Ensure that web push notifications are fully enabled and integrated before requesting them'); - } + _enableWebPush(enabled, applicationServerKey) { + $ct.webPushEnabled = enabled; + + if (applicationServerKey != null) { + _classPrivateFieldLooseBase(this, _setApplicationServerKey)[_setApplicationServerKey](applicationServerKey); + } + + if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) { + _classPrivateFieldLooseBase(this, _handleNotificationRegistration)[_handleNotificationRegistration]($ct.notifApi.displayArgs); + } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) { + _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].error('Ensure that web push notifications are fully enabled and integrated before requesting them'); } - }]); + } - return NotificationHandler; - }( /*#__PURE__*/_wrapNativeSuper(Array)); + } var _setUpWebPush2 = function _setUpWebPush2(displayArgs) { if ($ct.webPushEnabled && displayArgs.length > 0) { @@ -7041,8 +6603,6 @@ }; var _setUpSafariNotifications2 = function _setUpSafariNotifications2(subscriptionCallback, apnsWebPushId, apnsServiceUrl) { - var _this2 = this; - // ensure that proper arguments are passed if (typeof apnsWebPushId === 'undefined') { _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].error('Ensure that APNS Web Push ID is supplied'); @@ -7053,82 +6613,70 @@ } if ('safari' in window && 'pushNotification' in window.safari) { - window.safari.pushNotification.requestPermission(apnsServiceUrl, apnsWebPushId, {}, function (subscription) { + window.safari.pushNotification.requestPermission(apnsServiceUrl, apnsWebPushId, {}, subscription => { if (subscription.permission === 'granted') { - var subscriptionData = JSON.parse(JSON.stringify(subscription)); + const subscriptionData = JSON.parse(JSON.stringify(subscription)); subscriptionData.endpoint = subscription.deviceToken; subscriptionData.browser = 'Safari'; StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData); - _classPrivateFieldLooseBase(_this2, _request$5)[_request$5].registerToken(subscriptionData); + _classPrivateFieldLooseBase(this, _request$5)[_request$5].registerToken(subscriptionData); - _classPrivateFieldLooseBase(_this2, _logger$8)[_logger$8].info('Safari Web Push registered. Device Token: ' + subscription.deviceToken); + _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].info('Safari Web Push registered. Device Token: ' + subscription.deviceToken); } else if (subscription.permission === 'denied') { - _classPrivateFieldLooseBase(_this2, _logger$8)[_logger$8].info('Error subscribing to Safari web push'); + _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].info('Error subscribing to Safari web push'); } }); } }; var _setUpChromeFirefoxNotifications2 = function _setUpChromeFirefoxNotifications2(subscriptionCallback, serviceWorkerPath) { - var _this3 = this; - - var registrationScope = ''; + let registrationScope = ''; if ('serviceWorker' in navigator) { - navigator.serviceWorker.register(serviceWorkerPath).then(function (registration) { + navigator.serviceWorker.register(serviceWorkerPath).then(registration => { if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved. // hence add a timeout and hope serviceWroker is ready within that time. - return new Promise(function (resolve) { - return setTimeout(function () { - return resolve(registration); - }, 5000); - }); + return new Promise(resolve => setTimeout(() => resolve(registration), 5000)); } registrationScope = registration.scope; // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS // OR getRegistrations PROMISE IF ITS FIREFOX - var rootDirRegex = /^(\.?)(\/?)([^/]*).js$/; - var isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath); + const rootDirRegex = /^(\.?)(\/?)([^/]*).js$/; + const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath); if (isServiceWorkerAtRoot) { return navigator.serviceWorker.ready; } else { if (navigator.userAgent.indexOf('Chrome') !== -1) { - return new Promise(function (resolve) { - return setTimeout(function () { - return resolve(registration); - }, 5000); - }); + return new Promise(resolve => setTimeout(() => resolve(registration), 5000)); } else { return navigator.serviceWorker.getRegistrations(); } } - }).then(function (serviceWorkerRegistration) { + }).then(serviceWorkerRegistration => { // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) { - serviceWorkerRegistration = serviceWorkerRegistration.filter(function (i) { - return i.scope === registrationScope; - })[0]; + serviceWorkerRegistration = serviceWorkerRegistration.filter(i => i.scope === registrationScope)[0]; } - var subscribeObj = { + const subscribeObj = { userVisibleOnly: true }; - if (_classPrivateFieldLooseBase(_this3, _fcmPublicKey)[_fcmPublicKey] != null) { - subscribeObj.applicationServerKey = urlBase64ToUint8Array(_classPrivateFieldLooseBase(_this3, _fcmPublicKey)[_fcmPublicKey]); + if (_classPrivateFieldLooseBase(this, _fcmPublicKey)[_fcmPublicKey] != null) { + subscribeObj.applicationServerKey = urlBase64ToUint8Array(_classPrivateFieldLooseBase(this, _fcmPublicKey)[_fcmPublicKey]); } - serviceWorkerRegistration.pushManager.subscribe(subscribeObj).then(function (subscription) { - _classPrivateFieldLooseBase(_this3, _logger$8)[_logger$8].info('Service Worker registered. Endpoint: ' + subscription.endpoint); // convert the subscription keys to strings; this sets it up nicely for pushing to LC + serviceWorkerRegistration.pushManager.subscribe(subscribeObj).then(subscription => { + _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].info('Service Worker registered. Endpoint: ' + subscription.endpoint); // convert the subscription keys to strings; this sets it up nicely for pushing to LC - var subscriptionData = JSON.parse(JSON.stringify(subscription)); // remove the common chrome/firefox endpoint at the beginning of the token + const subscriptionData = JSON.parse(JSON.stringify(subscription)); // remove the common chrome/firefox endpoint at the beginning of the token if (navigator.userAgent.indexOf('Chrome') !== -1) { subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop(); @@ -7140,35 +6688,35 @@ StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData); - _classPrivateFieldLooseBase(_this3, _request$5)[_request$5].registerToken(subscriptionData); + _classPrivateFieldLooseBase(this, _request$5)[_request$5].registerToken(subscriptionData); if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') { subscriptionCallback(); } - }).catch(function (error) { - _classPrivateFieldLooseBase(_this3, _logger$8)[_logger$8].error('Error subscribing: ' + error); // unsubscribe from webpush if error + }).catch(error => { + _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].error('Error subscribing: ' + error); // unsubscribe from webpush if error - serviceWorkerRegistration.pushManager.getSubscription().then(function (subscription) { + serviceWorkerRegistration.pushManager.getSubscription().then(subscription => { if (subscription !== null) { - subscription.unsubscribe().then(function (successful) { + subscription.unsubscribe().then(successful => { // You've successfully unsubscribed - _classPrivateFieldLooseBase(_this3, _logger$8)[_logger$8].info('Unsubscription successful'); - }).catch(function (e) { + _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].info('Unsubscription successful'); + }).catch(e => { // Unsubscription failed - _classPrivateFieldLooseBase(_this3, _logger$8)[_logger$8].error('Error unsubscribing: ' + e); + _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].error('Error unsubscribing: ' + e); }); } }); }); - }).catch(function (err) { - _classPrivateFieldLooseBase(_this3, _logger$8)[_logger$8].error('error registering service worker: ' + err); + }).catch(err => { + _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].error('error registering service worker: ' + err); }); } }; var _addWizAlertJS2 = function _addWizAlertJS2() { - var scriptTag = document.createElement('script'); + const scriptTag = document.createElement('script'); scriptTag.setAttribute('type', 'text/javascript'); scriptTag.setAttribute('id', 'wzrk-alert-js'); scriptTag.setAttribute('src', _classPrivateFieldLooseBase(this, _wizAlertJSPath)[_wizAlertJSPath]); // add the script tag to the end of the body @@ -7178,33 +6726,31 @@ }; var _removeWizAlertJS2 = function _removeWizAlertJS2() { - var scriptTag = document.getElementById('wzrk-alert-js'); + const scriptTag = document.getElementById('wzrk-alert-js'); scriptTag.parentNode.removeChild(scriptTag); }; var _handleNotificationRegistration2 = function _handleNotificationRegistration2(displayArgs) { - var _this4 = this; - // make sure everything is specified - var titleText; - var bodyText; - var okButtonText; - var rejectButtonText; - var okButtonColor; - var skipDialog; - var askAgainTimeInSeconds; - var okCallback; - var rejectCallback; - var subscriptionCallback; - var serviceWorkerPath; - var httpsPopupPath; - var httpsIframePath; - var apnsWebPushId; - var apnsWebPushServiceUrl; + let titleText; + let bodyText; + let okButtonText; + let rejectButtonText; + let okButtonColor; + let skipDialog; + let askAgainTimeInSeconds; + let okCallback; + let rejectCallback; + let subscriptionCallback; + let serviceWorkerPath; + let httpsPopupPath; + let httpsIframePath; + let apnsWebPushId; + let apnsWebPushServiceUrl; if (displayArgs.length === 1) { if (isObject(displayArgs[0])) { - var notifObj = displayArgs[0]; + const notifObj = displayArgs[0]; titleText = notifObj.titleText; bodyText = notifObj.bodyText; okButtonText = notifObj.okButtonText; @@ -7244,7 +6790,7 @@ return; } - var isHTTP = httpsPopupPath != null && httpsIframePath != null; // make sure the site is on https for chrome notifications + const isHTTP = httpsPopupPath != null && httpsIframePath != null; // make sure the site is on https for chrome notifications if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) { _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].error('Make sure you are https or localhost to register for notifications'); @@ -7254,19 +6800,19 @@ if (navigator.userAgent.indexOf('Chrome') !== -1) { - var chromeAgent = navigator.userAgent.match(/Chrome\/(\d+)/); + const chromeAgent = navigator.userAgent.match(/Chrome\/(\d+)/); if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return; } } else if (navigator.userAgent.indexOf('Firefox') !== -1) { - var firefoxAgent = navigator.userAgent.match(/Firefox\/(\d+)/); + const firefoxAgent = navigator.userAgent.match(/Firefox\/(\d+)/); if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return; } } else if (navigator.userAgent.indexOf('Safari') !== -1) { - var safariAgent = navigator.userAgent.match(/Safari\/(\d+)/); + const safariAgent = navigator.userAgent.match(/Safari\/(\d+)/); if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return; @@ -7312,7 +6858,7 @@ } // make sure the user isn't asked for notifications more than askAgainTimeInSeconds - var now = new Date().getTime() / 1000; + const now = new Date().getTime() / 1000; if (StorageManager.getMetaProp('notif_last_time') == null) { StorageManager.setMetaProp('notif_last_time', now); @@ -7332,13 +6878,13 @@ if (isHTTP) { // add the https iframe - var httpsIframe = document.createElement('iframe'); + const httpsIframe = document.createElement('iframe'); httpsIframe.setAttribute('style', 'display:none;'); httpsIframe.setAttribute('src', httpsIframePath); document.body.appendChild(httpsIframe); - window.addEventListener('message', function (event) { + window.addEventListener('message', event => { if (event.data != null) { - var obj = {}; + let obj = {}; try { obj = JSON.parse(event.data); @@ -7349,7 +6895,7 @@ if (obj.state != null) { if (obj.from === 'ct' && obj.state === 'not') { - _classPrivateFieldLooseBase(_this4, _addWizAlertJS)[_addWizAlertJS]().onload = function () { + _classPrivateFieldLooseBase(this, _addWizAlertJS)[_addWizAlertJS]().onload = () => { // create our wizrocket popup window.wzrkPermissionPopup.wizAlert({ title: titleText, @@ -7357,7 +6903,7 @@ confirmButtonText: okButtonText, confirmButtonColor: okButtonColor, rejectButtonText: rejectButtonText - }, function (enabled) { + }, enabled => { // callback function if (enabled) { // the user accepted on the dialog box @@ -7373,7 +6919,7 @@ } } - _classPrivateFieldLooseBase(_this4, _removeWizAlertJS)[_removeWizAlertJS](); + _classPrivateFieldLooseBase(this, _removeWizAlertJS)[_removeWizAlertJS](); }); }; } @@ -7381,7 +6927,7 @@ } }, false); } else { - _classPrivateFieldLooseBase(this, _addWizAlertJS)[_addWizAlertJS]().onload = function () { + _classPrivateFieldLooseBase(this, _addWizAlertJS)[_addWizAlertJS]().onload = () => { // create our wizrocket popup window.wzrkPermissionPopup.wizAlert({ title: titleText, @@ -7389,7 +6935,7 @@ confirmButtonText: okButtonText, confirmButtonColor: okButtonColor, rejectButtonText: rejectButtonText - }, function (enabled) { + }, enabled => { // callback function if (enabled) { // the user accepted on the dialog box @@ -7397,14 +6943,14 @@ okCallback(); } - _classPrivateFieldLooseBase(_this4, _setUpWebPushNotifications)[_setUpWebPushNotifications](subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl); + _classPrivateFieldLooseBase(this, _setUpWebPushNotifications)[_setUpWebPushNotifications](subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl); } else { if (typeof rejectCallback === 'function') { rejectCallback(); } } - _classPrivateFieldLooseBase(_this4, _removeWizAlertJS)[_removeWizAlertJS](); + _classPrivateFieldLooseBase(this, _removeWizAlertJS)[_removeWizAlertJS](); }); }; } @@ -7412,7 +6958,7 @@ var _variableStore = _classPrivateFieldLooseKey("variableStore"); - var Variable = /*#__PURE__*/function () { + class Variable { /** * Creates an instance of the Variable class. * @@ -7425,11 +6971,10 @@ * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally). * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes. */ - function Variable(_ref) { - var variableStore = _ref.variableStore; - - _classCallCheck(this, Variable); - + constructor(_ref) { + let { + variableStore + } = _ref; Object.defineProperty(this, _variableStore, { writable: true, value: void 0 @@ -7443,151 +6988,138 @@ _classPrivateFieldLooseBase(this, _variableStore)[_variableStore] = variableStore; } - _createClass(Variable, [{ - key: "getValue", - value: function getValue() { - return this.value; - } - }, { - key: "getdefaultValue", - value: function getdefaultValue() { - return this.defaultValue; + getValue() { + return this.value; + } + + getdefaultValue() { + return this.defaultValue; + } + /** + * Defines a new variable with the provided name, default value, and variable store. + * @static + * @param {string} name - The name of the variable. + * @param {*} defaultValue - The default value of the variable. + * @param {VariableStore} variableStore - The VariableStore instance for registration. + * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided. + */ + + + static define(name, defaultValue, variableStore) { + if (!name || typeof name !== 'string') { + console.error('Empty or invalid name parameter provided.'); + return null; } - /** - * Defines a new variable with the provided name, default value, and variable store. - * @static - * @param {string} name - The name of the variable. - * @param {*} defaultValue - The default value of the variable. - * @param {VariableStore} variableStore - The VariableStore instance for registration. - * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided. - */ - }, { - key: "update", + if (name.startsWith('.') || name.endsWith('.')) { + console.error('Variable name starts or ends with a `.` which is not allowed: ' + name); + return null; + } - /** - * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true. - * @param {*} newValue - The new value to be assigned to the variable. - */ - value: function update(newValue) { - var oldValue = this.value; - this.value = newValue; + const typeOfDefaultValue = typeof defaultValue; - if (newValue === null && oldValue === null) { - return; - } + if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') { + console.error('Only primitive types (string, number, boolean) are accepted as value'); + return null; + } - if (newValue !== null && newValue === oldValue && this.hadStarted) { - return; - } + const existing = variableStore.getVariable(name); - if (_classPrivateFieldLooseBase(this, _variableStore)[_variableStore].hasVarsRequestCompleted()) { - this.hadStarted = true; - this.triggerValueChanged(); - } + if (existing) { + return existing; } - /** - * Invokes all registered callbacks when the variable value changes. - */ - }, { - key: "triggerValueChanged", - value: function triggerValueChanged() { - var _this = this; + const varInstance = new Variable({ + variableStore + }); - this.valueChangedCallbacks.forEach(function (onValueChanged) { - onValueChanged(_this); - }); + try { + varInstance.name = name; + varInstance.defaultValue = defaultValue; + varInstance.value = defaultValue; + varInstance.type = typeOfDefaultValue; + variableStore.registerVariable(varInstance); + varInstance.update(defaultValue); + } catch (error) { + console.error(error); } - /** - * Adds a callback function to the array and triggers it immediately if variable requests have completed. - * @param {Function} onValueChanged - The callback function to be added. - */ - }, { - key: "addValueChangedCallback", - value: function addValueChangedCallback(onValueChanged) { - if (!onValueChanged) { - console.log('Invalid callback parameter provided.'); - return; - } + return varInstance; + } + /** + * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true. + * @param {*} newValue - The new value to be assigned to the variable. + */ + - this.valueChangedCallbacks.push(onValueChanged); + update(newValue) { + const oldValue = this.value; + this.value = newValue; - if (_classPrivateFieldLooseBase(this, _variableStore)[_variableStore].hasVarsRequestCompleted()) { - onValueChanged(this); - } + if (newValue === null && oldValue === null) { + return; } - /** - * Removes a callback function from the array. - * @param {Function} onValueChanged - The callback function to be removed. - */ - - }, { - key: "removeValueChangedCallback", - value: function removeValueChangedCallback(onValueChanged) { - var index = this.valueChangedCallbacks.indexOf(onValueChanged); - if (index !== -1) { - this.valueChangedCallbacks.splice(index, 1); - } + if (newValue !== null && newValue === oldValue && this.hadStarted) { + return; } - /** - * Resets the `hadStarted` flag to false. - */ - }, { - key: "clearStartFlag", - value: function clearStartFlag() { - this.hadStarted = false; + if (_classPrivateFieldLooseBase(this, _variableStore)[_variableStore].hasVarsRequestCompleted()) { + this.hadStarted = true; + this.triggerValueChanged(); } - }], [{ - key: "define", - value: function define(name, defaultValue, variableStore) { - if (!name || typeof name !== 'string') { - console.error('Empty or invalid name parameter provided.'); - return null; - } + } + /** + * Invokes all registered callbacks when the variable value changes. + */ - if (name.startsWith('.') || name.endsWith('.')) { - console.error('Variable name starts or ends with a `.` which is not allowed: ' + name); - return null; - } - var typeOfDefaultValue = _typeof(defaultValue); + triggerValueChanged() { + this.valueChangedCallbacks.forEach(onValueChanged => { + onValueChanged(this); + }); + } + /** + * Adds a callback function to the array and triggers it immediately if variable requests have completed. + * @param {Function} onValueChanged - The callback function to be added. + */ - if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') { - console.error('Only primitive types (string, number, boolean) are accepted as value'); - return null; - } - var existing = variableStore.getVariable(name); + addValueChangedCallback(onValueChanged) { + if (!onValueChanged) { + console.log('Invalid callback parameter provided.'); + return; + } - if (existing) { - return existing; - } + this.valueChangedCallbacks.push(onValueChanged); - var varInstance = new Variable({ - variableStore: variableStore - }); + if (_classPrivateFieldLooseBase(this, _variableStore)[_variableStore].hasVarsRequestCompleted()) { + onValueChanged(this); + } + } + /** + * Removes a callback function from the array. + * @param {Function} onValueChanged - The callback function to be removed. + */ - try { - varInstance.name = name; - varInstance.defaultValue = defaultValue; - varInstance.value = defaultValue; - varInstance.type = typeOfDefaultValue; - variableStore.registerVariable(varInstance); - varInstance.update(defaultValue); - } catch (error) { - console.error(error); - } - return varInstance; + removeValueChangedCallback(onValueChanged) { + const index = this.valueChangedCallbacks.indexOf(onValueChanged); + + if (index !== -1) { + this.valueChangedCallbacks.splice(index, 1); } - }]); + } + /** + * Resets the `hadStarted` flag to false. + */ + + + clearStartFlag() { + this.hadStarted = false; + } - return Variable; - }(); + } var _logger$9 = _classPrivateFieldLooseKey("logger"); @@ -7611,15 +7143,14 @@ var _runVariablesChangedCallback = _classPrivateFieldLooseKey("runVariablesChangedCallback"); - var VariableStore = /*#__PURE__*/function () { - function VariableStore(_ref) { - var logger = _ref.logger, - request = _ref.request, - account = _ref.account, - event = _ref.event; - - _classCallCheck(this, VariableStore); - + class VariableStore { + constructor(_ref) { + let { + logger, + request, + account, + event + } = _ref; Object.defineProperty(this, _runVariablesChangedCallback, { value: _runVariablesChangedCallback2 }); @@ -7679,211 +7210,178 @@ */ - _createClass(VariableStore, [{ - key: "registerVariable", - value: function registerVariable(varInstance) { - var name = varInstance.name; - _classPrivateFieldLooseBase(this, _variables)[_variables][name] = varInstance; - console.log('registerVariable', _classPrivateFieldLooseBase(this, _variables)[_variables]); - } - /** - * Retrieves a variable by its name. - * @param {string} name - The name of the variable to retrieve. - * @returns {Object} - The variable instance. - */ + registerVariable(varInstance) { + const { + name + } = varInstance; + _classPrivateFieldLooseBase(this, _variables)[_variables][name] = varInstance; + console.log('registerVariable', _classPrivateFieldLooseBase(this, _variables)[_variables]); + } + /** + * Retrieves a variable by its name. + * @param {string} name - The name of the variable to retrieve. + * @returns {Object} - The variable instance. + */ - }, { - key: "getVariable", - value: function getVariable(name) { - return _classPrivateFieldLooseBase(this, _variables)[_variables][name]; - } - }, { - key: "hasVarsRequestCompleted", - value: function hasVarsRequestCompleted() { - return _classPrivateFieldLooseBase(this, _hasVarsRequestCompleted)[_hasVarsRequestCompleted]; - } - /** - * Synchronizes variables with the server. - * @param {Function} onSyncSuccess - Callback function on successful synchronization. - * @param {Function} onSyncFailure - Callback function on synchronization failure. - * @throws Will throw an error if the account token is missing. - * @returns {Promise} - The result of the synchronization request. - */ - }, { - key: "syncVariables", - value: function syncVariables(onSyncSuccess, onSyncFailure) { - var _this = this; + getVariable(name) { + return _classPrivateFieldLooseBase(this, _variables)[_variables][name]; + } + + hasVarsRequestCompleted() { + return _classPrivateFieldLooseBase(this, _hasVarsRequestCompleted)[_hasVarsRequestCompleted]; + } + /** + * Synchronizes variables with the server. + * @param {Function} onSyncSuccess - Callback function on successful synchronization. + * @param {Function} onSyncFailure - Callback function on synchronization failure. + * @throws Will throw an error if the account token is missing. + * @returns {Promise} - The result of the synchronization request. + */ + - if (!_classPrivateFieldLooseBase(this, _account$5)[_account$5].token) { - var m = 'Account token is missing.'; + syncVariables(onSyncSuccess, onSyncFailure) { + if (!_classPrivateFieldLooseBase(this, _account$5)[_account$5].token) { + const m = 'Account token is missing.'; - _classPrivateFieldLooseBase(this, _logger$9)[_logger$9].error(m); + _classPrivateFieldLooseBase(this, _logger$9)[_logger$9].error(m); - return Promise.reject(new Error(m)); - } + return Promise.reject(new Error(m)); + } + + const payload = { + type: 'varsPayload', + vars: {} + }; - var payload = { - type: 'varsPayload', - vars: {} + for (const name in _classPrivateFieldLooseBase(this, _variables)[_variables]) { + payload.vars[name] = { + defaultValue: _classPrivateFieldLooseBase(this, _variables)[_variables][name].defaultValue, + type: _classPrivateFieldLooseBase(this, _variables)[_variables][name].type }; + } // Check if payload.vars is empty - for (var name in _classPrivateFieldLooseBase(this, _variables)[_variables]) { - payload.vars[name] = { - defaultValue: _classPrivateFieldLooseBase(this, _variables)[_variables][name].defaultValue, - type: _classPrivateFieldLooseBase(this, _variables)[_variables][name].type - }; - } // Check if payload.vars is empty + if (Object.keys(payload.vars).length === 0) { + const m = 'No variables are defined.'; + + _classPrivateFieldLooseBase(this, _logger$9)[_logger$9].error(m); + + return Promise.reject(new Error(m)); + } - if (Object.keys(payload.vars).length === 0) { - var _m = 'No variables are defined.'; + let meta = {}; + meta = _classPrivateFieldLooseBase(this, _request$6)[_request$6].addSystemDataToObject(meta, undefined); + meta.tk = _classPrivateFieldLooseBase(this, _account$5)[_account$5].token; + meta.type = 'meta'; + const body = JSON.stringify([meta, payload]); - _classPrivateFieldLooseBase(this, _logger$9)[_logger$9].error(_m); + const url = _classPrivateFieldLooseBase(this, _account$5)[_account$5].dataPostPEURL; - return Promise.reject(new Error(_m)); + return _classPrivateFieldLooseBase(this, _request$6)[_request$6].post(url, body).then(r => { + if (onSyncSuccess && typeof onSyncSuccess === 'function') { + onSyncSuccess(r); } - var meta = {}; - meta = _classPrivateFieldLooseBase(this, _request$6)[_request$6].addSystemDataToObject(meta, undefined); - meta.tk = _classPrivateFieldLooseBase(this, _account$5)[_account$5].token; - meta.type = 'meta'; - var body = JSON.stringify([meta, payload]); + return r; + }).catch(e => { + if (onSyncFailure && typeof onSyncFailure === 'function') { + onSyncFailure(e); + } - var url = _classPrivateFieldLooseBase(this, _account$5)[_account$5].dataPostPEURL; + if (e.status === 400) { + _classPrivateFieldLooseBase(this, _logger$9)[_logger$9].error('Invalid sync payload or clear the existing draft'); + } else if (e.status === 401) { + _classPrivateFieldLooseBase(this, _logger$9)[_logger$9].error('This is not a test profile'); + } else { + _classPrivateFieldLooseBase(this, _logger$9)[_logger$9].error('Sync variable failed'); + } - return _classPrivateFieldLooseBase(this, _request$6)[_request$6].post(url, body).then(function (r) { - if (onSyncSuccess && typeof onSyncSuccess === 'function') { - onSyncSuccess(r); - } + throw e; + }); + } + /** + * Fetches variables from the server. + * @param {Function} onFetchCallback - Callback function on fetch completion. + */ - return r; - }).catch(function (e) { - if (onSyncFailure && typeof onSyncFailure === 'function') { - onSyncFailure(e); - } - if (e.status === 400) { - _classPrivateFieldLooseBase(_this, _logger$9)[_logger$9].error('Invalid sync payload or clear the existing draft'); - } else if (e.status === 401) { - _classPrivateFieldLooseBase(_this, _logger$9)[_logger$9].error('This is not a test profile'); - } else { - _classPrivateFieldLooseBase(_this, _logger$9)[_logger$9].error('Sync variable failed'); - } + fetchVariables(onFetchCallback) { + _classPrivateFieldLooseBase(this, _event)[_event].push(WZRK_FETCH, { + t: 4 + }); - throw e; - }); + if (onFetchCallback && typeof onFetchCallback === 'function') { + _classPrivateFieldLooseBase(this, _fetchCallback)[_fetchCallback] = onFetchCallback; } - /** - * Fetches variables from the server. - * @param {Function} onFetchCallback - Callback function on fetch completion. - */ + } - }, { - key: "fetchVariables", - value: function fetchVariables(onFetchCallback) { - _classPrivateFieldLooseBase(this, _event)[_event].push(WZRK_FETCH, { - t: 4 - }); + mergeVariables(vars) { + console.log('msg vars is ', vars); + _classPrivateFieldLooseBase(this, _hasVarsRequestCompleted)[_hasVarsRequestCompleted] = true; + StorageManager.saveToLSorCookie(VARIABLES, vars); + _classPrivateFieldLooseBase(this, _remoteVariables)[_remoteVariables] = vars; - if (onFetchCallback && typeof onFetchCallback === 'function') { - _classPrivateFieldLooseBase(this, _fetchCallback)[_fetchCallback] = onFetchCallback; + for (const name in _classPrivateFieldLooseBase(this, _variables)[_variables]) { + if (vars.hasOwnProperty(name)) { + _classPrivateFieldLooseBase(this, _variables)[_variables][name].update(vars[name]); } } - }, { - key: "mergeVariables", - value: function mergeVariables(vars) { - console.log('msg vars is ', vars); - _classPrivateFieldLooseBase(this, _hasVarsRequestCompleted)[_hasVarsRequestCompleted] = true; - StorageManager.saveToLSorCookie(VARIABLES, vars); - _classPrivateFieldLooseBase(this, _remoteVariables)[_remoteVariables] = vars; - for (var name in _classPrivateFieldLooseBase(this, _variables)[_variables]) { - if (vars.hasOwnProperty(name)) { - _classPrivateFieldLooseBase(this, _variables)[_variables][name].update(vars[name]); - } - } + if (_classPrivateFieldLooseBase(this, _fetchCallback)[_fetchCallback]) { + _classPrivateFieldLooseBase(this, _fetchCallback)[_fetchCallback](); + } - if (_classPrivateFieldLooseBase(this, _fetchCallback)[_fetchCallback]) { - _classPrivateFieldLooseBase(this, _fetchCallback)[_fetchCallback](); - } + _classPrivateFieldLooseBase(this, _runVariablesChangedCallback)[_runVariablesChangedCallback](); + } - _classPrivateFieldLooseBase(this, _runVariablesChangedCallback)[_runVariablesChangedCallback](); - } - }, { - key: "addVariablesChangedCallback", - value: function addVariablesChangedCallback(callback) { - if (callback && typeof callback === 'function') { - _classPrivateFieldLooseBase(this, _variablesChangedCallbacks)[_variablesChangedCallbacks].push(callback); + addVariablesChangedCallback(callback) { + if (callback && typeof callback === 'function') { + _classPrivateFieldLooseBase(this, _variablesChangedCallbacks)[_variablesChangedCallbacks].push(callback); - if (this.hasVarsRequestCompleted()) { - callback(); - } - } else { - _classPrivateFieldLooseBase(this, _logger$9)[_logger$9].error('callback is not a function'); - } - } - }, { - key: "addOneTimeVariablesChangedCallback", - value: function addOneTimeVariablesChangedCallback(callback) { - if (callback && typeof callback === 'function') { - if (this.hasVarsRequestCompleted()) { - callback(); - } else { - _classPrivateFieldLooseBase(this, _oneTimeVariablesChangedCallbacks)[_oneTimeVariablesChangedCallbacks].push(callback); - } + if (this.hasVarsRequestCompleted()) { + callback(); } + } else { + _classPrivateFieldLooseBase(this, _logger$9)[_logger$9].error('callback is not a function'); } - }, { - key: "removeVariablesChangedCallback", - value: function removeVariablesChangedCallback(callback) { - var index = _classPrivateFieldLooseBase(this, _variablesChangedCallbacks)[_variablesChangedCallbacks].indexOf(callback); + } - if (index !== -1) { - _classPrivateFieldLooseBase(this, _variablesChangedCallbacks)[_variablesChangedCallbacks].splice(index, 1); + addOneTimeVariablesChangedCallback(callback) { + if (callback && typeof callback === 'function') { + if (this.hasVarsRequestCompleted()) { + callback(); + } else { + _classPrivateFieldLooseBase(this, _oneTimeVariablesChangedCallbacks)[_oneTimeVariablesChangedCallbacks].push(callback); } } - }, { - key: "removeOneTimeVariablesChangedCallback", - value: function removeOneTimeVariablesChangedCallback(callback) { - var index = _classPrivateFieldLooseBase(this, _oneTimeVariablesChangedCallbacks)[_oneTimeVariablesChangedCallbacks].indexOf(callback); + } - if (index !== -1) { - _classPrivateFieldLooseBase(this, _oneTimeVariablesChangedCallbacks)[_oneTimeVariablesChangedCallbacks].splice(index, 1); - } - } - }]); + removeVariablesChangedCallback(callback) { + const index = _classPrivateFieldLooseBase(this, _variablesChangedCallbacks)[_variablesChangedCallbacks].indexOf(callback); - return VariableStore; - }(); + if (index !== -1) { + _classPrivateFieldLooseBase(this, _variablesChangedCallbacks)[_variablesChangedCallbacks].splice(index, 1); + } + } - var _runVariablesChangedCallback2 = function _runVariablesChangedCallback2() { - var _iterator = _createForOfIteratorHelper(_classPrivateFieldLooseBase(this, _variablesChangedCallbacks)[_variablesChangedCallbacks]), - _step; + removeOneTimeVariablesChangedCallback(callback) { + const index = _classPrivateFieldLooseBase(this, _oneTimeVariablesChangedCallbacks)[_oneTimeVariablesChangedCallbacks].indexOf(callback); - try { - for (_iterator.s(); !(_step = _iterator.n()).done;) { - var callback = _step.value; - callback(); + if (index !== -1) { + _classPrivateFieldLooseBase(this, _oneTimeVariablesChangedCallbacks)[_oneTimeVariablesChangedCallbacks].splice(index, 1); } - } catch (err) { - _iterator.e(err); - } finally { - _iterator.f(); } - var _iterator2 = _createForOfIteratorHelper(_classPrivateFieldLooseBase(this, _oneTimeVariablesChangedCallbacks)[_oneTimeVariablesChangedCallbacks]), - _step2; + } - try { - for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { - var callBack = _step2.value; - callBack(); - } - } catch (err) { - _iterator2.e(err); - } finally { - _iterator2.f(); + var _runVariablesChangedCallback2 = function _runVariablesChangedCallback2() { + for (var callback of _classPrivateFieldLooseBase(this, _variablesChangedCallbacks)[_variablesChangedCallbacks]) { + callback(); + } + + for (var callBack of _classPrivateFieldLooseBase(this, _oneTimeVariablesChangedCallbacks)[_oneTimeVariablesChangedCallbacks]) { + callBack(); } _classPrivateFieldLooseBase(this, _oneTimeVariablesChangedCallbacks)[_oneTimeVariablesChangedCallbacks].length = 0; @@ -7925,50 +7423,40 @@ var _overrideDSyncFlag = _classPrivateFieldLooseKey("overrideDSyncFlag"); - var CleverTap = /*#__PURE__*/function () { - _createClass(CleverTap, [{ - key: "spa", - get: function get() { - return _classPrivateFieldLooseBase(this, _isSpa)[_isSpa]; - }, - set: function set(value) { - var isSpa = value === true; + class CleverTap { + get spa() { + return _classPrivateFieldLooseBase(this, _isSpa)[_isSpa]; + } - if (_classPrivateFieldLooseBase(this, _isSpa)[_isSpa] !== isSpa && _classPrivateFieldLooseBase(this, _onloadcalled)[_onloadcalled] === 1) { - // if clevertap.spa is changed after init has been called then update the click listeners - if (isSpa) { - document.addEventListener('click', _classPrivateFieldLooseBase(this, _boundCheckPageChanged)[_boundCheckPageChanged]); - } else { - document.removeEventListener('click', _classPrivateFieldLooseBase(this, _boundCheckPageChanged)[_boundCheckPageChanged]); - } - } + set spa(value) { + const isSpa = value === true; - _classPrivateFieldLooseBase(this, _isSpa)[_isSpa] = isSpa; - } - }, { - key: "dismissSpamControl", - get: function get() { - return _classPrivateFieldLooseBase(this, _dismissSpamControl)[_dismissSpamControl]; - }, - set: function set(value) { - var dismissSpamControl = value === true; - _classPrivateFieldLooseBase(this, _dismissSpamControl)[_dismissSpamControl] = dismissSpamControl; - $ct.dismissSpamControl = dismissSpamControl; + if (_classPrivateFieldLooseBase(this, _isSpa)[_isSpa] !== isSpa && _classPrivateFieldLooseBase(this, _onloadcalled)[_onloadcalled] === 1) { + // if clevertap.spa is changed after init has been called then update the click listeners + if (isSpa) { + document.addEventListener('click', _classPrivateFieldLooseBase(this, _boundCheckPageChanged)[_boundCheckPageChanged]); + } else { + document.removeEventListener('click', _classPrivateFieldLooseBase(this, _boundCheckPageChanged)[_boundCheckPageChanged]); + } } - }]); - function CleverTap() { - var _clevertap$account, - _clevertap$account2, - _clevertap$account3, - _clevertap$account4, - _this = this, - _clevertap$account5; + _classPrivateFieldLooseBase(this, _isSpa)[_isSpa] = isSpa; + } + + get dismissSpamControl() { + return _classPrivateFieldLooseBase(this, _dismissSpamControl)[_dismissSpamControl]; + } - var clevertap = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + set dismissSpamControl(value) { + const dismissSpamControl = value === true; + _classPrivateFieldLooseBase(this, _dismissSpamControl)[_dismissSpamControl] = dismissSpamControl; + $ct.dismissSpamControl = dismissSpamControl; + } - _classCallCheck(this, CleverTap); + constructor() { + var _clevertap$account, _clevertap$account2, _clevertap$account3, _clevertap$account4, _clevertap$account5; + let clevertap = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; Object.defineProperty(this, _overrideDSyncFlag, { value: _overrideDSyncFlag2 }); @@ -8041,7 +7529,7 @@ _classPrivateFieldLooseBase(this, _onloadcalled)[_onloadcalled] = 0; this._isPersonalisationActive = this._isPersonalisationActive.bind(this); - this.raiseNotificationClicked = function () {}; + this.raiseNotificationClicked = () => {}; _classPrivateFieldLooseBase(this, _logger$a)[_logger$a] = new Logger(logLevels.INFO); _classPrivateFieldLooseBase(this, _account$6)[_account$6] = new Account((_clevertap$account = clevertap.account) === null || _clevertap$account === void 0 ? void 0 : _clevertap$account[0], clevertap.region || ((_clevertap$account2 = clevertap.account) === null || _clevertap$account2 === void 0 ? void 0 : _clevertap$account2[1]), clevertap.targetDomain || ((_clevertap$account3 = clevertap.account) === null || _clevertap$account3 === void 0 ? void 0 : _clevertap$account3[2]), clevertap.token || ((_clevertap$account4 = clevertap.account) === null || _clevertap$account4 === void 0 ? void 0 : _clevertap$account4[3])); @@ -8107,54 +7595,56 @@ isPersonalisationActive: this._isPersonalisationActive }); this.session = { - getTimeElapsed: function getTimeElapsed() { - return _classPrivateFieldLooseBase(_this, _session$3)[_session$3].getTimeElapsed(); + getTimeElapsed: () => { + return _classPrivateFieldLooseBase(this, _session$3)[_session$3].getTimeElapsed(); }, - getPageCount: function getPageCount() { - return _classPrivateFieldLooseBase(_this, _session$3)[_session$3].getPageCount(); + getPageCount: () => { + return _classPrivateFieldLooseBase(this, _session$3)[_session$3].getPageCount(); } }; - this.logout = function () { - _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a].debug('logout called'); + this.logout = () => { + _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].debug('logout called'); StorageManager.setInstantDeleteFlagInK(); }; - this.clear = function () { - _this.onUserLogin.clear(); + this.clear = () => { + this.onUserLogin.clear(); }; - this.getCleverTapID = function () { - return _classPrivateFieldLooseBase(_this, _device$3)[_device$3].getGuid(); + this.getCleverTapID = () => { + return _classPrivateFieldLooseBase(this, _device$3)[_device$3].getGuid(); }; - this.getAccountID = function () { - return _classPrivateFieldLooseBase(_this, _account$6)[_account$6].id; + this.getAccountID = () => { + return _classPrivateFieldLooseBase(this, _account$6)[_account$6].id; }; - this.getSCDomain = function () { - return _classPrivateFieldLooseBase(_this, _account$6)[_account$6].finalTargetDomain; + this.getSCDomain = () => { + return _classPrivateFieldLooseBase(this, _account$6)[_account$6].finalTargetDomain; }; - this.setLibrary = function (libName, libVersion) { - $ct.flutterVersion = _defineProperty({}, libName, libVersion); + this.setLibrary = (libName, libVersion) => { + $ct.flutterVersion = { + [libName]: libVersion + }; }; // Set the Signed Call sdk version and fire request - this.setSCSDKVersion = function (ver) { - _classPrivateFieldLooseBase(_this, _account$6)[_account$6].scSDKVersion = ver; - var data = {}; + this.setSCSDKVersion = ver => { + _classPrivateFieldLooseBase(this, _account$6)[_account$6].scSDKVersion = ver; + const data = {}; data.af = { - scv: 'sc-sdk-v' + _classPrivateFieldLooseBase(_this, _account$6)[_account$6].scSDKVersion + scv: 'sc-sdk-v' + _classPrivateFieldLooseBase(this, _account$6)[_account$6].scSDKVersion }; - var pageLoadUrl = _classPrivateFieldLooseBase(_this, _account$6)[_account$6].dataPostURL; + let pageLoadUrl = _classPrivateFieldLooseBase(this, _account$6)[_account$6].dataPostURL; pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page'); - pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a])); + pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$a)[_logger$a])); - _classPrivateFieldLooseBase(_this, _request$7)[_request$7].saveAndFireRequest(pageLoadUrl, $ct.blockRequest); + _classPrivateFieldLooseBase(this, _request$7)[_request$7].saveAndFireRequest(pageLoadUrl, $ct.blockRequest); }; if (hasWebInboxSettingsInLS()) { @@ -8163,53 +7653,53 @@ } // Get Inbox Message Count - this.getInboxMessageCount = function () { - var msgCount = getInboxMessages(); + this.getInboxMessageCount = () => { + const msgCount = getInboxMessages(); return Object.keys(msgCount).length; }; // Get Inbox Unread Message Count - this.getInboxMessageUnreadCount = function () { + this.getInboxMessageUnreadCount = () => { if ($ct.inbox) { return $ct.inbox.unviewedCounter; } else { - _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a].debug('No unread messages'); + _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].debug('No unread messages'); } }; // Get All Inbox messages - this.getAllInboxMessages = function () { + this.getAllInboxMessages = () => { return getInboxMessages(); }; // Get only Unread messages - this.getUnreadInboxMessages = function () { + this.getUnreadInboxMessages = () => { if ($ct.inbox) { return $ct.inbox.unviewedMessages; } else { - _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a].debug('No unread messages'); + _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].debug('No unread messages'); } }; // Get message object belonging to the given message id only. Message id should be a String - this.getInboxMessageForId = function (messageId) { - var messages = getInboxMessages(); + this.getInboxMessageForId = messageId => { + const messages = getInboxMessages(); if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) { return messages[messageId]; } else { - _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a].error('No message available for message Id ' + messageId); + _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].error('No message available for message Id ' + messageId); } }; // Delete message from the Inbox. Message id should be a String // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list // Then remove the message from local storage and update cookie - this.deleteInboxMessage = function (messageId) { - var messages = getInboxMessages(); + this.deleteInboxMessage = messageId => { + const messages = getInboxMessages(); if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) { - var el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId); + const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId); if (messages[messageId].viewed === 0) { $ct.inbox.unviewedCounter--; @@ -8222,7 +7712,7 @@ delete messages[messageId]; saveInboxMessages(messages); } else { - _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a].error('No message available for message Id ' + messageId); + _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].error('No message available for message Id ' + messageId); } }; /* Mark Message as Read. Message id should be a String @@ -8231,12 +7721,12 @@ - renderNotificationViewed */ - this.markReadInboxMessage = function (messageId) { - var unreadMsg = $ct.inbox.unviewedMessages; - var messages = getInboxMessages(); + this.markReadInboxMessage = messageId => { + const unreadMsg = $ct.inbox.unviewedMessages; + const messages = getInboxMessages(); if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) { - var el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId); + const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId); if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none'; @@ -8258,16 +7748,16 @@ delete $ct.inbox.unviewedMessages[messageId]; saveInboxMessages(messages); } else { - _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a].error('No message available for message Id ' + messageId); + _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].error('No message available for message Id ' + messageId); } }; /* Mark Message as Read. messageIds should be a an array of string */ - this.markReadInboxMessagesForIds = function (messageIds) { + this.markReadInboxMessagesForIds = messageIds => { if (Array.isArray(messageIds)) { for (var id = 0; id < messageIds.length; id++) { - _this.markReadInboxMessage(messageIds[id]); + this.markReadInboxMessage(messageIds[id]); } } }; @@ -8277,14 +7767,14 @@ */ - this.markReadAllInboxMessage = function () { - var unreadMsg = $ct.inbox.unviewedMessages; - var messages = getInboxMessages(); + this.markReadAllInboxMessage = () => { + const unreadMsg = $ct.inbox.unviewedMessages; + const messages = getInboxMessages(); if (Object.keys(unreadMsg).length > 0) { - var msgIds = Object.keys(unreadMsg); - msgIds.forEach(function (key) { - var el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key); + const msgIds = Object.keys(unreadMsg); + msgIds.forEach(key => { + const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key); if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none'; @@ -8302,71 +7792,77 @@ $ct.inbox.unviewedCounter = 0; $ct.inbox.unviewedMessages = {}; } else { - _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a].debug('All messages are already read'); + _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].debug('All messages are already read'); } }; - this.toggleInbox = function (e) { + this.toggleInbox = e => { var _$ct$inbox; return (_$ct$inbox = $ct.inbox) === null || _$ct$inbox === void 0 ? void 0 : _$ct$inbox.toggleInbox(e); }; // method for notification viewed - this.renderNotificationViewed = function (detail) { + this.renderNotificationViewed = detail => { processNotificationEvent(NOTIFICATION_VIEWED, detail); }; // method for notification clicked - this.renderNotificationClicked = function (detail) { + this.renderNotificationClicked = detail => { processNotificationEvent(NOTIFICATION_CLICKED, detail); }; - var processNotificationEvent = function processNotificationEvent(eventName, eventDetail) { + const processNotificationEvent = (eventName, eventDetail) => { if (!eventDetail || !eventDetail.msgId) { return; } - var data = {}; + const data = {}; data.type = 'event'; data.evtName = eventName; - data.evtData = _defineProperty({}, WZRK_ID, eventDetail.msgId); + data.evtData = { + [WZRK_ID]: eventDetail.msgId + }; if (eventDetail.pivotId) { - data.evtData = _objectSpread2(_objectSpread2({}, data.evtData), {}, { + data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId - }); + }; } if (eventDetail.wzrk_slideNo) { - data.evtData = _objectSpread2(_objectSpread2({}, data.evtData), {}, { + data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo - }); + }; } // Adding kv pair to event data if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) { - for (var key in eventDetail.kv) { + for (const key in eventDetail.kv) { if (key.startsWith(WZRK_PREFIX)) { - data.evtData = _objectSpread2(_objectSpread2({}, data.evtData), {}, _defineProperty({}, key, eventDetail.kv[key])); + data.evtData = { ...data.evtData, + [key]: eventDetail.kv[key] + }; } } } // Adding msgCTkv to event data if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) { - for (var _key in eventDetail.msgCTkv) { - if (_key.startsWith(WZRK_PREFIX)) { - data.evtData = _objectSpread2(_objectSpread2({}, data.evtData), {}, _defineProperty({}, _key, eventDetail.msgCTkv[_key])); + for (const key in eventDetail.msgCTkv) { + if (key.startsWith(WZRK_PREFIX)) { + data.evtData = { ...data.evtData, + [key]: eventDetail.msgCTkv[key] + }; } } } - _classPrivateFieldLooseBase(_this, _request$7)[_request$7].processEvent(data); + _classPrivateFieldLooseBase(this, _request$7)[_request$7].processEvent(data); }; - this.setLogLevel = function (l) { - _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a].logLevel = Number(l); + this.setLogLevel = l => { + _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].logLevel = Number(l); if (l === 3) { sessionStorage.WZRK_D = ''; @@ -8380,60 +7876,60 @@ */ - this.handleIncrementValue = function (key, value) { - _this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT); + this.handleIncrementValue = (key, value) => { + this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT); }; - this.handleDecrementValue = function (key, value) { - _this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT); + this.handleDecrementValue = (key, value) => { + this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT); }; - this.setMultiValuesForKey = function (key, value) { + this.setMultiValuesForKey = (key, value) => { if (Array.isArray(value)) { - _this.profile._handleMultiValueSet(key, value, COMMAND_SET); + this.profile._handleMultiValueSet(key, value, COMMAND_SET); } else { console.error('setMultiValuesForKey should be called with a value of type array'); } }; - this.addMultiValueForKey = function (key, value) { + this.addMultiValueForKey = (key, value) => { if (typeof value === 'string' || typeof value === 'number') { - _this.profile._handleMultiValueAdd(key, value, COMMAND_ADD); + this.profile._handleMultiValueAdd(key, value, COMMAND_ADD); } else { console.error('addMultiValueForKey should be called with a value of type string or number.'); } }; - this.addMultiValuesForKey = function (key, value) { + this.addMultiValuesForKey = (key, value) => { if (Array.isArray(value)) { - _this.profile._handleMultiValueAdd(key, value, COMMAND_ADD); + this.profile._handleMultiValueAdd(key, value, COMMAND_ADD); } else { console.error('addMultiValuesForKey should be called with a value of type array.'); } }; - this.removeMultiValueForKey = function (key, value) { + this.removeMultiValueForKey = (key, value) => { if (typeof value === 'string' || typeof value === 'number') { - _this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE); + this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE); } else { console.error('removeMultiValueForKey should be called with a value of type string or number.'); } }; - this.removeMultiValuesForKey = function (key, value) { + this.removeMultiValuesForKey = (key, value) => { if (Array.isArray(value)) { - _this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE); + this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE); } else { console.error('removeMultiValuesForKey should be called with a value of type array.'); } }; - this.removeValueForKey = function (key) { - _this.profile._handleMultiValueDelete(key, COMMAND_DELETE); + this.removeValueForKey = key => { + this.profile._handleMultiValueDelete(key, COMMAND_DELETE); }; - var _handleEmailSubscription = function _handleEmailSubscription(subscription, reEncoded, fetchGroups) { - handleEmailSubscription(subscription, reEncoded, fetchGroups, _classPrivateFieldLooseBase(_this, _account$6)[_account$6], _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a]); + const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => { + handleEmailSubscription(subscription, reEncoded, fetchGroups, _classPrivateFieldLooseBase(this, _account$6)[_account$6], _classPrivateFieldLooseBase(this, _logger$a)[_logger$a]); }; /** * @@ -8514,57 +8010,57 @@ } } - var api = _classPrivateFieldLooseBase(this, _api)[_api]; + const api = _classPrivateFieldLooseBase(this, _api)[_api]; api.logout = this.logout; api.clear = this.clear; - api.closeIframe = function (campaignId, divIdIgnored) { - closeIframe(campaignId, divIdIgnored, _classPrivateFieldLooseBase(_this, _session$3)[_session$3].sessionId); + api.closeIframe = (campaignId, divIdIgnored) => { + closeIframe(campaignId, divIdIgnored, _classPrivateFieldLooseBase(this, _session$3)[_session$3].sessionId); }; - api.enableWebPush = function (enabled, applicationServerKey) { - _this.notifications._enableWebPush(enabled, applicationServerKey); + api.enableWebPush = (enabled, applicationServerKey) => { + this.notifications._enableWebPush(enabled, applicationServerKey); }; - api.tr = function (msg) { + api.tr = msg => { _tr(msg, { - device: _classPrivateFieldLooseBase(_this, _device$3)[_device$3], - session: _classPrivateFieldLooseBase(_this, _session$3)[_session$3], - request: _classPrivateFieldLooseBase(_this, _request$7)[_request$7], - logger: _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a] + device: _classPrivateFieldLooseBase(this, _device$3)[_device$3], + session: _classPrivateFieldLooseBase(this, _session$3)[_session$3], + request: _classPrivateFieldLooseBase(this, _request$7)[_request$7], + logger: _classPrivateFieldLooseBase(this, _logger$a)[_logger$a] }); }; - api.setEnum = function (enumVal) { - setEnum(enumVal, _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a]); + api.setEnum = enumVal => { + setEnum(enumVal, _classPrivateFieldLooseBase(this, _logger$a)[_logger$a]); }; - api.is_onloadcalled = function () { - return _classPrivateFieldLooseBase(_this, _onloadcalled)[_onloadcalled] === 1; + api.is_onloadcalled = () => { + return _classPrivateFieldLooseBase(this, _onloadcalled)[_onloadcalled] === 1; }; - api.subEmail = function (reEncoded) { + api.subEmail = reEncoded => { _handleEmailSubscription('1', reEncoded); }; - api.getEmail = function (reEncoded, withGroups) { + api.getEmail = (reEncoded, withGroups) => { _handleEmailSubscription('-1', reEncoded, withGroups); }; - api.unSubEmail = function (reEncoded) { + api.unSubEmail = reEncoded => { _handleEmailSubscription('0', reEncoded); }; - api.unsubEmailGroups = function (reEncoded) { + api.unsubEmailGroups = reEncoded => { $ct.unsubGroups = []; - var elements = document.getElementsByClassName('ct-unsub-group-input-item'); + const elements = document.getElementsByClassName('ct-unsub-group-input-item'); - for (var i = 0; i < elements.length; i++) { - var element = elements[i]; + for (let i = 0; i < elements.length; i++) { + const element = elements[i]; if (element.name) { - var data = { + const data = { name: element.name, isUnsubscribed: element.checked }; @@ -8575,29 +8071,29 @@ _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded); }; - api.setSubscriptionGroups = function (value) { + api.setSubscriptionGroups = value => { $ct.unsubGroups = value; }; - api.getSubscriptionGroups = function () { + api.getSubscriptionGroups = () => { return $ct.unsubGroups; }; - api.changeSubscriptionGroups = function (reEncoded, updatedGroups) { + api.changeSubscriptionGroups = (reEncoded, updatedGroups) => { api.setSubscriptionGroups(updatedGroups); _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded); }; - api.isGlobalUnsubscribe = function () { + api.isGlobalUnsubscribe = () => { return $ct.globalUnsubscribe; }; - api.setIsGlobalUnsubscribe = function (value) { + api.setIsGlobalUnsubscribe = value => { $ct.globalUnsubscribe = value; }; - api.setUpdatedCategoryLong = function (profile) { + api.setUpdatedCategoryLong = profile => { if (profile[categoryLongKey]) { $ct.updatedCategoryLong = profile[categoryLongKey]; } @@ -8614,288 +8110,288 @@ } // starts here - _createClass(CleverTap, [{ - key: "init", - value: function init(accountId, region, targetDomain, token) { - var _this2 = this; + init(accountId, region, targetDomain, token) { + if (_classPrivateFieldLooseBase(this, _onloadcalled)[_onloadcalled] === 1) { + // already initailsed + return; + } + + StorageManager.removeCookie('WZRK_P', window.location.hostname); + + if (!_classPrivateFieldLooseBase(this, _account$6)[_account$6].id) { + if (!accountId) { + _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].error(EMBED_ERROR); - if (_classPrivateFieldLooseBase(this, _onloadcalled)[_onloadcalled] === 1) { - // already initailsed return; } - StorageManager.removeCookie('WZRK_P', window.location.hostname); + _classPrivateFieldLooseBase(this, _account$6)[_account$6].id = accountId; + } - if (!_classPrivateFieldLooseBase(this, _account$6)[_account$6].id) { - if (!accountId) { - _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].error(EMBED_ERROR); + _classPrivateFieldLooseBase(this, _session$3)[_session$3].cookieName = SCOOKIE_PREFIX + '_' + _classPrivateFieldLooseBase(this, _account$6)[_account$6].id; - return; - } + if (region) { + _classPrivateFieldLooseBase(this, _account$6)[_account$6].region = region; + } - _classPrivateFieldLooseBase(this, _account$6)[_account$6].id = accountId; - } + if (targetDomain) { + _classPrivateFieldLooseBase(this, _account$6)[_account$6].targetDomain = targetDomain; + } - _classPrivateFieldLooseBase(this, _session$3)[_session$3].cookieName = SCOOKIE_PREFIX + '_' + _classPrivateFieldLooseBase(this, _account$6)[_account$6].id; + if (token) { + _classPrivateFieldLooseBase(this, _account$6)[_account$6].token = token; + } - if (region) { - _classPrivateFieldLooseBase(this, _account$6)[_account$6].region = region; - } + const currLocation = location.href; + const urlParams = getURLParams(currLocation.toLowerCase()); // eslint-disable-next-line eqeqeq - if (targetDomain) { - _classPrivateFieldLooseBase(this, _account$6)[_account$6].targetDomain = targetDomain; - } + if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') { + return; + } - if (token) { - _classPrivateFieldLooseBase(this, _account$6)[_account$6].token = token; - } + $ct.isPrivacyArrPushed = true; - var currLocation = location.href; - var urlParams = getURLParams(currLocation.toLowerCase()); // eslint-disable-next-line eqeqeq + if ($ct.privacyArray.length > 0) { + this.privacy.push($ct.privacyArray); + } - if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') { - return; - } + _classPrivateFieldLooseBase(this, _processOldValues)[_processOldValues](); - $ct.isPrivacyArrPushed = true; + this.pageChanged(); + const backupInterval = setInterval(() => { + if (_classPrivateFieldLooseBase(this, _device$3)[_device$3].gcookie) { + clearInterval(backupInterval); - if ($ct.privacyArray.length > 0) { - this.privacy.push($ct.privacyArray); + _classPrivateFieldLooseBase(this, _request$7)[_request$7].processBackupEvents(); } + }, 3000); - _classPrivateFieldLooseBase(this, _processOldValues)[_processOldValues](); + if (_classPrivateFieldLooseBase(this, _isSpa)[_isSpa]) { + // listen to click on the document and check if URL has changed. + document.addEventListener('click', _classPrivateFieldLooseBase(this, _boundCheckPageChanged)[_boundCheckPageChanged]); + } else { + // remove existing click listeners if any + document.removeEventListener('click', _classPrivateFieldLooseBase(this, _boundCheckPageChanged)[_boundCheckPageChanged]); + } - this.pageChanged(); - var backupInterval = setInterval(function () { - if (_classPrivateFieldLooseBase(_this2, _device$3)[_device$3].gcookie) { - clearInterval(backupInterval); + _classPrivateFieldLooseBase(this, _onloadcalled)[_onloadcalled] = 1; + } // process the option array provided to the clevertap object + // after its been initialized - _classPrivateFieldLooseBase(_this2, _request$7)[_request$7].processBackupEvents(); - } - }, 3000); - if (_classPrivateFieldLooseBase(this, _isSpa)[_isSpa]) { - // listen to click on the document and check if URL has changed. - document.addEventListener('click', _classPrivateFieldLooseBase(this, _boundCheckPageChanged)[_boundCheckPageChanged]); - } else { - // remove existing click listeners if any - document.removeEventListener('click', _classPrivateFieldLooseBase(this, _boundCheckPageChanged)[_boundCheckPageChanged]); - } + pageChanged() { + const search = window.location.search; + + if (search === '?ctBuilder') { + // open in visual builder mode + console.log('open in visual builder mode'); + initialiseCTBuilder(); + return; + } - _classPrivateFieldLooseBase(this, _onloadcalled)[_onloadcalled] = 1; - } // process the option array provided to the clevertap object - // after its been initialized + if (search === '?ctBuilderPreview') { + // open preview + console.log('open in visual builder mode'); // renderVisualBuilder(targetingMsgJson, true) - }, { - key: "pageChanged", - value: function pageChanged() { - var _this3 = this; + return; + } - var currLocation = window.location.href; - var urlParams = getURLParams(currLocation.toLowerCase()); // -- update page count + const currLocation = window.location.href; + const urlParams = getURLParams(currLocation.toLowerCase()); // -- update page count - var obj = _classPrivateFieldLooseBase(this, _session$3)[_session$3].getSessionCookieObject(); + const obj = _classPrivateFieldLooseBase(this, _session$3)[_session$3].getSessionCookieObject(); - var pgCount = typeof obj.p === 'undefined' ? 0 : obj.p; - obj.p = ++pgCount; + let pgCount = typeof obj.p === 'undefined' ? 0 : obj.p; + obj.p = ++pgCount; - _classPrivateFieldLooseBase(this, _session$3)[_session$3].setSessionCookieObject(obj); // -- update page count + _classPrivateFieldLooseBase(this, _session$3)[_session$3].setSessionCookieObject(obj); // -- update page count - var data = {}; - var referrerDomain = getDomain(document.referrer); + let data = {}; + let referrerDomain = getDomain(document.referrer); - if (window.location.hostname !== referrerDomain) { - var maxLen = 120; + if (window.location.hostname !== referrerDomain) { + const maxLen = 120; - if (referrerDomain !== '') { - referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain; - data.referrer = referrerDomain; - } + if (referrerDomain !== '') { + referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain; + data.referrer = referrerDomain; + } - var utmSource = urlParams.utm_source || urlParams.wzrk_source; + let utmSource = urlParams.utm_source || urlParams.wzrk_source; - if (typeof utmSource !== 'undefined') { - utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource; - data.us = utmSource; // utm_source - } + if (typeof utmSource !== 'undefined') { + utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource; + data.us = utmSource; // utm_source + } - var utmMedium = urlParams.utm_medium || urlParams.wzrk_medium; + let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium; - if (typeof utmMedium !== 'undefined') { - utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium; - data.um = utmMedium; // utm_medium - } + if (typeof utmMedium !== 'undefined') { + utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium; + data.um = utmMedium; // utm_medium + } - var utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign; + let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign; - if (typeof utmCampaign !== 'undefined') { - utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign; - data.uc = utmCampaign; // utm_campaign - } // also independently send wzrk_medium to the backend + if (typeof utmCampaign !== 'undefined') { + utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign; + data.uc = utmCampaign; // utm_campaign + } // also independently send wzrk_medium to the backend - if (typeof urlParams.wzrk_medium !== 'undefined') { - var wm = urlParams.wzrk_medium; + if (typeof urlParams.wzrk_medium !== 'undefined') { + const wm = urlParams.wzrk_medium; - if (wm.match(/^email$|^social$|^search$/)) { - data.wm = wm; // wzrk_medium - } + if (wm.match(/^email$|^social$|^search$/)) { + data.wm = wm; // wzrk_medium } } + } - data = _classPrivateFieldLooseBase(this, _request$7)[_request$7].addSystemDataToObject(data, undefined); - data.cpg = currLocation; - data[CAMP_COOKIE_NAME] = getCampaignObjForLc(); + data = _classPrivateFieldLooseBase(this, _request$7)[_request$7].addSystemDataToObject(data, undefined); + data.cpg = currLocation; + data[CAMP_COOKIE_NAME] = getCampaignObjForLc(); - var pageLoadUrl = _classPrivateFieldLooseBase(this, _account$6)[_account$6].dataPostURL; + let pageLoadUrl = _classPrivateFieldLooseBase(this, _account$6)[_account$6].dataPostURL; - _classPrivateFieldLooseBase(this, _request$7)[_request$7].addFlags(data); // send dsync flag when page = 1 + _classPrivateFieldLooseBase(this, _request$7)[_request$7].addFlags(data); // send dsync flag when page = 1 - if (parseInt(data.pg) === 1) { - _classPrivateFieldLooseBase(this, _overrideDSyncFlag)[_overrideDSyncFlag](data); - } + if (parseInt(data.pg) === 1) { + _classPrivateFieldLooseBase(this, _overrideDSyncFlag)[_overrideDSyncFlag](data); + } - pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page'); - pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$a)[_logger$a])); + pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page'); + pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$a)[_logger$a])); - _classPrivateFieldLooseBase(this, _request$7)[_request$7].saveAndFireRequest(pageLoadUrl, $ct.blockRequest); + _classPrivateFieldLooseBase(this, _request$7)[_request$7].saveAndFireRequest(pageLoadUrl, $ct.blockRequest); - if (parseInt(data.pg) === 1) { - this.event.push(WZRK_FETCH, { - t: 4 - }); + if (parseInt(data.pg) === 1) { + this.event.push(WZRK_FETCH, { + t: 4 + }); + } + + _classPrivateFieldLooseBase(this, _previousUrl)[_previousUrl] = currLocation; + setTimeout(() => { + if (pgCount <= 3) { + // send ping for up to 3 pages + _classPrivateFieldLooseBase(this, _pingRequest)[_pingRequest](); } - _classPrivateFieldLooseBase(this, _previousUrl)[_previousUrl] = currLocation; - setTimeout(function () { - if (pgCount <= 3) { - // send ping for up to 3 pages - _classPrivateFieldLooseBase(_this3, _pingRequest)[_pingRequest](); - } + if (_classPrivateFieldLooseBase(this, _isPingContinuous)[_isPingContinuous]()) { + setInterval(() => { + _classPrivateFieldLooseBase(this, _pingRequest)[_pingRequest](); + }, CONTINUOUS_PING_FREQ_IN_MILLIS); + } + }, FIRST_PING_FREQ_IN_MILLIS); + } - if (_classPrivateFieldLooseBase(_this3, _isPingContinuous)[_isPingContinuous]()) { - setInterval(function () { - _classPrivateFieldLooseBase(_this3, _pingRequest)[_pingRequest](); - }, CONTINUOUS_PING_FREQ_IN_MILLIS); - } - }, FIRST_PING_FREQ_IN_MILLIS); - } - }, { - key: "_isPersonalisationActive", - value: function _isPersonalisationActive() { - return StorageManager._isLocalStorageSupported() && this.enablePersonalization; - } - }, { - key: "sendLocationData", + _isPersonalisationActive() { + return StorageManager._isLocalStorageSupported() && this.enablePersonalization; + } - /** - * - * @param {object} payload - */ - value: function sendLocationData(payload) { - // Send the updated value to LC - var data = {}; - data.af = {}; - var profileObj = {}; - data.type = 'profile'; + // eslint-disable-next-line accessor-pairs + set popupCallback(callback) { + this.popupCallbacks[this.popupCurrentWzrkId] = callback; + } + /** + * + * @param {object} payload + */ - if (profileObj.tz == null) { - profileObj.tz = new Date().toString().match(/([A-Z]+[\+-][0-9]+)/)[1]; - } - data.profile = profileObj; + sendLocationData(payload) { + // Send the updated value to LC + let data = {}; + data.af = {}; + const profileObj = {}; + data.type = 'profile'; - if (payload) { - var keys = Object.keys(payload); - keys.forEach(function (key) { - data.af[key] = payload[key]; - }); - } + if (profileObj.tz == null) { + profileObj.tz = new Date().toString().match(/([A-Z]+[\+-][0-9]+)/)[1]; + } - if ($ct.location) { - data.af = _objectSpread2(_objectSpread2({}, data.af), $ct.location); - } + data.profile = profileObj; - data = _classPrivateFieldLooseBase(this, _request$7)[_request$7].addSystemDataToObject(data, true); + if (payload) { + const keys = Object.keys(payload); + keys.forEach(key => { + data.af[key] = payload[key]; + }); + } - _classPrivateFieldLooseBase(this, _request$7)[_request$7].addFlags(data); + if ($ct.location) { + data.af = { ...data.af, + ...$ct.location + }; + } - var compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$a)[_logger$a]); + data = _classPrivateFieldLooseBase(this, _request$7)[_request$7].addSystemDataToObject(data, true); - var pageLoadUrl = _classPrivateFieldLooseBase(this, _account$6)[_account$6].dataPostURL; + _classPrivateFieldLooseBase(this, _request$7)[_request$7].addFlags(data); - pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH); - pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData); + const compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$a)[_logger$a]); - _classPrivateFieldLooseBase(this, _request$7)[_request$7].saveAndFireRequest(pageLoadUrl, $ct.blockRequest); - } // offline mode + let pageLoadUrl = _classPrivateFieldLooseBase(this, _account$6)[_account$6].dataPostURL; - /** - * events will be recorded and queued locally when passed with true - * but will not be sent to the server until offline is disabled by passing false - * @param {boolean} arg - */ + pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH); + pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData); - }, { - key: "setOffline", - value: function setOffline(arg) { - if (typeof arg !== 'boolean') { - console.error('setOffline should be called with a value of type boolean'); - return; - } + _classPrivateFieldLooseBase(this, _request$7)[_request$7].saveAndFireRequest(pageLoadUrl, $ct.blockRequest); + } // offline mode - $ct.offline = arg; // if offline is disabled - // process events from cache + /** + * events will be recorded and queued locally when passed with true + * but will not be sent to the server until offline is disabled by passing false + * @param {boolean} arg + */ - if (!arg) { - _classPrivateFieldLooseBase(this, _request$7)[_request$7].processBackupEvents(); - } - } - }, { - key: "defineVariable", - value: function defineVariable(name, defaultValue) { - return Variable.define(name, defaultValue, _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1]); + + setOffline(arg) { + if (typeof arg !== 'boolean') { + console.error('setOffline should be called with a value of type boolean'); + return; } - }, { - key: "syncVariables", - value: function syncVariables(onSyncSuccess, onSyncFailure) { - if (_classPrivateFieldLooseBase(this, _logger$a)[_logger$a].logLevel === 4) { - return _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1].syncVariables(onSyncSuccess, onSyncFailure); - } else { - var m = 'App log level is not set to 4'; - _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].error(m); + $ct.offline = arg; // if offline is disabled + // process events from cache - return Promise.reject(new Error(m)); - } + if (!arg) { + _classPrivateFieldLooseBase(this, _request$7)[_request$7].processBackupEvents(); } - }, { - key: "fetchVariables", - value: function fetchVariables(onFetchCallback) { - _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1].fetchVariables(onFetchCallback); - } - }, { - key: "addVariablesChangedCallback", - value: function addVariablesChangedCallback(callback) { - _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1].addVariablesChangedCallback(callback); - } - }, { - key: "addOneTimeVariablesChangedCallback", - value: function addOneTimeVariablesChangedCallback(callback) { - _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1].addOneTimeVariablesChangedCallback(callback); - } - }, { - key: "popupCallback", - // eslint-disable-next-line accessor-pairs - set: function set(callback) { - this.popupCallbacks[this.popupCurrentWzrkId] = callback; + } + + defineVariable(name, defaultValue) { + return Variable.define(name, defaultValue, _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1]); + } + + syncVariables(onSyncSuccess, onSyncFailure) { + if (_classPrivateFieldLooseBase(this, _logger$a)[_logger$a].logLevel === 4) { + return _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1].syncVariables(onSyncSuccess, onSyncFailure); + } else { + const m = 'App log level is not set to 4'; + + _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].error(m); + + return Promise.reject(new Error(m)); } - }]); + } + + fetchVariables(onFetchCallback) { + _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1].fetchVariables(onFetchCallback); + } + + addVariablesChangedCallback(callback) { + _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1].addVariablesChangedCallback(callback); + } + + addOneTimeVariablesChangedCallback(callback) { + _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1].addOneTimeVariablesChangedCallback(callback); + } - return CleverTap; - }(); + } var _processOldValues2 = function _processOldValues2() { this.onUserLogin._processOldValues(); @@ -8910,8 +8406,8 @@ }; var _debounce2 = function _debounce2(func) { - var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300; - var timeout; + let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300; + let timeout; return function () { clearTimeout(timeout); timeout = setTimeout(func, delay); @@ -8919,11 +8415,9 @@ }; var _checkPageChanged2 = function _checkPageChanged2() { - var _this4 = this; - - var debouncedPageChanged = _classPrivateFieldLooseBase(this, _debounce)[_debounce](function () { - if (_classPrivateFieldLooseBase(_this4, _previousUrl)[_previousUrl] !== location.href) { - _this4.pageChanged(); + const debouncedPageChanged = _classPrivateFieldLooseBase(this, _debounce)[_debounce](() => { + if (_classPrivateFieldLooseBase(this, _previousUrl)[_previousUrl] !== location.href) { + this.pageChanged(); } }); @@ -8931,9 +8425,9 @@ }; var _pingRequest2 = function _pingRequest2() { - var pageLoadUrl = _classPrivateFieldLooseBase(this, _account$6)[_account$6].dataPostURL; + let pageLoadUrl = _classPrivateFieldLooseBase(this, _account$6)[_account$6].dataPostURL; - var data = {}; + let data = {}; data = _classPrivateFieldLooseBase(this, _request$7)[_request$7].addSystemDataToObject(data, undefined); pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING); pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$a)[_logger$a])); @@ -8951,7 +8445,7 @@ } }; - var clevertap = new CleverTap(window.clevertap); + const clevertap = new CleverTap(window.clevertap); window.clevertap = window.wizrocket = clevertap; return clevertap; diff --git a/clevertap.js.map b/clevertap.js.map index 27c9fc52..0ff73091 100644 --- a/clevertap.js.map +++ b/clevertap.js.map @@ -1 +1 @@ -{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/notification.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {}\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n // Initialize array\n var array = []\n\n // Check if globalProfileMap is null, initialize if needed\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n // Check if the value to be set is either string or number\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = $ct.globalProfileMap[propKey]\n array.push(typeof propVal === 'number' ? propVal : propVal.toLowerCase())\n } else {\n $ct.globalProfileMap[propKey] = propVal\n }\n } else {\n // Check if propVal is an array\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = Array.isArray($ct.globalProfileMap[propKey]) ? $ct.globalProfileMap[propKey] : [$ct.globalProfileMap[propKey]]\n }\n\n // Check for case-sensitive inputs and filter the same ones\n for (var i = 0; i < propVal.length; i++) {\n if (typeof propVal[i] === 'number' && !array.includes(propVal[i])) {\n array.push(propVal[i])\n } else if (typeof propVal[i] === 'string' && !array.includes(propVal[i].toLowerCase())) {\n array.push(propVal[i].toLowerCase())\n } else if ((typeof propVal[i] === 'number' && array.includes(propVal[i])) || (typeof propVal[i] === 'string' && array.includes(propVal[i].toLowerCase()))) {\n console.error('Values already included')\n } else {\n console.error('Array supports only string or number type values')\n }\n }\n\n // Update globalProfileMap with the array\n $ct.globalProfileMap[propKey] = array\n }\n\n // Save to local storage or cookie\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Call the sendMultiValueData function\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n var index = $ct.globalProfileMap[propKey].indexOf(propVal)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n } else {\n for (var k = 0; k < propVal.length; k++) {\n var idx = $ct.globalProfileMap[propKey].indexOf(propVal[k])\n if (idx !== -1) {\n $ct.globalProfileMap[propKey].splice(idx, 1)\n }\n }\n }\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n // console.log('Raise notification clicked event for ', item)\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","import {\n addToLocalProfileMap,\n arp,\n getCampaignObject,\n saveCampaignObject,\n closeIframe\n} from './clevertap'\n\nimport {\n CAMP_COOKIE_NAME,\n DISPLAY,\n GLOBAL,\n EV_COOKIE,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n WZRK_PREFIX,\n WZRK_ID,\n CAMP_COOKIE_G,\n GCOOKIE_NAME\n} from './constants'\n\nimport {\n getNow,\n getToday\n} from './datetime'\n\nimport {\n compressToBase64\n} from './encoder'\n\nimport { StorageManager, $ct } from './storage'\nimport RequestDispatcher from './requestDispatcher'\nimport { CTWebPersonalisationBanner } from './web-personalisation/banner'\nimport { CTWebPersonalisationCarousel } from './web-personalisation/carousel'\nimport { CTWebPopupImageOnly } from './web-popupImageonly/popupImageonly'\nimport { checkAndRegisterWebInboxElements, initializeWebInbox, processWebInboxSettings, hasWebInboxSettingsInLS, processInboxNotifs } from '../modules/web-inbox/helper'\n\nconst _tr = (msg, {\n device,\n session,\n request,\n logger\n}) => {\n const _device = device\n const _session = session\n const _request = request\n const _logger = logger\n let _wizCounter = 0\n\n // Campaign House keeping\n const doCampHouseKeeping = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const today = getToday()\n\n const incrCount = (obj, campaignId, excludeFromFreqCaps) => {\n let currentCount = 0\n let totalCount = 0\n if (obj[campaignId] != null) {\n currentCount = obj[campaignId]\n }\n currentCount++\n if (obj.tc != null) {\n totalCount = obj.tc\n }\n // if exclude from caps then dont add to total counts\n if (excludeFromFreqCaps < 0) {\n totalCount++\n }\n\n obj.tc = totalCount\n obj[campaignId] = currentCount\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n delete sessionStorage[CAMP_COOKIE_NAME]\n var campTypeObj = {}\n const campObj = getCampaignObject()\n if (targetingMsgJson.display.wtarget_type === 3 && campObj.hasOwnProperty('wi')) {\n campTypeObj = campObj.wi\n } else if ((targetingMsgJson.display.wtarget_type === 0 || targetingMsgJson.display.wtarget_type === 1) && campObj.hasOwnProperty('wp')) {\n campTypeObj = campObj.wp\n } else {\n campTypeObj = {}\n }\n if (campObj.hasOwnProperty('global')) {\n campTypeObj.wp = campObj\n }\n // global session limit. default is 1\n if (targetingMsgJson[DISPLAY].wmc == null) {\n targetingMsgJson[DISPLAY].wmc = 1\n }\n\n // global session limit for web inbox. default is 1\n if (targetingMsgJson[DISPLAY].wimc == null) {\n targetingMsgJson[DISPLAY].wimc = 1\n }\n\n var excludeFromFreqCaps = -1 // efc - Exclude from frequency caps\n let campaignSessionLimit = -1 // mdc - Once per session\n let campaignDailyLimit = -1 // tdc - Once per day\n let campaignTotalLimit = -1 // tlc - Once per user for the duration of campaign\n let totalDailyLimit = -1\n let totalSessionLimit = -1 // wmc - Web Popup Global Session Limit\n let totalInboxSessionLimit = -1 // wimc - Web Inbox Global Session Limit\n\n if (targetingMsgJson[DISPLAY].efc != null) { // exclude from frequency cap\n excludeFromFreqCaps = parseInt(targetingMsgJson[DISPLAY].efc, 10)\n }\n if (targetingMsgJson[DISPLAY].mdc != null) { // Campaign Session Limit\n campaignSessionLimit = parseInt(targetingMsgJson[DISPLAY].mdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tdc != null) { // No of web popups in a day per campaign\n campaignDailyLimit = parseInt(targetingMsgJson[DISPLAY].tdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tlc != null) { // Total lifetime count\n campaignTotalLimit = parseInt(targetingMsgJson[DISPLAY].tlc, 10)\n }\n if (targetingMsgJson[DISPLAY].wmp != null) { // No of campaigns per day\n totalDailyLimit = parseInt(targetingMsgJson[DISPLAY].wmp, 10)\n }\n if (targetingMsgJson[DISPLAY].wmc != null) { // No of campaigns per session\n totalSessionLimit = parseInt(targetingMsgJson[DISPLAY].wmc, 10)\n }\n\n if (targetingMsgJson[DISPLAY].wimc != null) { // No of inbox campaigns per session\n totalInboxSessionLimit = parseInt(targetingMsgJson[DISPLAY].wimc, 10)\n }\n // session level capping\n var sessionObj = campTypeObj[_session.sessionId]\n if (sessionObj) {\n const campaignSessionCount = sessionObj[campaignId]\n const totalSessionCount = sessionObj.tc\n // dnd\n if (campaignSessionCount === 'dnd' && !$ct.dismissSpamControl) {\n return false\n }\n\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n // Inbox session\n if (totalInboxSessionLimit > 0 && totalSessionCount >= totalInboxSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n } else {\n // session\n if (totalSessionLimit > 0 && totalSessionCount >= totalSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n }\n\n // campaign session\n if (campaignSessionLimit > 0 && campaignSessionCount >= campaignSessionLimit) {\n return false\n }\n } else {\n sessionObj = {}\n campTypeObj[_session.sessionId] = sessionObj\n }\n\n // daily level capping\n var dailyObj = campTypeObj[today]\n if (dailyObj != null) {\n const campaignDailyCount = dailyObj[campaignId]\n const totalDailyCount = dailyObj.tc\n // daily\n if (totalDailyLimit > 0 && totalDailyCount >= totalDailyLimit && excludeFromFreqCaps < 0) {\n return false\n }\n // campaign daily\n if (campaignDailyLimit > 0 && campaignDailyCount >= campaignDailyLimit) {\n return false\n }\n } else {\n dailyObj = {}\n campTypeObj[today] = dailyObj\n }\n\n var globalObj = campTypeObj[GLOBAL]\n if (globalObj != null) {\n const campaignTotalCount = globalObj[campaignId]\n // campaign total\n if (campaignTotalLimit > 0 && campaignTotalCount >= campaignTotalLimit) {\n return false\n }\n } else {\n globalObj = {}\n campTypeObj[GLOBAL] = globalObj\n }\n }\n // delay\n if (targetingMsgJson[DISPLAY].delay != null && targetingMsgJson[DISPLAY].delay > 0) {\n const delay = targetingMsgJson[DISPLAY].delay\n targetingMsgJson[DISPLAY].delay = 0\n setTimeout(_tr, delay * 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n return false\n }\n\n incrCount(sessionObj, campaignId, excludeFromFreqCaps)\n incrCount(dailyObj, campaignId, excludeFromFreqCaps)\n incrCount(globalObj, campaignId, excludeFromFreqCaps)\n\n let campKey = 'wp'\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n campKey = 'wi'\n }\n // get ride of stale sessions and day entries\n const newCampObj = {}\n newCampObj[_session.sessionId] = sessionObj\n newCampObj[today] = dailyObj\n newCampObj[GLOBAL] = globalObj\n saveCampaignObject({ [campKey]: newCampObj })\n }\n\n const getCookieParams = () => {\n const gcookie = _device.getGuid()\n const scookieObj = _session.getSessionCookieObject()\n return '&t=wc&d=' + encodeURIComponent(compressToBase64(gcookie + '|' + scookieObj.p + '|' + scookieObj.s))\n }\n\n const setupClickEvent = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n if (onClick !== '' && onClick != null) {\n let ctaElement\n let jsCTAElements\n if (isLegacy) {\n ctaElement = contentDiv\n } else if (contentDiv !== null) {\n jsCTAElements = contentDiv.getElementsByClassName('jsCT_CTA')\n if (jsCTAElements != null && jsCTAElements.length === 1) {\n ctaElement = jsCTAElements[0]\n }\n }\n const jsFunc = targetingMsgJson.display.jsFunc\n const isPreview = targetingMsgJson.display.preview\n if (isPreview == null) {\n onClick += getCookieParams()\n }\n\n if (ctaElement != null) {\n ctaElement.onclick = () => {\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n if (isPreview == null) {\n RequestDispatcher.fireRequest(onClick)\n }\n invokeExternalJs(jsFunc, targetingMsgJson)\n // close iframe. using -1 for no campaignId\n closeIframe('-1', divId, _session.sessionId)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n }\n }\n\n const invokeExternalJs = (jsFunc, targetingMsgJson) => {\n const func = window.parent[jsFunc]\n if (typeof func === 'function') {\n if (targetingMsgJson.display.kv != null) {\n func(targetingMsgJson.display.kv)\n } else {\n func()\n }\n }\n }\n\n const setupClickUrl = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n incrementImpression(targetingMsgJson)\n setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy)\n }\n\n const incrementImpression = (targetingMsgJson) => {\n const data = {}\n data.type = 'event'\n data.evtName = NOTIFICATION_VIEWED\n data.evtData = { [WZRK_ID]: targetingMsgJson.wzrk_id }\n if (targetingMsgJson.wzrk_pivot) {\n data.evtData = { ...data.evtData, wzrk_pivot: targetingMsgJson.wzrk_pivot }\n }\n _request.processEvent(data)\n }\n\n const renderPersonalisationBanner = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const bannerEl = document.createElement('ct-web-personalisation-banner')\n bannerEl.msgId = targetingMsgJson.wzrk_id\n bannerEl.pivotId = targetingMsgJson.wzrk_pivot\n bannerEl.divHeight = targetingMsgJson.display.divHeight\n bannerEl.details = targetingMsgJson.display.details[0]\n const containerEl = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n containerEl.innerHTML = ''\n containerEl.appendChild(bannerEl)\n }\n\n const renderPersonalisationCarousel = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-carousel') === undefined) {\n customElements.define('ct-web-personalisation-carousel', CTWebPersonalisationCarousel)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const carousel = document.createElement('ct-web-personalisation-carousel')\n carousel.target = targetingMsgJson\n const container = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n container.innerHTML = ''\n container.appendChild(carousel)\n }\n\n const renderPopUpImageOnly = (targetingMsgJson) => {\n const divId = 'wzrkImageOnlyDiv'\n const popupImageOnly = document.createElement('ct-web-popup-imageonly')\n popupImageOnly.session = _session\n popupImageOnly.target = targetingMsgJson\n const containerEl = document.getElementById(divId)\n containerEl.innerHTML = ''\n containerEl.style.visibility = 'hidden'\n containerEl.appendChild(popupImageOnly)\n }\n\n const renderFooterNotification = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const displayObj = targetingMsgJson.display\n\n if (displayObj.wtarget_type === 2) { // Handling Web Native display\n // Logic for kv pair data\n if (targetingMsgJson.msgContent.type === 1) {\n const inaObj = {}\n\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.msgContent.kv != null) {\n inaObj.kv = targetingMsgJson.msgContent.kv\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n return\n }\n }\n if (displayObj.layout === 1) { // Handling Web Exit Intent\n return showExitIntent(undefined, targetingMsgJson)\n }\n if (displayObj.layout === 3) { // Handling Web Popup Image Only\n const divId = 'wzrkImageOnlyDiv'\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById(divId) != null || document.getElementById('intentPreview') != null) {\n return\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n document.body.appendChild(msgDiv)\n if (customElements.get('ct-web-popup-imageonly') === undefined) {\n customElements.define('ct-web-popup-imageonly', CTWebPopupImageOnly)\n }\n return renderPopUpImageOnly(targetingMsgJson)\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const divId = 'wizParDiv' + displayObj.layout\n\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n if (document.getElementById(divId) != null) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = divId\n const isBanner = displayObj.layout === 2\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n const viewHeight = window.innerHeight\n const viewWidth = window.innerWidth\n let legacy = false\n\n if (!isBanner) {\n const marginBottom = viewHeight * 5 / 100\n var contentHeight = 10\n let right = viewWidth * 5 / 100\n let bottomPosition = contentHeight + marginBottom\n let width = viewWidth * 30 / 100 + 20\n let widthPerct = 'width:30%;'\n // for small devices - mobile phones\n if ((/mobile/i.test(navigator.userAgent) || (/mini/i.test(navigator.userAgent))) && /iPad/i.test(navigator.userAgent) === false) {\n width = viewWidth * 85 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:80%;'\n // medium devices - tablets\n } else if ('ontouchstart' in window || (/tablet/i.test(navigator.userAgent))) {\n width = viewWidth * 50 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:50%;'\n }\n // legacy footer notif\n if (displayObj.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden; bottom:' + bottomPosition + 'px !important;width:' + width + 'px !important;right:' + right + 'px !important;position:fixed;z-index:2147483647;')\n } else {\n msgDiv.setAttribute('style', widthPerct + displayObj.iFrameStyle)\n }\n } else {\n msgDiv.setAttribute('style', displayObj.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n\n const borderRadius = displayObj.br === false ? '0' : '8'\n\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, leftTd, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n leftTd = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n leftTd = '#f4f4f4'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"\"\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'\" + divId + \"');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"\" +\n // \"\"+\n '' + imageTd + \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
'\n html = css + title + body\n }\n\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n const ifrm = (iframe.contentWindow) ? iframe.contentWindow : (iframe.contentDocument.document) ? iframe.contentDocument.document : iframe.contentDocument\n const doc = ifrm.document\n\n // Dispatch event for popup box/banner close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n doc.open()\n doc.write(html)\n\n if (displayObj['custom-editor']) {\n appendScriptForCustomEvent(targetingMsgJson, doc)\n }\n doc.close()\n\n const adjustIFrameHeight = () => {\n // adjust iframe and body height of html inside correctly\n contentHeight = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv').scrollHeight\n if (displayObj['custom-editor'] !== true && !isBanner) {\n contentHeight += 25\n }\n document.getElementById('wiz-iframe').contentDocument.body.style.margin = '0px'\n document.getElementById('wiz-iframe').style.height = contentHeight + 'px'\n }\n\n const ua = navigator.userAgent.toLowerCase()\n if (ua.indexOf('safari') !== -1) {\n if (ua.indexOf('chrome') > -1) {\n iframe.onload = () => {\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n } else {\n let inDoc = iframe.contentDocument || iframe.contentWindow\n if (inDoc.document) inDoc = inDoc.document\n // safari iphone 7+ needs this.\n adjustIFrameHeight()\n const _timer = setInterval(() => {\n if (inDoc.readyState === 'complete') {\n clearInterval(_timer)\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }, 10)\n }\n } else {\n iframe.onload = () => {\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }\n }\n\n const appendScriptForCustomEvent = (targetingMsgJson, doc) => {\n const script = doc.createElement('script')\n script.innerHTML = `\n const ct__camapignId = '${targetingMsgJson.wzrk_id}';\n const ct__formatVal = (v) => {\n return v && v.trim().substring(0, 20);\n }\n const ct__parentOrigin = window.parent.origin;\n document.body.addEventListener('click', (event) => {\n const elem = event.target.closest?.('a[wzrk_c2a], button[wzrk_c2a]');\n if (elem) {\n const {innerText, id, name, value, href} = elem;\n const clickAttr = elem.getAttribute('onclick') || elem.getAttribute('click');\n const onclickURL = clickAttr?.match(/(window.open)[(\\](\\\"|')(.*)(\\\"|',)/)?.[3] || clickAttr?.match(/(location.href *= *)(\\\"|')(.*)(\\\"|')/)?.[3];\n const props = {innerText, id, name, value};\n let msgCTkv = Object.keys(props).reduce((acc, c) => {\n const formattedVal = ct__formatVal(props[c]);\n formattedVal && (acc['wzrk_click_' + c] = formattedVal);\n return acc;\n }, {});\n if(onclickURL) { msgCTkv['wzrk_click_' + 'url'] = onclickURL; }\n if(href) { msgCTkv['wzrk_click_' + 'c2a'] = href; }\n const notifData = { msgId: ct__camapignId, msgCTkv, pivotId: '${targetingMsgJson.wzrk_pivot}' };\n window.parent.clevertap.renderNotificationClicked(notifData);\n }\n });\n `\n doc.body.appendChild(script)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe-intent'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n const ifrm = (iframe.contentWindow) ? iframe.contentWindow : (iframe.contentDocument.document) ? iframe.contentDocument.document : iframe.contentDocument\n const doc = ifrm.document\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n doc.open()\n doc.write(html)\n if (targetingMsgJson.display['custom-editor']) {\n appendScriptForCustomEvent(targetingMsgJson, doc)\n }\n doc.close()\n\n const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n this.#logger.error('Error subscribing: ' + error)\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token) {\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n pageChanged () {\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","data","getItem","parse","e","removeItem","name","domain","cookieStr","document","cookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","property","save","createCookie","location","hostname","$ct","globalCache","read","readCookie","trim","err","broadDomain","domainParts","testBroadDomain","testCookieName","removeCookie","tempCookie","metaObj","readFromLSorCookie","wzrkMetaObj","saveToLSorCookie","getMetaProp","setMetaProp","k","flag","reqNo","backupArr","q","debug","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","item","saveCacheToLS","allKeys","objToArray","index","temp","keysArr","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","removeBackup","sessionObj","getSessionCookieObject","s","getAndClearMetaProp","kIdFromLS","guidFromLRUCache","set","lastK","getSecondLastKey","lastGUID","unregisterTokenForGuid","createBroadCookie","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","account","randomDelay","random","skipARP","sendOULFlag","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","getDelayFrequency","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","emailURL","fireRequest","ProfileHandler","profilesArr","propName","command","tz","profile","addSystemDataToObject","addFlags","compressedData","dataPostURL","saveAndFireRequest","arrayVal","array","toLowerCase","sendMultiValueData","propKey","propVal","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","addToK","ids","g","kId","anonymousUser","foundInCache","getLastKey","gFromCache","get","clear","Identity","cookieName","loginArr","pop","processProfile","setInstantDeleteFlagInK","CTWebPersonalisationBanner","_details","shadow","attachShadow","mode","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","details","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","renderBanner","HTMLElement","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","target","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","remove","button","setInterval","sliderTime","goTo","prev","cur","renderCarousel","CTWebPopupImageOnly","_session","popup","container","resizeObserver","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","renderImageOnlyPopup","Message","config","message","wrapper","snackBar","renderMessage","part","_el","msg","createEl","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","raiseClickedEvent","contains","setBadgeStyle","msgCount","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","buildUIForMessages","updateUnviewedBadgeCounter","deleteMsgsFromUI","getInboxMessages","now","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","msgs","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","getBoundingClientRect","top","right","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","addMsgsToInboxFromLS","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","getAttribute","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","updateInboxMessages","previewMsgs","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","incomingMessagesForPreview","inbox_notifs","incomingMessages","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","targetingMsgJson","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","onclick","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","querySelector","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","inaObj","kvPairsEvent","CustomEvent","dispatchEvent","layout","showExitIntent","element","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","pointerCss","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","ifrm","contentWindow","contentDocument","doc","closeCampaign","Event","write","appendScriptForCustomEvent","close","adjustIFrameHeight","scrollHeight","margin","ua","onload","inDoc","_timer","script","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","then","catch","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","visitCount","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","sessionStart","seqNo","requestTime","RequestManager","backupEvent","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","fetch","method","headers","response","ok","json","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","info","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","skipDialog","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","VariableStore","onSyncSuccess","onSyncFailure","Error","meta","tk","dataPostPEURL","post","r","status","onFetchCallback","callback","callBack","CleverTap","isSpa","bind","enablePersonalization","_isPersonalisationActive","ReqestManager","onUserLogin","privacy","notifications","spa","getTimeElapsed","getPageCount","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","_handleIncrementDecrementValue","handleDecrementValue","setMultiValuesForKey","_handleMultiValueSet","addMultiValueForKey","_handleMultiValueAdd","addMultiValuesForKey","removeMultiValueForKey","_handleMultiValueRemove","removeMultiValuesForKey","removeValueForKey","_handleMultiValueDelete","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","sendLocationData","geolocation","getCurrentPosition","showPosition","showError","position","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","_enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","elements","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","arg","syncVariables","fetchVariables","addVariablesChangedCallback","addOneTimeVariablesChangedCallback","_processOldValues","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAO,IAAMA,aAAa,GAAG,oBAAtB;EACA,IAAMC,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yB,CAA1B;;EAKA2B,EAAAA,oBAAoB;EACrB;;+CAmFe;EACd,MAAI56B,WAAW,GAAG,0DAAcoI,WAAhC;;EACA,MAAIjX,IAAI,GAAG,EAAX;EACAA,EAAAA,IAAI,GAAG,0DAAc8W,qBAAd,CAAoC9W,IAApC,EAA0C3C,SAA1C,CAAP;EACAwR,EAAAA,WAAW,GAAGvD,QAAQ,CAACuD,WAAD,EAAc,MAAd,EAAsB1U,QAAtB,CAAtB;EACA0U,EAAAA,WAAW,GAAGvD,QAAQ,CAACuD,WAAD,EAAc,GAAd,EAAmBzC,YAAY,CAACtM,IAAI,CAACC,SAAL,CAAeC,IAAf,CAAD,8BAAuB,IAAvB,wBAA/B,CAAtB;;EAEA,4DAAckX,kBAAd,CAAiCrI,WAAjC,EAA8C/M,GAAG,CAAC+B,YAAlD;EACD;;yDAEoB;EACnB,SAAQ,OAAOrC,MAAM,CAACkoC,MAAd,KAAyB,WAAzB,IAAwCloC,MAAM,CAACkoC,MAAP,CAAcC,IAAd,KAAuB,YAAvE;EACD;;yDAMmB3pC,MAAM;EACxB,MAAI,KAAKkiC,wBAAL,EAAJ,EAAqC;EACnCliC,IAAAA,IAAI,CAACq7B,KAAL,GAAa,IAAb;EACD;EACF;;MC5vBGlsB,SAAS,GAAG,IAAIy6B,SAAJ,CAAcpoC,MAAM,CAAC2N,SAArB;EAElB3N,MAAM,CAAC2N,SAAP,GAAmB3N,MAAM,CAAC4N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/modules/visualBuilder/pageBuilder.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/notification.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {}\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n // Initialize array\n var array = []\n\n // Check if globalProfileMap is null, initialize if needed\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n // Check if the value to be set is either string or number\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = $ct.globalProfileMap[propKey]\n array.push(typeof propVal === 'number' ? propVal : propVal.toLowerCase())\n } else {\n $ct.globalProfileMap[propKey] = propVal\n }\n } else {\n // Check if propVal is an array\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = Array.isArray($ct.globalProfileMap[propKey]) ? $ct.globalProfileMap[propKey] : [$ct.globalProfileMap[propKey]]\n }\n\n // Check for case-sensitive inputs and filter the same ones\n for (var i = 0; i < propVal.length; i++) {\n if (typeof propVal[i] === 'number' && !array.includes(propVal[i])) {\n array.push(propVal[i])\n } else if (typeof propVal[i] === 'string' && !array.includes(propVal[i].toLowerCase())) {\n array.push(propVal[i].toLowerCase())\n } else if ((typeof propVal[i] === 'number' && array.includes(propVal[i])) || (typeof propVal[i] === 'string' && array.includes(propVal[i].toLowerCase()))) {\n console.error('Values already included')\n } else {\n console.error('Array supports only string or number type values')\n }\n }\n\n // Update globalProfileMap with the array\n $ct.globalProfileMap[propKey] = array\n }\n\n // Save to local storage or cookie\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Call the sendMultiValueData function\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n var index = $ct.globalProfileMap[propKey].indexOf(propVal)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n } else {\n for (var k = 0; k < propVal.length; k++) {\n var idx = $ct.globalProfileMap[propKey].indexOf(propVal[k])\n if (idx !== -1) {\n $ct.globalProfileMap[propKey].splice(idx, 1)\n }\n }\n }\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n // console.log('Raise notification clicked event for ', item)\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","export const initialiseCTBuilder = () => {\n// const overlayPath = 'https://kkyusuftk-clevertap.s3.amazonaws.com/sampleIndex.js'\n\n // addOverlayScript(overlayPath).onload = async function () {\n // try {\n // const module = await import(overlayPath)\n // const { default: isEven } = module\n\n // console.log(isEven(4))\n // console.log(isEven(5))\n // } catch (error) {\n // console.error('Error fetching data:', error)\n // }\n // }\n document.addEventListener('DOMContentLoaded', onContentLoad)\n}\n\nlet container\n\nfunction onContentLoad () {\n document.body.innerHTML = ''\n container = document.createElement('div')\n container.id = 'app2'\n container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form\n container.style.display = 'flex'\n document.body.appendChild(container)\n const overlayPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js'\n loadOverlayScript(overlayPath)\n .then(() => {\n console.log('Overlay script loaded successfully.')\n })\n .catch((error) => {\n console.error('Error loading overlay script:', error)\n })\n loadCSS()\n loadTypeKit()\n}\n\nfunction loadCSS () {\n var link = document.createElement('link')\n link.rel = 'stylesheet'\n link.type = 'text/css'\n link.href = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css'\n document.head.appendChild(link)\n}\n\nfunction loadOverlayScript (overlayPath) {\n return new Promise((resolve, reject) => {\n var script = document.createElement('script')\n script.type = 'module'\n script.src = overlayPath\n script.onload = function () {\n if (typeof window.Overlay === 'function') {\n window.Overlay('#app2', 'http://localhost:8080/randomPage')\n resolve()\n } else {\n reject(new Error('ContentLayout not found in overlay.js'))\n }\n }\n script.onerror = function (error) {\n reject(error)\n }\n document.head.appendChild(script)\n })\n}\n\nfunction loadTypeKit () {\n var config = {\n kitId: 'eqj6nom',\n scriptTimeout: 3000,\n async: true\n }\n\n var d = document\n var h = d.documentElement\n var t = setTimeout(function () {\n h.className = h.className.replace(/\\bwf-loading\\b/g, '') + ' wf-inactive'\n // $(document).trigger(\"TypeKitReady\");\n }, config.scriptTimeout)\n var tk = d.createElement('script')\n var f = false\n var s = d.getElementsByTagName('script')[0]\n var a\n\n h.className += ' wf-loading'\n tk.src = 'https://use.typekit.net/' + config.kitId + '.js'\n tk.async = true\n tk.onload = tk.onreadystatechange = function () {\n a = this.readyState\n if (f || (a && a !== 'complete' && a !== 'loaded')) return\n f = true\n clearTimeout(t)\n try {\n // eslint-disable-next-line no-undef\n Typekit.load(config)\n } catch (e) {}\n }\n\n s.parentNode.insertBefore(tk, s)\n}\n\nexport const renderVisualBuilder = (targetingMsgJson, isPreview) => {\n const details = targetingMsgJson.display.details[0]\n const siteUrl = Object.keys(details)[0]\n const selectors = details[siteUrl]\n\n if (siteUrl === window.location.href) {\n for (const selector in selectors) {\n const element = document.querySelector(selector)\n if (element) {\n element.outerHTML = selectors[selector].html\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n } else {\n let count = 0\n const intervalId = setInterval(() => {\n const retryElement = document.querySelector(selector)\n if (retryElement) {\n retryElement.outerHTML = selectors[selector].html\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n clearInterval(intervalId)\n } else {\n count++\n if (count >= 20) {\n console.log(`No element present on DOM with selector '${selector}'.`)\n clearInterval(intervalId)\n }\n }\n }, 500)\n }\n }\n }\n}\n// function addOverlayScript (overlayPath) {\n// const scriptTag = document.createElement('script')\n// scriptTag.setAttribute('type', 'text/javascript')\n// scriptTag.setAttribute('id', 'wzrk-alert-js')\n// scriptTag.setAttribute('src', overlayPath)\n// document.getElementsByTagName('body')[0].appendChild(scriptTag)\n// return scriptTag\n// }\n","import {\n addToLocalProfileMap,\n arp,\n getCampaignObject,\n saveCampaignObject,\n closeIframe\n} from './clevertap'\n\nimport {\n CAMP_COOKIE_NAME,\n DISPLAY,\n GLOBAL,\n EV_COOKIE,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n WZRK_PREFIX,\n WZRK_ID,\n CAMP_COOKIE_G,\n GCOOKIE_NAME\n} from './constants'\n\nimport {\n getNow,\n getToday\n} from './datetime'\n\nimport {\n compressToBase64\n} from './encoder'\n\nimport { StorageManager, $ct } from './storage'\nimport RequestDispatcher from './requestDispatcher'\nimport { CTWebPersonalisationBanner } from './web-personalisation/banner'\nimport { CTWebPersonalisationCarousel } from './web-personalisation/carousel'\nimport { CTWebPopupImageOnly } from './web-popupImageonly/popupImageonly'\nimport { checkAndRegisterWebInboxElements, initializeWebInbox, processWebInboxSettings, hasWebInboxSettingsInLS, processInboxNotifs } from '../modules/web-inbox/helper'\nimport { renderVisualBuilder } from '../modules/visualBuilder/pageBuilder'\n\nconst _tr = (msg, {\n device,\n session,\n request,\n logger\n}) => {\n const _device = device\n const _session = session\n const _request = request\n const _logger = logger\n let _wizCounter = 0\n\n msg = {\n arp: {\n j_n: 'Zw==',\n i_n: 'Y2NmewICAw==',\n d_ts: 0,\n dh: 0,\n v: 1,\n j_s: '{ }',\n id: 'WWW-WWW-WWRZ',\n e_ts: 0,\n r_ts: 1649748826,\n rc_w: 60,\n rc_n: 5\n },\n inapp_notifs: [\n {\n msgContent: {\n templateType: 'point-and-click',\n type: 4\n },\n display: {\n divId: 'hero-banner',\n details: [{\n 'http://localhost:3000/': {\n '.heroDi1v': {\n html: 'Hello Sonam'\n },\n '#selector_2': {\n html: '

Hello Sonam

'\n }\n }\n }],\n wtarget_type: 2,\n wmc: 1,\n ff: 'Desktop'\n },\n wzrk_id: '1655316906_20220620',\n wzrk_pivot: 'wzrk_default'\n }\n ]\n }\n // Campaign House keeping\n const doCampHouseKeeping = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const today = getToday()\n\n const incrCount = (obj, campaignId, excludeFromFreqCaps) => {\n let currentCount = 0\n let totalCount = 0\n if (obj[campaignId] != null) {\n currentCount = obj[campaignId]\n }\n currentCount++\n if (obj.tc != null) {\n totalCount = obj.tc\n }\n // if exclude from caps then dont add to total counts\n if (excludeFromFreqCaps < 0) {\n totalCount++\n }\n\n obj.tc = totalCount\n obj[campaignId] = currentCount\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n delete sessionStorage[CAMP_COOKIE_NAME]\n var campTypeObj = {}\n const campObj = getCampaignObject()\n if (targetingMsgJson.display.wtarget_type === 3 && campObj.hasOwnProperty('wi')) {\n campTypeObj = campObj.wi\n } else if ((targetingMsgJson.display.wtarget_type === 0 || targetingMsgJson.display.wtarget_type === 1) && campObj.hasOwnProperty('wp')) {\n campTypeObj = campObj.wp\n } else {\n campTypeObj = {}\n }\n if (campObj.hasOwnProperty('global')) {\n campTypeObj.wp = campObj\n }\n // global session limit. default is 1\n if (targetingMsgJson[DISPLAY].wmc == null) {\n targetingMsgJson[DISPLAY].wmc = 1\n }\n\n // global session limit for web inbox. default is 1\n if (targetingMsgJson[DISPLAY].wimc == null) {\n targetingMsgJson[DISPLAY].wimc = 1\n }\n\n var excludeFromFreqCaps = -1 // efc - Exclude from frequency caps\n let campaignSessionLimit = -1 // mdc - Once per session\n let campaignDailyLimit = -1 // tdc - Once per day\n let campaignTotalLimit = -1 // tlc - Once per user for the duration of campaign\n let totalDailyLimit = -1\n let totalSessionLimit = -1 // wmc - Web Popup Global Session Limit\n let totalInboxSessionLimit = -1 // wimc - Web Inbox Global Session Limit\n\n if (targetingMsgJson[DISPLAY].efc != null) { // exclude from frequency cap\n excludeFromFreqCaps = parseInt(targetingMsgJson[DISPLAY].efc, 10)\n }\n if (targetingMsgJson[DISPLAY].mdc != null) { // Campaign Session Limit\n campaignSessionLimit = parseInt(targetingMsgJson[DISPLAY].mdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tdc != null) { // No of web popups in a day per campaign\n campaignDailyLimit = parseInt(targetingMsgJson[DISPLAY].tdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tlc != null) { // Total lifetime count\n campaignTotalLimit = parseInt(targetingMsgJson[DISPLAY].tlc, 10)\n }\n if (targetingMsgJson[DISPLAY].wmp != null) { // No of campaigns per day\n totalDailyLimit = parseInt(targetingMsgJson[DISPLAY].wmp, 10)\n }\n if (targetingMsgJson[DISPLAY].wmc != null) { // No of campaigns per session\n totalSessionLimit = parseInt(targetingMsgJson[DISPLAY].wmc, 10)\n }\n\n if (targetingMsgJson[DISPLAY].wimc != null) { // No of inbox campaigns per session\n totalInboxSessionLimit = parseInt(targetingMsgJson[DISPLAY].wimc, 10)\n }\n // session level capping\n var sessionObj = campTypeObj[_session.sessionId]\n if (sessionObj) {\n const campaignSessionCount = sessionObj[campaignId]\n const totalSessionCount = sessionObj.tc\n // dnd\n if (campaignSessionCount === 'dnd' && !$ct.dismissSpamControl) {\n return false\n }\n\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n // Inbox session\n if (totalInboxSessionLimit > 0 && totalSessionCount >= totalInboxSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n } else {\n // session\n if (totalSessionLimit > 0 && totalSessionCount >= totalSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n }\n\n // campaign session\n if (campaignSessionLimit > 0 && campaignSessionCount >= campaignSessionLimit) {\n return false\n }\n } else {\n sessionObj = {}\n campTypeObj[_session.sessionId] = sessionObj\n }\n\n // daily level capping\n var dailyObj = campTypeObj[today]\n if (dailyObj != null) {\n const campaignDailyCount = dailyObj[campaignId]\n const totalDailyCount = dailyObj.tc\n // daily\n if (totalDailyLimit > 0 && totalDailyCount >= totalDailyLimit && excludeFromFreqCaps < 0) {\n return false\n }\n // campaign daily\n if (campaignDailyLimit > 0 && campaignDailyCount >= campaignDailyLimit) {\n return false\n }\n } else {\n dailyObj = {}\n campTypeObj[today] = dailyObj\n }\n\n var globalObj = campTypeObj[GLOBAL]\n if (globalObj != null) {\n const campaignTotalCount = globalObj[campaignId]\n // campaign total\n if (campaignTotalLimit > 0 && campaignTotalCount >= campaignTotalLimit) {\n return false\n }\n } else {\n globalObj = {}\n campTypeObj[GLOBAL] = globalObj\n }\n }\n // delay\n if (targetingMsgJson[DISPLAY].delay != null && targetingMsgJson[DISPLAY].delay > 0) {\n const delay = targetingMsgJson[DISPLAY].delay\n targetingMsgJson[DISPLAY].delay = 0\n setTimeout(_tr, delay * 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n return false\n }\n\n incrCount(sessionObj, campaignId, excludeFromFreqCaps)\n incrCount(dailyObj, campaignId, excludeFromFreqCaps)\n incrCount(globalObj, campaignId, excludeFromFreqCaps)\n\n let campKey = 'wp'\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n campKey = 'wi'\n }\n // get ride of stale sessions and day entries\n const newCampObj = {}\n newCampObj[_session.sessionId] = sessionObj\n newCampObj[today] = dailyObj\n newCampObj[GLOBAL] = globalObj\n saveCampaignObject({ [campKey]: newCampObj })\n }\n\n const getCookieParams = () => {\n const gcookie = _device.getGuid()\n const scookieObj = _session.getSessionCookieObject()\n return '&t=wc&d=' + encodeURIComponent(compressToBase64(gcookie + '|' + scookieObj.p + '|' + scookieObj.s))\n }\n\n const setupClickEvent = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n if (onClick !== '' && onClick != null) {\n let ctaElement\n let jsCTAElements\n if (isLegacy) {\n ctaElement = contentDiv\n } else if (contentDiv !== null) {\n jsCTAElements = contentDiv.getElementsByClassName('jsCT_CTA')\n if (jsCTAElements != null && jsCTAElements.length === 1) {\n ctaElement = jsCTAElements[0]\n }\n }\n const jsFunc = targetingMsgJson.display.jsFunc\n const isPreview = targetingMsgJson.display.preview\n if (isPreview == null) {\n onClick += getCookieParams()\n }\n\n if (ctaElement != null) {\n ctaElement.onclick = () => {\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n if (isPreview == null) {\n RequestDispatcher.fireRequest(onClick)\n }\n invokeExternalJs(jsFunc, targetingMsgJson)\n // close iframe. using -1 for no campaignId\n closeIframe('-1', divId, _session.sessionId)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n }\n }\n\n const invokeExternalJs = (jsFunc, targetingMsgJson) => {\n const func = window.parent[jsFunc]\n if (typeof func === 'function') {\n if (targetingMsgJson.display.kv != null) {\n func(targetingMsgJson.display.kv)\n } else {\n func()\n }\n }\n }\n\n const setupClickUrl = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n incrementImpression(targetingMsgJson)\n setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy)\n }\n\n const incrementImpression = (targetingMsgJson) => {\n const data = {}\n data.type = 'event'\n data.evtName = NOTIFICATION_VIEWED\n data.evtData = { [WZRK_ID]: targetingMsgJson.wzrk_id }\n if (targetingMsgJson.wzrk_pivot) {\n data.evtData = { ...data.evtData, wzrk_pivot: targetingMsgJson.wzrk_pivot }\n }\n _request.processEvent(data)\n }\n\n const renderPersonalisationBanner = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const bannerEl = document.createElement('ct-web-personalisation-banner')\n bannerEl.msgId = targetingMsgJson.wzrk_id\n bannerEl.pivotId = targetingMsgJson.wzrk_pivot\n bannerEl.divHeight = targetingMsgJson.display.divHeight\n bannerEl.details = targetingMsgJson.display.details[0]\n const containerEl = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n containerEl.innerHTML = ''\n containerEl.appendChild(bannerEl)\n }\n\n const renderPersonalisationCarousel = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-carousel') === undefined) {\n customElements.define('ct-web-personalisation-carousel', CTWebPersonalisationCarousel)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const carousel = document.createElement('ct-web-personalisation-carousel')\n carousel.target = targetingMsgJson\n const container = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n container.innerHTML = ''\n container.appendChild(carousel)\n }\n\n const renderPopUpImageOnly = (targetingMsgJson) => {\n const divId = 'wzrkImageOnlyDiv'\n const popupImageOnly = document.createElement('ct-web-popup-imageonly')\n popupImageOnly.session = _session\n popupImageOnly.target = targetingMsgJson\n const containerEl = document.getElementById(divId)\n containerEl.innerHTML = ''\n containerEl.style.visibility = 'hidden'\n containerEl.appendChild(popupImageOnly)\n }\n\n const renderFooterNotification = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const displayObj = targetingMsgJson.display\n\n if (displayObj.wtarget_type === 2) { // Handling Web Native display\n // Logic for kv pair data\n if (targetingMsgJson.msgContent.type === 1) {\n const inaObj = {}\n\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.msgContent.kv != null) {\n inaObj.kv = targetingMsgJson.msgContent.kv\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n return\n }\n }\n if (displayObj.layout === 1) { // Handling Web Exit Intent\n return showExitIntent(undefined, targetingMsgJson)\n }\n if (displayObj.layout === 3) { // Handling Web Popup Image Only\n const divId = 'wzrkImageOnlyDiv'\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById(divId) != null || document.getElementById('intentPreview') != null) {\n return\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n document.body.appendChild(msgDiv)\n if (customElements.get('ct-web-popup-imageonly') === undefined) {\n customElements.define('ct-web-popup-imageonly', CTWebPopupImageOnly)\n }\n return renderPopUpImageOnly(targetingMsgJson)\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const divId = 'wizParDiv' + displayObj.layout\n\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n if (document.getElementById(divId) != null) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = divId\n const isBanner = displayObj.layout === 2\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n const viewHeight = window.innerHeight\n const viewWidth = window.innerWidth\n let legacy = false\n\n if (!isBanner) {\n const marginBottom = viewHeight * 5 / 100\n var contentHeight = 10\n let right = viewWidth * 5 / 100\n let bottomPosition = contentHeight + marginBottom\n let width = viewWidth * 30 / 100 + 20\n let widthPerct = 'width:30%;'\n // for small devices - mobile phones\n if ((/mobile/i.test(navigator.userAgent) || (/mini/i.test(navigator.userAgent))) && /iPad/i.test(navigator.userAgent) === false) {\n width = viewWidth * 85 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:80%;'\n // medium devices - tablets\n } else if ('ontouchstart' in window || (/tablet/i.test(navigator.userAgent))) {\n width = viewWidth * 50 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:50%;'\n }\n // legacy footer notif\n if (displayObj.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden; bottom:' + bottomPosition + 'px !important;width:' + width + 'px !important;right:' + right + 'px !important;position:fixed;z-index:2147483647;')\n } else {\n msgDiv.setAttribute('style', widthPerct + displayObj.iFrameStyle)\n }\n } else {\n msgDiv.setAttribute('style', displayObj.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n\n const borderRadius = displayObj.br === false ? '0' : '8'\n\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, leftTd, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n leftTd = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n leftTd = '#f4f4f4'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"\"\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'\" + divId + \"');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"\" +\n // \"\"+\n '' + imageTd + \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
'\n html = css + title + body\n }\n\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n const ifrm = (iframe.contentWindow) ? iframe.contentWindow : (iframe.contentDocument.document) ? iframe.contentDocument.document : iframe.contentDocument\n const doc = ifrm.document\n\n // Dispatch event for popup box/banner close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n doc.open()\n doc.write(html)\n\n if (displayObj['custom-editor']) {\n appendScriptForCustomEvent(targetingMsgJson, doc)\n }\n doc.close()\n\n const adjustIFrameHeight = () => {\n // adjust iframe and body height of html inside correctly\n contentHeight = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv').scrollHeight\n if (displayObj['custom-editor'] !== true && !isBanner) {\n contentHeight += 25\n }\n document.getElementById('wiz-iframe').contentDocument.body.style.margin = '0px'\n document.getElementById('wiz-iframe').style.height = contentHeight + 'px'\n }\n\n const ua = navigator.userAgent.toLowerCase()\n if (ua.indexOf('safari') !== -1) {\n if (ua.indexOf('chrome') > -1) {\n iframe.onload = () => {\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n } else {\n let inDoc = iframe.contentDocument || iframe.contentWindow\n if (inDoc.document) inDoc = inDoc.document\n // safari iphone 7+ needs this.\n adjustIFrameHeight()\n const _timer = setInterval(() => {\n if (inDoc.readyState === 'complete') {\n clearInterval(_timer)\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }, 10)\n }\n } else {\n iframe.onload = () => {\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }\n }\n\n const appendScriptForCustomEvent = (targetingMsgJson, doc) => {\n const script = doc.createElement('script')\n script.innerHTML = `\n const ct__camapignId = '${targetingMsgJson.wzrk_id}';\n const ct__formatVal = (v) => {\n return v && v.trim().substring(0, 20);\n }\n const ct__parentOrigin = window.parent.origin;\n document.body.addEventListener('click', (event) => {\n const elem = event.target.closest?.('a[wzrk_c2a], button[wzrk_c2a]');\n if (elem) {\n const {innerText, id, name, value, href} = elem;\n const clickAttr = elem.getAttribute('onclick') || elem.getAttribute('click');\n const onclickURL = clickAttr?.match(/(window.open)[(\\](\\\"|')(.*)(\\\"|',)/)?.[3] || clickAttr?.match(/(location.href *= *)(\\\"|')(.*)(\\\"|')/)?.[3];\n const props = {innerText, id, name, value};\n let msgCTkv = Object.keys(props).reduce((acc, c) => {\n const formattedVal = ct__formatVal(props[c]);\n formattedVal && (acc['wzrk_click_' + c] = formattedVal);\n return acc;\n }, {});\n if(onclickURL) { msgCTkv['wzrk_click_' + 'url'] = onclickURL; }\n if(href) { msgCTkv['wzrk_click_' + 'c2a'] = href; }\n const notifData = { msgId: ct__camapignId, msgCTkv, pivotId: '${targetingMsgJson.wzrk_pivot}' };\n window.parent.clevertap.renderNotificationClicked(notifData);\n }\n });\n `\n doc.body.appendChild(script)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe-intent'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n const ifrm = (iframe.contentWindow) ? iframe.contentWindow : (iframe.contentDocument.document) ? iframe.contentDocument.document : iframe.contentDocument\n const doc = ifrm.document\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n doc.open()\n doc.write(html)\n if (targetingMsgJson.display['custom-editor']) {\n appendScriptForCustomEvent(targetingMsgJson, doc)\n }\n doc.close()\n\n const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n // const renderVisualBuilder = (targetingMsgJson) => {\n // const details = targetingMsgJson.display.details[0]\n // const siteUrl = Object.keys(details)[0]\n // const selectors = details[siteUrl]\n\n // if (siteUrl === window.location.href) {\n // for (const selector in selectors) {\n // const element = document.querySelector(selector)\n // if (element) {\n // element.outerHTML = selectors[selector].html\n // window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n // } else {\n // let count = 0\n // const intervalId = setInterval(() => {\n // const retryElement = document.querySelector(selector)\n // if (retryElement) {\n // retryElement.outerHTML = selectors[selector].html\n // window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n // clearInterval(intervalId)\n // } else {\n // count++\n // if (count >= 20) {\n // console.log(`No element present on DOM with selector '${selector}'.`)\n // clearInterval(intervalId)\n // }\n // }\n // }, 500)\n // }\n // }\n // }\n // }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n this.#logger.error('Error subscribing: ' + error)\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { initialiseCTBuilder } from './modules/visualBuilder/pageBuilder'\n// import { initialiseCTBuilder, renderVisualBuilder } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token) {\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n pageChanged () {\n const search = window.location.search\n if (search === '?ctBuilder') {\n // open in visual builder mode\n console.log('open in visual builder mode')\n initialiseCTBuilder()\n return\n }\n if (search === '?ctBuilderPreview') {\n // open preview\n console.log('open in visual builder mode')\n // renderVisualBuilder(targetingMsgJson, true)\n return\n }\n\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","constructor","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","dataPostPEURL","dataPostURL","recorderURL","emailURL","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","save","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","read","data","getItem","parse","e","remove","removeItem","removeCookie","name","domain","cookieStr","document","cookie","createCookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","readCookie","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","saveToLSorCookie","property","location","hostname","$ct","globalCache","readFromLSorCookie","trim","err","createBroadCookie","broadDomain","domainParts","testBroadDomain","testCookieName","tempCookie","getMetaProp","metaObj","setMetaProp","wzrkMetaObj","getAndClearMetaProp","setInstantDeleteFlagInK","k","flag","backupEvent","reqNo","backupArr","q","debug","removeBackup","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","get","item","saveCacheToLS","set","allKeys","objToArray","index","temp","getKey","getSecondLastKey","keysArr","getLastKey","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","s","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","sessionObj","getSessionCookieObject","kIdFromLS","guidFromLRUCache","lastK","lastGUID","unregisterTokenForGuid","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","_processOldValues","getDetails","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","fireRequest","skipARP","sendOULFlag","getDelayFrequency","account","randomDelay","random","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","ProfileHandler","profilesArr","getAttribute","propName","_handleIncrementDecrementValue","command","tz","profile","addSystemDataToObject","addFlags","compressedData","saveAndFireRequest","_handleMultiValueSet","arrayVal","array","toLowerCase","sendMultiValueData","_handleMultiValueAdd","propKey","propVal","_handleMultiValueRemove","_handleMultiValueDelete","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","clear","addToK","ids","g","kId","anonymousUser","foundInCache","gFromCache","Identity","cookieName","loginArr","pop","processProfile","CTWebPersonalisationBanner","HTMLElement","_details","shadow","attachShadow","mode","details","renderBanner","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","target","renderCarousel","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","button","setInterval","sliderTime","goTo","prev","cur","CTWebPopupImageOnly","_session","popup","container","resizeObserver","renderImageOnlyPopup","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","Message","config","message","wrapper","snackBar","renderMessage","createEl","part","_el","msg","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","raiseClickedEvent","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","contains","setBadgeStyle","msgCount","incomingMessages","msgs","updateInboxMessages","incomingMessagesForPreview","previewMsgs","now","buildUIForMessages","updateUnviewedBadgeCounter","connectedCallback","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","addMsgsToInboxFromLS","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","deleteMsgsFromUI","getInboxMessages","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","top","right","getBoundingClientRect","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","inbox_notifs","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","initialiseCTBuilder","onContentLoad","position","overlayPath","loadOverlayScript","then","catch","loadCSS","loadTypeKit","link","rel","head","script","src","onload","Overlay","Error","onerror","kitId","scriptTimeout","h","documentElement","className","tk","onreadystatechange","Typekit","load","renderVisualBuilder","targetingMsgJson","siteUrl","selectors","selector","element","querySelector","outerHTML","intervalId","retryElement","_tr","_device","_request","_logger","_wizCounter","j_n","i_n","d_ts","dh","j_s","e_ts","r_ts","rc_w","rc_n","inapp_notifs","wtarget_type","wmc","ff","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","onclick","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","inaObj","kvPairsEvent","CustomEvent","dispatchEvent","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","pointerCss","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","ifrm","contentWindow","contentDocument","doc","closeCampaign","Event","write","appendScriptForCustomEvent","close","adjustIFrameHeight","scrollHeight","margin","ua","inDoc","_timer","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","getTotalVisits","visitCount","getLastVisit","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","info","debugPE","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","getTimeElapsed","sessionStart","getPageCount","seqNo","requestTime","RequestManager","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","post","fetch","method","headers","response","ok","json","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","_enableWebPush","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","skipDialog","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","getValue","getdefaultValue","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","addValueChangedCallback","removeValueChangedCallback","clearStartFlag","VariableStore","syncVariables","onSyncSuccess","onSyncFailure","meta","r","status","fetchVariables","onFetchCallback","addVariablesChangedCallback","callback","addOneTimeVariablesChangedCallback","removeVariablesChangedCallback","removeOneTimeVariablesChangedCallback","callBack","CleverTap","spa","isSpa","bind","enablePersonalization","_isPersonalisationActive","ReqestManager","onUserLogin","privacy","notifications","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","handleDecrementValue","setMultiValuesForKey","addMultiValueForKey","addMultiValuesForKey","removeMultiValueForKey","removeMultiValuesForKey","removeValueForKey","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","sendLocationData","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","elements","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","setOffline","arg","defineVariable","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;EAAO,MAAMA,aAAa,GAAG,oBAAtB;EACA,MAAMC,eAAe,GAAG,Q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;;EACA,MAAI+H,IAAI,GAAG,EAAX;EACAA,EAAAA,IAAI,GAAG,0DAAcqX,qBAAd,CAAoCrX,IAApC,EAA0C7C,SAA1C,CAAP;EACAkS,EAAAA,WAAW,GAAGzD,QAAQ,CAACyD,WAAD,EAAc,MAAd,EAAsBpV,QAAtB,CAAtB;EACAoV,EAAAA,WAAW,GAAGzD,QAAQ,CAACyD,WAAD,EAAc,GAAd,EAAmB3C,YAAY,CAAC7M,IAAI,CAACC,SAAL,CAAeE,IAAf,CAAD,8BAAuB,IAAvB,wBAA/B,CAAtB;;EAEA,4DAAcwX,kBAAd,CAAiCnI,WAAjC,EAA8CpN,GAAG,CAACgC,YAAlD;EACD;;yDAEoB;EACnB,SAAQ,OAAOrC,MAAM,CAAC6qC,MAAd,KAAyB,WAAzB,IAAwC7qC,MAAM,CAAC6qC,MAAP,CAAcC,IAAd,KAAuB,YAAvE;EACD;;yDAMmB1sC,MAAM;EACxB,MAAI,KAAK8lC,wBAAL,EAAJ,EAAqC;EACnC9lC,IAAAA,IAAI,CAACw+B,KAAL,GAAa,IAAb;EACD;EACF;;QC5wBG9uB,SAAS,GAAG,IAAIi9B,SAAJ,CAAc/qC,MAAM,CAAC8N,SAArB;EAElB9N,MAAM,CAAC8N,SAAP,GAAmB9N,MAAM,CAAC+N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file diff --git a/clevertap.min.js b/clevertap.min.js index 03f5e830..68268fbc 100644 --- a/clevertap.min.js +++ b/clevertap.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).clevertap=t()}(this,(function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var i=0;ie.length)&&(t=e.length);for(var i=0,n=new Array(t);i=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a=!0,s=!1;return{s:function(){i=e[Symbol.iterator]()},n:function(){var e=i.next();return a=e.done,e},e:function(e){s=!0,r=e},f:function(){try{a||null==i.return||i.return()}finally{if(s)throw r}}}}var w=0;function k(e){return"__private_"+w+++"_"+e}function C(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var x,P="clevertap-prod.com",S="https:",O=k("accountId"),I=k("region"),_=k("targetDomain"),E=k("dcSdkversion"),A=k("token"),M=function(){function e(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=i.id,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:P,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";t(this,e),Object.defineProperty(this,O,{writable:!0,value:void 0}),Object.defineProperty(this,I,{writable:!0,value:""}),Object.defineProperty(this,_,{writable:!0,value:P}),Object.defineProperty(this,E,{writable:!0,value:""}),Object.defineProperty(this,A,{writable:!0,value:""}),this.id=n,o&&(this.region=o),r&&(this.targetDomain=r),a&&(this.token=a)}return n(e,[{key:"id",get:function(){return C(this,O)[O]},set:function(e){C(this,O)[O]=e}},{key:"region",get:function(){return C(this,I)[I]},set:function(e){C(this,I)[I]=e}},{key:"dcSDKVersion",get:function(){return C(this,E)[E]},set:function(e){C(this,E)[E]=e}},{key:"targetDomain",get:function(){return C(this,_)[_]},set:function(e){C(this,_)[_]=e}},{key:"token",get:function(){return C(this,A)[A]},set:function(e){C(this,A)[A]=e}},{key:"finalTargetDomain",get:function(){return this.region?"".concat(this.region,".").concat(this.targetDomain):this.targetDomain===P?"".concat("eu1",".").concat(this.targetDomain):this.targetDomain}},{key:"dataPostPEURL",get:function(){return"".concat(S,"//").concat(this.finalTargetDomain,"/defineVars")}},{key:"dataPostURL",get:function(){return"".concat(S,"//").concat(this.finalTargetDomain,"/a?t=96")}},{key:"recorderURL",get:function(){return"".concat(S,"//").concat(this.finalTargetDomain,"/r?r=1")}},{key:"emailURL",get:function(){return"".concat(S,"//").concat(this.finalTargetDomain,"/e?r=1")}}]),e}(),L=new RegExp("^\\s+|\\.|:|\\$|'|\"|\\\\|\\s+$","g"),R=new RegExp("^\\s+|'|\"|\\\\|\\s+$","g"),T=new RegExp("'","g"),j="clear",D="Charged ID",z="WZRK_CHARGED_ID",B="WZRK_G",N="WZRK_K",F="WZRK_CAMP",U="WZRK_CAMP_G",q="WZRK_EV",V="WZRK_META",W="WZRK_PR",K="WZRK_ARP",G="WZRK_L",H="global",J="optOut",Z="useIP",$="WZRK_X",Y="push",Q=31536e3,X="2",ee="wzrk_",te="wzrk_id",ie="Notification Viewed",ne="Notification Clicked",oe="WZRK_FPU",re="WZRK_PSD",ae="$incr",se="$decr",le="$set",ce="$add",de="$remove",ue="$delete",pe="WZRK_INBOX_CONFIG",he="WZRK_INBOX",fe=1e3,ge="wzrk_fetch",ve=["Stayed","UTM Visited","App Launched","Notification Sent",ie,ne],be=function(e){return"string"==typeof e||e instanceof String},ye=function(e){return"[object Object]"===Object.prototype.toString.call(e)},me=function(t){return"object"===e(t)&&t instanceof Date},we=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},ke=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},Ce=function(e){return/^-?[\d.]+(?:e-?\d+)?$/.test(e)&&"number"==typeof e},xe=function(e){return null!=e&&"undefined"!==e},Pe=function t(i,n){var o;if("object"!==e(i))return be(i)?(o=Se(i,R)).length>1024&&(o=o.substring(0,1024),n.reportError(521,o+"... length exceeded 1024 chars. Trimmed.")):o=i,o;for(var r in i)if(i.hasOwnProperty(r)){var a=t(i[r],n),s=void 0;(s=Se(r,L)).length>1024&&(s=s.substring(0,1024),n.reportError(520,s+"... length exceeded 1024 chars. Trimmed.")),delete i[r],i[s]=a}return i},Se=function(e,t){return e.replace(t,"")},Oe=function(){var e=new Date;return e.getFullYear()+""+e.getMonth()+e.getDay()},Ie=function(){return Math.floor((new Date).getTime()/1e3)},_e=function(e){return"$D_"+Math.round(e.getTime()/1e3)},Ee=function(e){if(Ae(e))return"$D_"+e},Ae=function(e){var t=/^(\d{4})(\d{2})(\d{2})$/.exec(e);if(null==t)return!1;var i=t[3],n=t[2]-1,o=t[1],r=new Date(o,n,i);return r.getDate()==i&&r.getMonth()==n&&r.getFullYear()==o},Me=function(){function e(){t(this,e)}return n(e,null,[{key:"save",value:function(e,t){return!(!e||!t)&&(this._isLocalStorageSupported()?(localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),!0):void 0)}},{key:"read",value:function(e){if(!e)return!1;var t=null;if(this._isLocalStorageSupported()&&(t=localStorage.getItem(e)),null!=t)try{t=JSON.parse(t)}catch(e){}return t}},{key:"remove",value:function(e){return!!e&&(this._isLocalStorageSupported()?(localStorage.removeItem(e),!0):void 0)}},{key:"removeCookie",value:function(e,t){var i=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";t&&(i=i+" domain="+t+"; path=/"),document.cookie=i}},{key:"createCookie",value:function(e,t,i,n){var o="",r="";if(i){var a=new Date;a.setTime(a.getTime()+1e3*i),o="; expires="+a.toGMTString()}n&&(r="; domain="+n),t=encodeURIComponent(t),document.cookie=e+"="+t+o+r+"; path=/"}},{key:"readCookie",value:function(e){for(var t=e+"=",i=document.cookie.split(";"),n=0;n=0;s--){if(a=0===s?r[s]+a:"."+r[s]+a,this.readCookie(e)){var l="test_"+e+s;if(this.createCookie(l,t,10,a),!this.readCookie(l))continue;this.removeCookie(l,a)}if(this.createCookie(e,t,i,a),this.readCookie(e)==t){o=a,Le.broadDomain=o;break}}else this.createCookie(e,t,i,o)}else this.createCookie(e,t,i,n)}},{key:"getMetaProp",value:function(e){var t=this.readFromLSorCookie(V);if(null!=t)return t[e]}},{key:"setMetaProp",value:function(e,t){if(this._isLocalStorageSupported()){var i=this.readFromLSorCookie(V);null==i&&(i={}),void 0===t?delete i[e]:i[e]=t,this.saveToLSorCookie(V,i)}}},{key:"getAndClearMetaProp",value:function(e){var t=this.getMetaProp(e);return this.setMetaProp(e,void 0),t}},{key:"setInstantDeleteFlagInK",value:function(){var e=this.readFromLSorCookie(N);null==e&&(e={}),e.flag=!0,this.saveToLSorCookie(N,e)}},{key:"backupEvent",value:function(e,t,i){var n=this.readFromLSorCookie(G);void 0===n&&(n={}),n[t]={q:e},this.saveToLSorCookie(G,n),i.debug("stored in ".concat(G," reqNo : ").concat(t," -> ").concat(e))}},{key:"removeBackup",value:function(e,t){var i=this.readFromLSorCookie(G);null!=i&&void 0!==i[e]&&(t.debug("del event: ".concat(e," data-> ").concat(i[e].q)),delete i[e],this.saveToLSorCookie(G,i))}}]),e}(),Le={globalCache:{gcookie:null,REQ_N:0,RESP_N:0},LRU_CACHE:null,globalProfileMap:void 0,globalEventsMap:void 0,blockRequest:!1,isOptInRequest:!1,broadDomain:null,webPushEnabled:null,campaignDivMap:{},currentSessionId:null,wiz_counter:0,notifApi:{notifEnabledFromApi:!1},unsubGroups:[],updatedCategoryLong:null,inbox:null,isPrivacyArrPushed:!1,privacyArray:[],offline:!1,location:null,dismissSpamControl:!1,globalUnsubscribe:!0,flutterVersion:null,variableStore:{}},Re=k("keyOrder"),Te=k("deleteFromObject"),je=function(){function e(i){t(this,e),Object.defineProperty(this,Te,{value:De}),Object.defineProperty(this,Re,{writable:!0,value:void 0}),this.max=i;var n=Me.readFromLSorCookie($);if(n){var o={};for(var r in C(this,Re)[Re]=[],n=n.cache)n.hasOwnProperty(r)&&(o[n[r][0]]=n[r][1],C(this,Re)[Re].push(n[r][0]));this.cache=o}else this.cache={},C(this,Re)[Re]=[]}return n(e,[{key:"get",value:function(e){var t=this.cache[e];return t&&(this.cache=C(this,Te)[Te](e,this.cache),this.cache[e]=t,C(this,Re)[Re].push(e)),this.saveCacheToLS(this.cache),t}},{key:"set",value:function(e,t){var i=this.cache[e],n=C(this,Re)[Re];null!=i?this.cache=C(this,Te)[Te](e,this.cache):n.length===this.max&&(this.cache=C(this,Te)[Te](n[0],this.cache)),this.cache[e]=t,C(this,Re)[Re][C(this,Re)[Re]-1]!==e&&C(this,Re)[Re].push(e),this.saveCacheToLS(this.cache)}},{key:"saveCacheToLS",value:function(e){var t=[],i=C(this,Re)[Re];for(var n in i)if(i.hasOwnProperty(n)){var o=[];o.push(i[n]),o.push(e[i[n]]),t.push(o)}Me.saveToLSorCookie($,{cache:t})}},{key:"getKey",value:function(e){if(null===e)return null;var t=C(this,Re)[Re];for(var i in t)if(t.hasOwnProperty(i)&&this.cache[t[i]]===e)return t[i];return null}},{key:"getSecondLastKey",value:function(){var e=C(this,Re)[Re];return null!=e&&e.length>1?e[e.length-2]:-1}},{key:"getLastKey",value:function(){var e=C(this,Re)[Re].length;if(e)return C(this,Re)[Re][e-1]}}]),e}(),De=function(e,t){var i,n=JSON.parse(JSON.stringify(C(this,Re)[Re])),o={};for(var r in n)n.hasOwnProperty(r)&&(n[r]!==e?o[n[r]]=t[n[r]]:i=r);return n.splice(i,1),C(this,Re)[Re]=JSON.parse(JSON.stringify(n)),o},ze=k("logger"),Be=k("request"),Ne=k("device"),Fe=k("session"),Ue=function(){function e(i){var n=i.logger,o=i.request,r=i.device,a=i.session;t(this,e),Object.defineProperty(this,ze,{writable:!0,value:void 0}),Object.defineProperty(this,Be,{writable:!0,value:void 0}),Object.defineProperty(this,Ne,{writable:!0,value:void 0}),Object.defineProperty(this,Fe,{writable:!0,value:void 0}),C(this,ze)[ze]=n,C(this,Be)[Be]=o,C(this,Ne)[Ne]=r,C(this,Fe)[Fe]=a}return n(e,[{key:"s",value:function(e,t,i,n,o){var r=!1,a=!1;if(window.isOULInProgress&&(i||"undefined"!==n&&n===window.oulReqN)&&(window.isOULInProgress=!1,r=!0),void 0===n&&(n=0),Me.removeBackup(n,C(this,ze)[ze]),!(n>Le.globalCache.REQ_N)){if(xe(C(this,Ne)[Ne].gcookie)||e&&(a=!0),!xe(C(this,Ne)[Ne].gcookie)||i||"boolean"==typeof o){var s=C(this,Fe)[Fe].getSessionCookieObject();if(window.isOULInProgress||s.s&&t50&&t.reportError(522,"Charged Items exceed 50 limit. Actual count: "+e[i].length),e[i])if(e[i].hasOwnProperty(n)&&(!ye(e[i][n])||!it(e[i][n])))return!1}else{if(ye(e[i])||Array.isArray(e[i]))return!1;me(e[i])&&(e[i]=_e(e[i]))}if(be(e[D])||Ce(e[D])){var o=e[D]+"";if(void 0===x&&(x=Me.readFromLSorCookie(z)),void 0!==x&&x.trim()===o.trim())return t.error("Duplicate charged Id - Dropped"+e),!1;x=o,Me.saveToLSorCookie(z,o)}return!0}return!1},ot=k("logger"),rt=k("oldValues"),at=k("request"),st=k("isPersonalisationActive"),lt=k("processEventArray"),ct=function(e){s(o,e);var i=g(o);function o(e,n){var r,a=e.logger,s=e.request,l=e.isPersonalisationActive;return t(this,o),r=i.call(this),Object.defineProperty(h(r),lt,{value:dt}),Object.defineProperty(h(r),ot,{writable:!0,value:void 0}),Object.defineProperty(h(r),rt,{writable:!0,value:void 0}),Object.defineProperty(h(r),at,{writable:!0,value:void 0}),Object.defineProperty(h(r),st,{writable:!0,value:void 0}),C(h(r),ot)[ot]=a,C(h(r),rt)[rt]=n,C(h(r),at)[at]=s,C(h(r),st)[st]=l,r}return n(o,[{key:"push",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i0;){var t=e.shift();if(be(t))if(t.length>1024&&(t=t.substring(0,1024),C(this,ot)[ot].reportError(510,t+"... length exceeded 1024 chars. Trimmed.")),ve.includes(t))C(this,ot)[ot].reportError(513,t+" is a restricted system event. It cannot be used as an event name.");else{var i={type:"event"};if(i.evtName=Se(t,L),0!==e.length){var n=e.shift();if(ye(n)){if("Charged"===t){if(!nt(n,C(this,ot)[ot])){C(this,ot)[ot].reportError(511,"Charged event structure invalid. Not sent.");continue}}else if(!it(n)){C(this,ot)[ot].reportError(512,t+" event structure invalid. Not sent.");continue}i.evtData=n}else e.unshift(n)}C(this,at)[at].processEvent(i)}else C(this,ot)[ot].error(He)}},ut=function(e){var t={},i=e.indexOf("?");if(i>1){var n,o=e.substring(i+1),r=/\+/g,a=/([^&=]+)=?([^&]*)/g,s=function(e){var t=e.replace(r," ");try{t=decodeURIComponent(t)}catch(e){}return t};for(n=a.exec(o);n;)t[s(n[1])]=s(n[2]),n=a.exec(o)}return t},pt=function(e,t,i){return e+"&"+t+"="+encodeURIComponent(i)},ht=function(){return window.location.hostname},ft=function(e,t){return t&&"function"==typeof t.debug&&t.debug("dobj:"+e),vt(e)},gt=function(){var e="",t=0;for(t=0;t<=25;t++)e+=String.fromCharCode(t+65);for(t=0;t<=25;t++)e+=String.fromCharCode(t+97);for(t=0;t<10;t++)e+=t;return e+"+/="}(),vt=function(e){if(null==e)return"";var t,i,n,o,r,a,s,l="",c=0;for(e=function(e){if(null==e)return"";var t,i,n,o={},r={},a="",s="",l="",c=2,d=3,u=2,p="",h=0,f=0,g=String.fromCharCode;for(n=0;n>=1}else{for(i=1,t=0;t>=1}0==--c&&(c=Math.pow(2,u),u++),delete r[l]}else for(i=o[l],t=0;t>=1;0==--c&&(c=Math.pow(2,u),u++),o[s]=d++,l=String(a)}if(""!==l){if(Object.prototype.hasOwnProperty.call(r,l)){if(l.charCodeAt(0)<256){for(t=0;t>=1}else{for(i=1,t=0;t>=1}0==--c&&(c=Math.pow(2,u),u++),delete r[l]}else for(i=o[l],t=0;t>=1;0==--c&&(c=Math.pow(2,u),u++)}for(i=2,t=0;t>=1;for(;;){if(h<<=1,15==f){p+=g(h);break}f++}return p}(e);c<2*e.length;)c%2==0?(t=e.charCodeAt(c/2)>>8,i=255&e.charCodeAt(c/2),n=c/2+1>8:NaN):(t=255&e.charCodeAt((c-1)/2),(c+1)/2>8,n=255&e.charCodeAt((c+1)/2)):i=n=NaN),c+=3,o=t>>2,r=(3&t)<<4|i>>4,a=(15&i)<<2|n>>6,s=63&n,isNaN(i)?a=s=64:isNaN(n)&&(s=64),l=l+gt.charAt(o)+gt.charAt(r)+gt.charAt(a)+gt.charAt(s);return l},bt=k("fireRequest"),yt=k("dropRequestDueToOptOut"),mt=k("addUseIPToRequest"),wt=k("addARPToRequest"),kt=function(){function e(){t(this,e),this.networkRetryCount=0,this.minDelayFrequency=0}return n(e,[{key:"getDelayFrequency",value:function(){if(this.logger.debug("Network retry #"+this.networkRetryCount),this.networkRetryCount<10)return this.logger.debug(this.account.id,"Failure count is "+this.networkRetryCount+". Setting delay frequency to 1s"),this.minDelayFrequency=fe,this.minDelayFrequency;if(null==this.account.region)return this.logger.debug(this.account.id,"Setting delay frequency to 1s"),fe;var e=1e3*(Math.floor(10*Math.random())+1);return this.minDelayFrequency+=e,this.minDelayFrequency<6e5?(this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency):(this.minDelayFrequency=fe,this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency)}}],[{key:"fireRequest",value:function(e,t,i,n){C(this,bt)[bt](e,1,t,i,n)}}]),e}();kt.logger=void 0,kt.device=void 0,kt.account=void 0,Object.defineProperty(kt,bt,{value:function(e,t,i,n,o){var r,a,s=this;if(C(this,yt)[yt]())this.logger.debug("req dropped due to optout cookie: "+this.device.gcookie);else{if(xe(this.device.gcookie)||(Le.blockRequest=!0),o&&o===ge)!xe(this.device.gcookie)&&Le.globalCache.RESP_N url: "+e)}}}),Object.defineProperty(kt,yt,{value:function(){return!Le.isOptInRequest&&xe(this.device.gcookie)&&be(this.device.gcookie)?":OO"===this.device.gcookie.slice(-3):(Le.isOptInRequest=!1,!1)}}),Object.defineProperty(kt,mt,{value:function(e){var t=Me.getMetaProp(Z);return"boolean"!=typeof t&&(t=!1),pt(e,Z,t?"true":"false")}}),Object.defineProperty(kt,wt,{value:function(e,t){if(!0===t){var i={skipResARP:!0};return pt(e,"arp",ft(JSON.stringify(i),this.logger))}return Me._isLocalStorageSupported()&&void 0!==localStorage.getItem(K)&&null!==localStorage.getItem(K)?pt(e,"arp",ft(JSON.stringify(Me.readFromLSorCookie(K)),this.logger)):e}});var Ct=function(){var e={};if(Me._isLocalStorageSupported()){var t=Me.read(F);null!=t?(t=JSON.parse(decodeURIComponent(t).replace(T,'"'))).hasOwnProperty("global")?e.wp=t:e=t:e={}}return e},xt=function(e){if(Me._isLocalStorageSupported()){var t=a(a({},Ct()),e),i=JSON.stringify(t);Me.save(F,encodeURIComponent(i)),Pt()}},Pt=function(){if(Me._isLocalStorageSupported()){var e=Me.read(B);if(xe(e))try{e=JSON.parse(decodeURIComponent(Me.read(B)));var t=Me.read(U)?JSON.parse(decodeURIComponent(Me.read(U))):{};if(e&&Me._isLocalStorageSupported()){var i={},n=Ct();Object.keys(n).forEach((function(r){var s=e in t&&Object.keys(t[e]).length&&t[e][r]?t[e][r]:{},l=n[r].global,c=Oe(),d=n[r][c];if(void 0!==l){var u=Object.keys(l);for(var p in u){var h=[];if(u.hasOwnProperty(p)){var f=0,g=0,v=u[p];if("tc"===v)continue;void 0!==d&&void 0!==d[v]&&(f=d[v]),void 0!==l&&void 0!==l[v]&&(g=l[v]),h=[v,f,g],s[v]=h}}}i=a(a({},i),{},o({},r,s))})),t[e]=i,Me.save(U,encodeURIComponent(JSON.stringify(t)))}}catch(e){console.error("Invalid clevertap Id "+e)}}},St=function(){var e=JSON.parse(decodeURIComponent(Me.read(B))),t={};if(Me._isLocalStorageSupported()){t=Ct();var i=Me.read(U),n=i?decodeURIComponent(i):null,o=n?JSON.parse(n):null,r=e&&null!=i&&o&&o[e]&&o[e].wp?Object.values(o[e].wp):[],a=e&&null!=i&&o&&o[e]&&o[e].wi?Object.values(o[e].wi):[],s=Oe(),l=0,c=0;return t.wp&&t.wp[s]&&"undefined"!==t.wp[s].tc&&(l=t.wp[s].tc),t.wi&&t.wi[s]&&"undefined"!==t.wi[s].tc&&(c=t.wi[s].tc),{wmp:l,wimp:c,tlc:r,witlc:a}}},Ot=function(e,t){var i=t.logger,n=!1;if(ye(e))for(var o in e)if(e.hasOwnProperty(o)){n=!0;var r=e[o];if(null==r){delete e[o];continue}"Gender"!==o||r.match(/^M$|^F$/)||(n=!1,i.error(Je)),"Employed"!==o||r.match(/^Y$|^N$/)||(n=!1,i.error(Ze)),"Married"!==o||r.match(/^Y$|^N$/)||(n=!1,i.error($e)),"Education"!==o||r.match(/^School$|^College$|^Graduate$/)||(n=!1,i.error(Ye)),"Age"===o&&null!=r&&(ke(r)?e.Age=+r:(n=!1,i.error(Qe))),"DOB"===o?(/^\$D_/.test(r)&&11===(r+"").length||me(r)||(n=!1,i.error(Xe)),me(r)&&(e[o]=_e(r))):me(r)&&(e[o]=_e(r)),"Phone"!==o||we(r)||(r.length>8&&"+"===r.charAt(0)?(r=r.substring(1,r.length),ke(r)?e.Phone=+r:(n=!1,i.error(tt+". Removed."))):(n=!1,i.error(tt+". Removed."))),n||delete e[o]}return n},It=function(e){var t={};t.Name=e.name,null!=e.id&&(t.FBID=e.id+""),"male"===e.gender?t.Gender="M":"female"===e.gender?t.Gender="F":t.Gender="O";null!=e.relationship_status&&(t.Married="N","Married"===e.relationship_status&&(t.Married="Y"));var i=function(e){if(null!=e){for(var t="",i="",n=0;n0?"Y":"N",null!=e.email&&(t.Email=e.email),null!=e.birthday){var o=e.birthday.split("/");t.DOB=Ee(o[2]+o[0]+o[1])}return t},_t=function(e,t){var i=t.logger,n={};if(null!=e.displayName&&(n.Name=e.displayName),null!=e.id&&(n.GPID=e.id+""),null!=e.gender&&("male"===e.gender?n.Gender="M":"female"===e.gender?n.Gender="F":"other"===e.gender&&(n.Gender="O")),null!=e.image&&!1===e.image.isDefault&&(n.Photo=e.image.url.split("?sz")[0]),null!=e.emails)for(var o=0;o0)for(var t in e)if(e.hasOwnProperty(t)){var i=e[t],n={},o=void 0;if(null!=i.Site){if(o=i.Site,we(o)||!Ot(o,{logger:C(this,Rt)[Rt]}))return}else if(null!=i.Facebook){var r=i.Facebook;we(r)||r.error||(o=It(r))}else if(null!=i["Google Plus"]){var a=i["Google Plus"];we(a)||a.error||(o=_t(a,{logger:C(this,Rt)[Rt]}))}if(null!=o&&!we(o)){n.type="profile",null==o.tz&&(o.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),n.profile=o,Et(o,!0),n=C(this,Tt)[Tt].addSystemDataToObject(n,void 0),C(this,Tt)[Tt].addFlags(n);var s=ft(JSON.stringify(n),C(this,Rt)[Rt]),l=C(this,jt)[jt].dataPostURL;l=pt(l,"type",Y),l=pt(l,"d",s),C(this,Tt)[Tt].saveAndFireRequest(l,Le.blockRequest)}}},Ut=k("request"),qt=k("logger"),Vt=k("account"),Wt=k("session"),Kt=k("oldValues"),Gt=k("device"),Ht=k("processOUL"),Jt=k("handleCookieFromCache"),Zt=k("deleteUser"),$t=k("processLoginArray"),Yt=function(e){s(o,e);var i=g(o);function o(e,n){var r,a=e.request,s=e.account,l=e.session,c=e.logger,d=e.device;return t(this,o),r=i.call(this),Object.defineProperty(h(r),$t,{value:ti}),Object.defineProperty(h(r),Zt,{value:ei}),Object.defineProperty(h(r),Jt,{value:Xt}),Object.defineProperty(h(r),Ht,{value:Qt}),Object.defineProperty(h(r),Ut,{writable:!0,value:void 0}),Object.defineProperty(h(r),qt,{writable:!0,value:void 0}),Object.defineProperty(h(r),Vt,{writable:!0,value:void 0}),Object.defineProperty(h(r),Wt,{writable:!0,value:void 0}),Object.defineProperty(h(r),Kt,{writable:!0,value:void 0}),Object.defineProperty(h(r),Gt,{writable:!0,value:void 0}),C(h(r),Ut)[Ut]=a,C(h(r),Vt)[Vt]=s,C(h(r),Wt)[Wt]=l,C(h(r),qt)[qt]=c,C(h(r),Kt)[Kt]=n,C(h(r),Gt)[Gt]=d,r}return n(o,[{key:"clear",value:function(){C(this,qt)[qt].debug("clear called. Reset flag has been set."),C(this,Zt)[Zt](),Me.setMetaProp(j,!0)}},{key:"push",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i0)for(var o in e)if(e.hasOwnProperty(o)){var r=e[o],a={},s=void 0;if(null!=r.Site){if(s=r.Site,we(s)||!Ot(s,{logger:C(this,qt)[qt]}))return}else if(null!=r.Facebook){var l=r.Facebook;we(l)||l.error||(s=It(l))}else if(null!=r["Google Plus"]){var c=r["Google Plus"];we(c)&&!c.error&&(s=_t(c,{logger:C(this,qt)[qt]}))}if(null!=s&&!we(s)){a.type="profile",null==s.tz&&(s.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),a.profile=s;var d=[];Me._isLocalStorageSupported()&&(s.Identity&&d.push(s.Identity),s.Email&&d.push(s.Email),s.GPID&&d.push("GP:"+s.GPID),s.FBID&&d.push("FB:"+s.FBID),d.length>0&&n(d)),Et(s,!0),a=C(this,Ut)[Ut].addSystemDataToObject(a,void 0),C(this,Ut)[Ut].addFlags(a),i&&(a.isOUL=!0);var u=ft(JSON.stringify(a),C(this,qt)[qt]),p=C(this,Vt)[Vt].dataPostURL;p=pt(p,"type",Y),p=pt(p,"d",u),C(this,Ut)[Ut].saveAndFireRequest(p,Le.blockRequest,i)}}},Xt=function(){Le.blockRequest=!1,console.debug("Block request is false"),Me._isLocalStorageSupported()&&(delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),Me.removeCookie(F,ht()),Me.removeCookie(C(this,Wt)[Wt].cookieName,Le.broadDomain),Me.removeCookie(K,Le.broadDomain),C(this,Wt)[Wt].setSessionCookieObject("")},ei=function(){Le.blockRequest=!0,C(this,qt)[qt].debug("Block request is true"),Le.globalCache={gcookie:null,REQ_N:0,RESP_N:0},Me._isLocalStorageSupported()&&(delete localStorage.WZRK_G,delete localStorage.WZRK_K,delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),Me.removeCookie(B,Le.broadDomain),Me.removeCookie(F,ht()),Me.removeCookie(N,ht()),Me.removeCookie(C(this,Wt)[Wt].cookieName,Le.broadDomain),Me.removeCookie(K,Le.broadDomain),C(this,Gt)[Gt].gcookie=null,C(this,Wt)[Wt].setSessionCookieObject("")},ti=function(e){if(Array.isArray(e)&&e.length>0){var t=e.pop();if(null!=t&&ye(t)&&(null!=t.Site&&Object.keys(t.Site).length>0||null!=t.Facebook&&Object.keys(t.Facebook).length>0||null!=t["Google Plus"]&&Object.keys(t["Google Plus"]).length>0)){Me.setInstantDeleteFlagInK();try{C(this,Ht)[Ht]([t])}catch(e){C(this,qt)[qt].debug(e)}}else C(this,qt)[qt].error("Profile object is in incorrect format")}},ii=function(e){s(o,e);var i=g(o);function o(){var e;return t(this,o),(e=i.call(this))._details=null,e.shadow=null,e.shadow=e.attachShadow({mode:"open"}),e}return n(o,[{key:"renderBanner",value:function(){var e=this;this.shadow.innerHTML=this.getBannerContent(),!1!==this.trackClick&&this.addEventListener("click",(function(){var t=e.details.onClick;t&&(e.details.window?window.open(t,"_blank"):window.parent.location.href=t),window.clevertap.renderNotificationClicked({msgId:e.msgId,pivotId:e.pivotId})})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId})}},{key:"getBannerContent",value:function(){return'\n \n \n ")}},{key:"details",get:function(){return this._details||""},set:function(e){null===this._details&&(this._details=e,this.renderBanner())}}]),o}(p(HTMLElement)),ni=function(e){s(o,e);var i=g(o);function o(){var e;return t(this,o),(e=i.call(this))._target=null,e._carousel=null,e.shadow=null,e.slides=0,e.previouslySelectedItem=-1,e.selectedItem=1,e.autoSlide=null,e.stopAutoSlideTimeout=null,e.shadow=e.attachShadow({mode:"open"}),void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",ii),e}return n(o,[{key:"renderCarousel",value:function(){this.slides=this.details.length,this.shadow.innerHTML=this.getStyles();var e=this.getCarouselContent();this.display.showNavBtns&&e.insertAdjacentHTML("beforeend",this.display.navBtnsHtml),this.display.showNavArrows&&(e.insertAdjacentHTML("beforeend",this.display.leftNavArrowHtml),e.insertAdjacentHTML("beforeend",this.display.rightNavArrowHtml)),this._carousel=e,this.shadow.appendChild(e),this.setupClick(),this.updateSelectedItem(),this.startAutoSlide(),this.setupOnHover(),window.clevertap.renderNotificationViewed({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot})}},{key:"setupClick",value:function(){var e=this;this._carousel.addEventListener("click",(function(t){var i=t.target.id;if(i.startsWith("carousel__button")){var n=+i.split("-")[1];n!==e.selectedItem&&(e.previouslySelectedItem=e.selectedItem,e.selectedItem=n,e.updateSelectedItem(),e.startAutoSlide())}else if(i.startsWith("carousel__arrow"))i.endsWith("right")?e.goToNext():e.goToPrev(),e.startAutoSlide();else if(i.indexOf("-")>-1){var o=+i.split("-")[1],r=o-1;window.parent.clevertap&&window.clevertap.renderNotificationClicked({msgId:e.target.wzrk_id,pivotId:e.target.wzrk_pivot,wzrk_slideNo:o});var a=e.details[r].onClick;""!==a&&(e.details[r].window?window.open(a,"_blank"):window.location.href=a)}}))}},{key:"setupOnHover",value:function(){var e=this;this._carousel.addEventListener("mouseenter",(function(t){e.stopAutoSlideTimeout=setTimeout((function(){e.autoSlide=clearInterval(e.autoSlide)}),500)})),this._carousel.addEventListener("mouseleave",(function(t){clearTimeout(e.stopAutoSlideTimeout),void 0===e.autoSlide&&e.startAutoSlide()}))}},{key:"getCarouselContent",value:function(){var e=document.createElement("div");return e.setAttribute("class","carousel"),this.details.forEach((function(t,i){var n=document.createElement("ct-web-personalisation-banner");n.classList.add("carousel__item"),n.trackClick=!1,n.setAttribute("id","carousel__item-".concat(i+1)),n.details=t,e.appendChild(n)})),e}},{key:"getStyles",value:function(){var e,t;return"\n \n ")}},{key:"updateSelectedItem",value:function(){if(-1!==this.previouslySelectedItem){var e=this.shadow.getElementById("carousel__item-".concat(this.previouslySelectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.previouslySelectedItem));e.classList.remove("carousel__item--selected"),t&&t.classList.remove("carousel__button--selected")}var i=this.shadow.getElementById("carousel__item-".concat(this.selectedItem)),n=this.shadow.getElementById("carousel__button-".concat(this.selectedItem));i.classList.add("carousel__item--selected"),n&&n.classList.add("carousel__button--selected")}},{key:"startAutoSlide",value:function(){var e=this;clearInterval(this.autoSlide),this.autoSlide=setInterval((function(){e.goToNext()}),this.display.sliderTime?1e3*this.display.sliderTime:3e3)}},{key:"goToNext",value:function(){this.goTo(this.selectedItem,(this.selectedItem+1)%this.slides)}},{key:"goToPrev",value:function(){this.goTo(this.selectedItem,this.selectedItem-1)}},{key:"goTo",value:function(e,t){this.previouslySelectedItem=e,this.selectedItem=t,0===t&&(this.selectedItem=this.slides),this.updateSelectedItem()}},{key:"target",get:function(){return this._target||""},set:function(e){null===this._target&&(this._target=e,this.renderCarousel())}},{key:"details",get:function(){return this.target.display.details}},{key:"display",get:function(){return this.target.display}}]),o}(p(HTMLElement)),oi=function(e){s(o,e);var i=g(o);function o(){var e;return t(this,o),(e=i.call(this))._target=null,e._session=null,e.shadow=null,e.popup=null,e.container=null,e.resizeObserver=null,e.shadow=e.attachShadow({mode:"open"}),e}return n(o,[{key:"renderImageOnlyPopup",value:function(){var e=this,t=this.target.wzrk_id.split("_")[0],i=this.session.sessionId;this.shadow.innerHTML=this.getImageOnlyPopupContent(),this.popup=this.shadowRoot.getElementById("imageOnlyPopup"),this.container=this.shadowRoot.getElementById("container"),this.closeIcon=this.shadowRoot.getElementById("close"),this.popup.addEventListener("load",this.updateImageAndContainerWidth()),this.resizeObserver=new ResizeObserver((function(){return e.handleResize(e.popup,e.container)})),this.resizeObserver.observe(this.popup),this.closeIcon.addEventListener("click",(function(){if(e.resizeObserver.unobserve(e.popup),document.getElementById("wzrkImageOnlyDiv").style.display="none",e.remove(),null!=t&&"-1"!==t&&Me._isLocalStorageSupported()){var n=Ct(),o=n.wp[i];null==o&&(o={},n[i]=o),o[t]="dnd",xt(n)}})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId}),this.onClickUrl&&this.popup.addEventListener("click",(function(){e.target.display.window?window.open(e.onClickUrl,"_blank"):window.parent.location.href=e.onClickUrl,window.clevertap.renderNotificationClicked({msgId:e.msgId,pivotId:e.pivotId})}))}},{key:"handleResize",value:function(e,t){var i=this.getRenderedImageWidth(e);t.style.setProperty("width","".concat(i,"px"))}},{key:"getImageOnlyPopupContent",value:function(){return"\n ".concat(this.target.msgContent.css,"\n ").concat(this.target.msgContent.html,"\n ")}},{key:"updateImageAndContainerWidth",value:function(){var e=this;return function(){var t=e.getRenderedImageWidth(e.popup);e.popup.style.setProperty("width","".concat(t,"px")),e.container.style.setProperty("width","".concat(t,"px")),e.container.style.setProperty("height","auto"),e.container.style.setProperty("position","fixed"),e.popup.style.setProperty("visibility","visible"),e.closeIcon.style.setProperty("visibility","visible"),document.getElementById("wzrkImageOnlyDiv").style.visibility="visible"}}},{key:"getRenderedImageWidth",value:function(e){var t=e.naturalWidth/e.naturalHeight;return e.height*t}},{key:"target",get:function(){return this._target||""},set:function(e){null===this._target&&(this._target=e,this.renderImageOnlyPopup())}},{key:"session",get:function(){return this._session||""},set:function(e){this._session=e}},{key:"msgId",get:function(){return this.target.wzrk_id}},{key:"pivotId",get:function(){return this.target.wzrk_pivot}},{key:"onClickUrl",get:function(){return this.target.display.onClickUrl}}]),o}(p(HTMLElement)),ri=function(e){s(o,e);var i=g(o);function o(e,n){var r;return t(this,o),(r=i.call(this)).wrapper=null,r.snackBar=null,r.shadow=r.attachShadow({mode:"open"}),r.config=e,r.message=n,r.renderMessage(n),r}return n(o,[{key:"createEl",value:function(e,t,i){var n=document.createElement(e);return n.setAttribute("id",t),n.setAttribute("part",i||t),n}},{key:"renderMessage",value:function(e){switch(this.wrapper=this.createEl("div","messageWrapper"),e.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":var t=this.prepareBasicMessage(e.msg[0]);this.wrapper.appendChild(t)}var i=this.createEl("div","timeStamp");if(i.innerHTML="".concat(gi(e.id.split("_")[1]),""),!e.viewed){var n=this.createEl("span","unreadMarker");i.appendChild(n)}this.wrapper.appendChild(i),this.shadow.appendChild(this.wrapper)}},{key:"prepareBasicMessage",value:function(e){var t=this.createEl("div","message");if(e.imageUrl){var i=this.addImage(e.imageUrl,"mainImg");t.appendChild(i)}var n=this.createEl("div","iconTitleDescWrapper");if(e.iconUrl){var o=this.addImage(e.iconUrl,"iconImg");n.appendChild(o)}var r=this.createEl("div","titleDescWrapper");if(e.title){var a=this.createEl("div","title");a.innerText=e.title,r.appendChild(a)}if(e.description){var s=this.createEl("div","description");s.innerText=e.description,r.appendChild(s)}if((e.title||e.description)&&n.appendChild(r),(e.iconUrl||e.title||e.description)&&t.appendChild(n),e.buttons&&e.buttons.length){var l=this.addButtons(e.buttons);t.appendChild(l)}return t}},{key:"addButtons",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=this.createEl("div","buttonsContainer"),n=!1;return t.forEach((function(t,o){var r=e.createEl("button","button-".concat(o),"button");r.innerText=t.text,o>0&&(r.style.cssText+="margin-left: 2px;"),"copy"===t.action&&(n=!0),i.appendChild(r)})),n&&this.addSnackbar(i),i}},{key:"addSnackbar",value:function(e){this.snackBar=this.createEl("div","snackbar-".concat(this.campaignId),"snackbar"),this.snackBar.innerHTML=yi;var t=this.createEl("span","snackbar-msg-".concat(this.campaignId),"snackbar-msg");t.innerText="Copied to clipboard",this.snackBar.appendChild(t),e.appendChild(this.snackBar)}},{key:"addImage",value:function(e,t){var i=this.createEl("div","".concat(t,"Container")),n=this.createEl("img",t);return n.setAttribute("src",e),n.setAttribute("loading","lazy"),i.appendChild(n),i}},{key:"raiseClickedEvent",value:function(e,t){switch(this.message.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":this.raiseClickedForBasicTemplates(e,t)}}},{key:"raiseClickedForBasicTemplates",value:function(e,t){var i=this,n=this.message.msg[0],o={msgId:this.campaignId,pivotId:this.pivotId};if("BUTTON"===e.tagName){var r=e.id.split("-")[1],a=n.buttons[r];o.kv={wzrk_c2a:a.text},"url"===a.action?a.openUrlInNewTab?window.open(a.url,"_blank"):window.location=a.url:"copy"===a.action&&(window.focus(),navigator.clipboard.writeText(a.clipboardText),this.snackBar.style.setProperty("display","flex","important"),setTimeout((function(){i.snackBar.style.setProperty("display","none","important")}),2e3))}else"CT-INBOX-MESSAGE"===e.tagName&&n.onClickUrl&&(n.openUrlInNewTab?window.open(n.onClickUrl,"_blank"):window.location=n.onClickUrl);t?console.log("Notifiction clicked event will be raised at run time with payload ::",o):window.clevertap.renderNotificationClicked(o)}},{key:"pivotId",get:function(){return this.message.wzrk_pivot}},{key:"campaignId",get:function(){return this.message.wzrk_id}}]),o}(p(HTMLElement)),ai=function(e){s(o,e);var i=g(o);function o(e){var n;return t(this,o),(n=i.call(this)).isInboxOpen=!1,n.isInboxFromFlutter=!1,n.selectedCategory=null,n.unviewedMessages={},n.unviewedCounter=0,n.isPreview=!1,n.inboxConfigForPreview={},n.inboxSelector=null,n.inbox=null,n.emptyInboxMsg=null,n.inboxCard=null,n.unviewedBadge=null,n.observer=null,n.selectedCategoryRef=null,n.addClickListenerOnDocument=function(e){if(e.composedPath().includes(n.inbox)){var t=e.path||e.composedPath&&e.composedPath();if(t.length){var i=t[0].id;if("closeInbox"===i)n.toggleInbox();else if(i.startsWith("category-"))n.prevCategoryRef=n.selectedCategoryRef,n.selectedCategoryRef=t[0],n.updateActiveCategory(t[0].innerText);else{var o=t.filter((function(e){var t;return(null===(t=e.id)||void 0===t?void 0:t.startsWith("button-"))||"CT-INBOX-MESSAGE"===e.tagName}));o.length&&o[o.length-1].raiseClickedEvent(o[0],n.isPreview)}}}else(n.inboxSelector.contains(e.target)||n.isInboxOpen)&&(n.isInboxFromFlutter?n.isInboxFromFlutter=!1:n.toggleInbox(e))},n.setBadgeStyle=function(e){null!==n.unviewedBadge&&(n.unviewedBadge.innerText=e>9?"9+":e,n.unviewedBadge.style.display=e>0?"flex":"none")},n.logger=e,n.shadow=n.attachShadow({mode:"open"}),n}return n(o,[{key:"connectedCallback",value:function(){this.init()}},{key:"init",value:function(){this.config=this.isPreview?this.inboxConfigForPreview:Me.readFromLSorCookie(pe)||{},0!==Object.keys(this.config).length&&(this.inboxSelector=document.getElementById(this.config.inboxSelector),null!==this.inboxSelector&&(this.config.styles.notificationsBadge?this.addUnviewedBadge():this.unviewedBadge&&this.unviewedBadge.remove(),this.createinbox(),document.removeEventListener("click",this.addClickListenerOnDocument),document.addEventListener("click",this.addClickListenerOnDocument),this.config.categories.length&&this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadow.innerHTML=this.getInboxStyles(),this.shadow.appendChild(this.inbox)))}},{key:"addMsgsToInboxFromLS",value:function(){var e=this,t=this.deleteExpiredAndGetUnexpiredMsgs(!1),i=t?Object.keys(t):[];0!==i.length&&(i.forEach((function(i){t[i].viewed||(e.unviewedMessages[i]=t[i],e.unviewedCounter++)})),this.buildUIForMessages(t),this.updateUnviewedBadgeCounter())}},{key:"deleteExpiredAndGetUnexpiredMsgs",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=di(),i=Math.floor(Date.now()/1e3);for(var n in t)if(t[n].wzrk_ttl&&t[n].wzrk_ttl>0&&t[n].wzrk_ttl0&&(t=Object.values(t).sort((function(e,t){return t.date-e.date})).reduce((function(e,t){return e[t.id]=t,e}),{})),ui(t),t}},{key:"updateInboxMessages",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=this.deleteExpiredAndGetUnexpiredMsgs(),n=Date.now(),o={};t.forEach((function(t,r){var a="".concat(t.wzrk_id.split("_")[0],"_").concat(Date.now());t.id=a,t.date=n-r,t.viewed=0,i[a]=t,o[a]=t,e.unviewedMessages[a]=t,e.unviewedCounter++})),ui(i),this.buildUIForMessages(o),this.updateUnviewedBadgeCounter()}},{key:"createEl",value:function(e,t,i){var n=document.createElement(e);return n.setAttribute("id",t),n.setAttribute("part",i||t),n}},{key:"addUnviewedBadge",value:function(){var e=this;this.unviewedBadge||(this.unviewedBadge=this.createEl("div","unviewedBadge"),this.unviewedBadge.style.cssText="display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ".concat(this.config.styles.notificationsBadge.backgroundColor,"; font-size: 12px; color: ").concat(this.config.styles.notificationsBadge.textColor,"; font-weight: bold; align-items: center; justify-content: center;"),document.body.appendChild(this.unviewedBadge)),this.updateUnviewedBadgePosition(),window.addEventListener("resize",(function(){e.updateUnviewedBadgePosition()}))}},{key:"updateUnviewedBadgePosition",value:function(){var e=this.inboxSelector.getBoundingClientRect(),t=e.top,i=e.right;this.unviewedBadge.style.top="".concat(t-8,"px"),this.unviewedBadge.style.left="".concat(i-8,"px")}},{key:"createinbox",value:function(){var e=this;this.inbox=this.createEl("div","inbox");var t=this.createEl("div","header"),i=this.createEl("div","headerTitle");i.innerText=this.config.title;var n=this.createEl("div","closeInbox");if(n.innerHTML="×",t.appendChild(i),t.appendChild(n),this.inbox.appendChild(t),this.config.categories.length){var o=this.createCategories();this.inbox.appendChild(o)}this.inboxCard=this.createEl("div","inboxCard"),this.inbox.appendChild(this.inboxCard),this.emptyInboxMsg=this.createEl("div","emptyInboxMsg"),this.emptyInboxMsg.innerText="All messages will be displayed here.",this.inboxCard.appendChild(this.emptyInboxMsg);var r={root:this.inboxCard,rootMargin:"0px",threshold:.5};this.observer=new IntersectionObserver((function(t,i){e.handleMessageViewed(t)}),r),this.addMsgsToInboxFromLS()}},{key:"createCategories",value:function(){var e=this,t=this.createEl("div","categoriesContainer"),i=this.createEl("div","leftArrow");i.innerHTML=bi,i.children[0].style="transform: rotate(180deg)",i.addEventListener("click",(function(){e.shadowRoot.getElementById("categoriesWrapper").scrollBy(-70,0)})),t.appendChild(i);var n=this.createEl("div","categoriesWrapper");["All"].concat(v(this.config.categories)).forEach((function(t,i){var o=e.createEl("div","category-".concat(i),"category");o.innerText=t,0===i&&(e.selectedCategoryRef=o),n.appendChild(o)})),t.appendChild(n);var o=this.createEl("div","rightArrow");o.innerHTML=bi,o.addEventListener("click",(function(){e.shadowRoot.getElementById("categoriesWrapper").scrollBy(70,0)})),t.appendChild(o);var r={root:t,threshold:.9},a=n.children[0],s=n.children[this.config.categories.length];return new IntersectionObserver((function(t){e.categoryObserverCb(i,t[0].intersectionRatio>=.9)}),r).observe(a),new IntersectionObserver((function(t){e.categoryObserverCb(o,t[0].intersectionRatio>=.9)}),r).observe(s),t}},{key:"categoryObserverCb",value:function(e,t){e&&(e.style.display=t?"none":"flex")}},{key:"updateActiveCategory",value:function(e){var t=this;this.selectedCategory=e,this.inboxCard.scrollTop=0;var i=0;this.prevCategoryRef&&this.prevCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef.setAttribute("selected","true"),this.inboxCard.childNodes.forEach((function(e){"emptyInboxMsg"!==e.getAttribute("id")&&(e.style.display="All"===t.selectedCategory||e.getAttribute("category")===t.selectedCategory?"block":"none","block"===e.style.display&&i++)})),0===i?(this.emptyInboxMsg.innerText="".concat(e," messages will be displayed here."),this.emptyInboxMsg.style.display="block"):this.emptyInboxMsg.style.display="none"}},{key:"buildUIForMessages",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!this.isPreview&&this.updateTSForRenderedMsgs(),this.inboxCard.scrollTop=0;var i,n=null!==(e=this.config.maxMsgsInInbox)&&void 0!==e?e:15,o=this.inboxCard.firstChild,r=Object.values(t).sort((function(e,t){return t.date-e.date})).map((function(e){return e.id})),a=m(r);try{for(a.s();!(i=a.n()).done;){var s=i.value,l=new ri(this.config,t[s]);l.setAttribute("id",t[s].id),l.setAttribute("pivot",t[s].wzrk_pivot),l.setAttribute("part","ct-inbox-message"),this.config.categories.length>0?(l.setAttribute("category",t[s].tags[0]||""),l.style.display="All"===this.selectedCategory||t[s].category===this.selectedCategory?"block":"none"):l.style.display="block",this.inboxCard.insertBefore(l,o),this.observer.observe(l)}}catch(e){a.e(e)}finally{a.f()}for(var c=this.inboxCard.querySelectorAll("ct-inbox-message").length;c>n;){var d=this.inboxCard.querySelectorAll("ct-inbox-message");d.length>0&&d[d.length-1].remove(),c--}var u=this.inboxCard.querySelectorAll('ct-inbox-message[style*="display: block"]').length;this.emptyInboxMsg.style.display=u?"none":"block"}},{key:"handleMessageViewed",value:function(e){var t=this,i=!this.isPreview;this.isInboxOpen&&e.forEach((function(e){e.isIntersecting&&t.unviewedMessages.hasOwnProperty(e.target.id)&&0===e.target.message.viewed&&(e.target.message.viewed=1,i?(window.clevertap.renderNotificationViewed({msgId:e.target.campaignId,pivotId:e.target.pivotId}),t.updateMessageInLS(e.target.id,a(a({},e.target.message),{},{viewed:1})),setTimeout((function(){e.target.shadowRoot.getElementById("unreadMarker").style.display="none"}),1e3)):console.log("Notifiction viewed event will be raised at run time with payload ::",{msgId:e.target.campaignId,pivotId:e.target.pivotId}),t.unviewedCounter--,t.updateUnviewedBadgeCounter(),delete t.unviewedMessages[e.target.id])}))}},{key:"updateMessageInLS",value:function(e,t){if(!this.isPreview){var i=di();i[e]=t,ui(i)}}},{key:"toggleInbox",value:function(e){this.isInboxOpen=!this.isInboxOpen,this.isInboxFromFlutter=!!(null==e?void 0:e.rect),this.isInboxOpen?(this.inboxCard.scrollTop=0,!this.isPreview&&this.deleteExpiredAndGetUnexpiredMsgs(),this.inbox.style.display="block",this.inbox.style.zIndex="2147483647",this.config.categories.length&&(this.selectedCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef=this.shadowRoot.getElementById("category-0"),this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadowRoot.getElementById("categoriesWrapper").scrollLeft-=this.shadowRoot.getElementById("categoriesWrapper").scrollWidth),this.setInboxPosition(e)):this.inbox.style.display="none"}},{key:"setInboxPosition",value:function(e){var t=window.outerWidth,i=getComputedStyle(Le.inbox),n=i.getPropertyValue("--inbox-top"),o=i.getPropertyValue("--inbox-bottom"),r=i.getPropertyValue("--inbox-left"),a=i.getPropertyValue("--inbox-right");if(t>481&&!(n||o||r||a)){var s=fi(e,this.inbox.clientHeight,this.inbox.clientWidth),l=s.xPos,c=s.yPos;this.inbox.style.top=c+"px",this.inbox.style.left=l+"px"}}},{key:"updateUnviewedBadgeCounter",value:function(){if(this.isPreview)this.setBadgeStyle(this.unviewedCounter);else{var e=0;this.inboxCard.querySelectorAll("ct-inbox-message").forEach((function(t){var i=di();i[t.id]&&0===i[t.id].viewed&&e++})),this.setBadgeStyle(e)}}},{key:"updateTSForRenderedMsgs",value:function(){this.inboxCard.querySelectorAll("ct-inbox-message").forEach((function(e){var t=e.id.split("_")[1];e.shadow.getElementById("timeStamp").firstChild.innerText=gi(t)}))}},{key:"getInboxStyles",value:function(){var e=this.config.categories.length?64:16,t={panelBackgroundColor:this.config.styles.panelBackgroundColor,panelBorderColor:this.config.styles.panelBorderColor,headerBackgroundColor:this.config.styles.header.backgroundColor,headerTitleColor:this.config.styles.header.titleColor,closeIconColor:this.config.styles.closeIconColor,categoriesTabColor:this.config.styles.categories.tabColor,categoriesTitleColor:this.config.styles.categories.titleColor,selectedCategoryTabColor:this.config.styles.categories.selectedTab.tabColor,selectedCategoryTitleColor:this.config.styles.categories.selectedTab.titleColor,headerCategoryHeight:36+e};this.config.styles.categories.borderColor&&(t.categoriesBorderColor=this.config.styles.categories.borderColor),this.config.styles.categories.selectedTab.borderColor&&(t.selectedCategoryBorderColor=this.config.styles.categories.selectedTab.borderColor);var i,n,o,r,a,s,l,c,d,u,p,h,f,g,v,b,y,m,w,k,C,x=(n=(i=t).panelBackgroundColor,o=i.panelBorderColor,r=i.headerBackgroundColor,a=i.headerTitleColor,s=i.closeIconColor,l=i.categoriesTabColor,c=i.categoriesTitleColor,d=i.categoriesBorderColor,u=i.selectedCategoryTabColor,p=i.selectedCategoryTitleColor,h=i.selectedCategoryBorderColor,f=i.headerCategoryHeight,'\n \n ")),P=this.config.styles.cards;return x+(g={backgroundColor:P.backgroundColor,borderColor:P.borderColor,titleColor:P.titleColor,descriptionColor:P.descriptionColor,buttonColor:P.buttonColor,buttonTextColor:P.buttonTextColor,unreadMarkerColor:P.unreadMarkerColor},v=g.backgroundColor,b=g.borderColor,y=g.titleColor,m=g.descriptionColor,w=g.buttonColor,k=g.buttonTextColor,C=g.unreadMarkerColor,'\n \n "))}},{key:"incomingMessages",get:function(){return[]},set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.length>0&&this.inbox&&this.updateInboxMessages(e)}},{key:"incomingMessagesForPreview",get:function(){return[]},set:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i={};t.length>0&&this.inbox&&(this.isPreview=!0,this.unviewedCounter=0,t.forEach((function(t){var n="".concat(t.wzrk_id.split("_")[0],"_").concat(Date.now());t.id=n,i[n]=t,e.unviewedMessages[n]=t,e.unviewedCounter++})),this.buildUIForMessages(i),this.updateUnviewedBadgeCounter())}}]),o}(p(HTMLElement)),si=function(e){e.inbox_preview?Le.inbox.incomingMessagesForPreview=e.inbox_notifs:Le.inbox.incomingMessages=e},li=function(e){hi(),Le.inbox=new ai({logger:e}),document.body.appendChild(Le.inbox)},ci=function(e){var t=Me.readFromLSorCookie(he)||{};if(Object.keys(t).length>0&&Object.keys(t)[0].includes("_")){var i={};return i[e]=t,Me.saveToLSorCookie(he,i),i}return t},di=function(){var e=JSON.parse(decodeURIComponent(Me.read(B)));if(!xe(e))return{};var t=ci(e);return t.hasOwnProperty(e)?t[e]:{}},ui=function(e){var t=JSON.parse(decodeURIComponent(Me.read(B)));if(xe(t)){var i=a(a({},ci(t)),{},o({},t,e));Me.saveToLSorCookie(he,i)}},pi=function(e){return new Promise((function(t,i){if("complete"===document.readyState)li(e),t();else{var n=Me.readFromLSorCookie(pe)||{},o=function(){null===Le.inbox&&li(e),t()};window.addEventListener("load",(function(){if(document.getElementById(n.inboxSelector))o();else{var i=0;if(i<20)var r=setInterval((function(){document.getElementById(n.inboxSelector)?(o(),clearInterval(r),t()):i>=20&&(clearInterval(r),e.debug("Failed to add inbox")),i++}),500)}}))}}))},hi=function(){void 0===customElements.get("ct-web-inbox")&&(customElements.define("ct-web-inbox",ai),customElements.define("ct-inbox-message",ri))},fi=function(e,t,i){var n,o,r=document.scrollingElement.scrollLeft,a=document.scrollingElement.scrollTop,s=window.innerWidth+r,l=window.innerHeight+a,c=e.rect||e.target.getBoundingClientRect(),d=c.x+r,u=c.y+a,p=c.left+r,h=c.right+r,f=c.top+a,g=c.bottom,v=c.height,b=c.width,y=!1,m=16;if(g+t<=l){var w=l-(g+t);o=w>=m?g+m:g+w}else if(f-t>=a){var k=f-t;o=k>=m?f-t-m:f-t-k}else y=!0,(o=u+v/2-t/2)l&&(o=l-t);if(y){var C=h+i;if(C<=s){n=h+(C+m<=s?m:s-C)}else{var x=p-i;n=x-(x-m>=r?m:x-r)}}else(n=d+b/2-i/2)s&&(n=h-i>=r?h-i:s-i);return{xPos:n,yPos:o}},gi=function(e){var t=Date.now(),i=Math.floor((t-e)/6e4);return i<5?"Just now":i<60?"".concat(i," minute").concat(i>1?"s":""," ago"):(i=Math.floor(i/60))<24?"".concat(i," hour").concat(i>1?"s":""," ago"):(i=Math.floor(i/24),"".concat(i," day").concat(i>1?"s":""," ago"))},vi=function(){return Object.keys(Me.readFromLSorCookie(pe)||{}).length>0},bi='\n\n\n',yi='\n\n\n',mi=function e(t,i){var n,r=i.device,s=i.session,l=i.request,c=i.logger,d=r,u=s,p=l,h=c,f=0,g=function(i){var n=i.wzrk_id.split("_")[0],r=Oe(),a=function(e,t,i){var n=0,o=0;null!=e[t]&&(n=e[t]),n++,null!=e.tc&&(o=e.tc),i<0&&o++,e.tc=o,e[t]=n};if(Me._isLocalStorageSupported()){delete sessionStorage.WZRK_CAMP;var s={},l=Ct();s=3===i.display.wtarget_type&&l.hasOwnProperty("wi")?l.wi:0!==i.display.wtarget_type&&1!==i.display.wtarget_type||!l.hasOwnProperty("wp")?{}:l.wp,l.hasOwnProperty("global")&&(s.wp=l),null==i.display.wmc&&(i.display.wmc=1),null==i.display.wimc&&(i.display.wimc=1);var c=-1,f=-1,g=-1,v=-1,b=-1,y=-1,m=-1;null!=i.display.efc&&(c=parseInt(i.display.efc,10)),null!=i.display.mdc&&(f=parseInt(i.display.mdc,10)),null!=i.display.tdc&&(g=parseInt(i.display.tdc,10)),null!=i.display.tlc&&(v=parseInt(i.display.tlc,10)),null!=i.display.wmp&&(b=parseInt(i.display.wmp,10)),null!=i.display.wmc&&(y=parseInt(i.display.wmc,10)),null!=i.display.wimc&&(m=parseInt(i.display.wimc,10));var w=s[u.sessionId];if(w){var k=w[n],C=w.tc;if("dnd"===k&&!Le.dismissSpamControl)return!1;if(3===i.display.wtarget_type){if(m>0&&C>=m&&c<0)return!1}else if(y>0&&C>=y&&c<0)return!1;if(f>0&&k>=f)return!1}else w={},s[u.sessionId]=w;var x=s[r];if(null!=x){var P=x[n],S=x.tc;if(b>0&&S>=b&&c<0)return!1;if(g>0&&P>=g)return!1}else x={},s[r]=x;var O=s.global;if(null!=O){var I=O[n];if(v>0&&I>=v)return!1}else O={},s.global=O}if(null!=i.display.delay&&i.display.delay>0){var _=i.display.delay;return i.display.delay=0,setTimeout(e,1e3*_,t,{device:d,session:u,request:p,logger:h}),!1}a(w,n,c),a(x,n,c),a(O,n,c);var E="wp";3===i.display.wtarget_type&&(E="wi");var A={};A[u.sessionId]=w,A[r]=x,A.global=O,xt(o({},E,A))},v=function(){var e=d.getGuid(),t=u.getSessionCookieObject();return"&t=wc&d="+encodeURIComponent(vt(e+"|"+t.p+"|"+t.s))},b=function(e,t){var i=window.parent[e];"function"==typeof i&&(null!=t.display.kv?i(t.display.kv):i())},y=function(e,t,i,n,o){w(t),function(e,t,i,n,o){if(""!==e&&null!=e){var r,a;o?r=i:null!==i&&null!=(a=i.getElementsByClassName("jsCT_CTA"))&&1===a.length&&(r=a[0]);var s=t.display.jsFunc,l=t.display.preview;null==l&&(e+=v()),null!=r&&(r.onclick=function(){if(null!=s)return null==l&&kt.fireRequest(e),b(s,t),void At("-1",0,u.sessionId);1===t.display.window?window.open(e,"_blank"):window.location=e})}}(e,t,i,0,o)},w=function(e){var t={type:"event"};t.evtName=ie,t.evtData=o({},te,e.wzrk_id),e.wzrk_pivot&&(t.evtData=a(a({},t.evtData),{},{wzrk_pivot:e.wzrk_pivot})),p.processEvent(t)},k=function(e){var t;void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",ii);var i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,n=document.createElement("ct-web-personalisation-banner");n.msgId=e.wzrk_id,n.pivotId=e.wzrk_pivot,n.divHeight=e.display.divHeight,n.details=e.display.details[0];var o=e.display.divId?document.getElementById(i):document.querySelector(i);o.innerHTML="",o.appendChild(n)},C=function(e){var t;void 0===customElements.get("ct-web-personalisation-carousel")&&customElements.define("ct-web-personalisation-carousel",ni);var i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,n=document.createElement("ct-web-personalisation-carousel");n.target=e;var o=e.display.divId?document.getElementById(i):document.querySelector(i);o.innerHTML="",o.appendChild(n)},x=function(e){var t=e.wzrk_id.split("_")[0],i=e.display;if(2!==i.wtarget_type||1!==e.msgContent.type){if(1===i.layout)return I(void 0,e);if(3===i.layout){var n="wzrkImageOnlyDiv";if(!1===g(e))return;if(Le.dismissSpamControl&&null!=document.getElementById(n))document.getElementById(n).remove();if(null!=document.getElementById(n)||null!=document.getElementById("intentPreview"))return;var o=document.createElement("div");return o.id=n,document.body.appendChild(o),void 0===customElements.get("ct-web-popup-imageonly")&&customElements.define("ct-web-popup-imageonly",oi),function(e){var t=document.createElement("ct-web-popup-imageonly");t.session=u,t.target=e;var i=document.getElementById("wzrkImageOnlyDiv");i.innerHTML="",i.style.visibility="hidden",i.appendChild(t)}(e)}if(!1!==g(e)){var r="wizParDiv"+i.layout;if(Le.dismissSpamControl&&null!=document.getElementById(r))document.getElementById(r).remove();if(null==document.getElementById(r)){Le.campaignDivMap[t]=r;var a=2===i.layout,s=document.createElement("div");s.id=r;var l=window.innerHeight,c=window.innerWidth,d=!1;if(a)s.setAttribute("style",i.iFrameStyle);else{var p=10,h=5*c/100,f=p+5*l/100,v=30*c/100+20,b="width:30%;";(/mobile/i.test(navigator.userAgent)||/mini/i.test(navigator.userAgent))&&!1===/iPad/i.test(navigator.userAgent)?(v=85*c/100+20,h=5*c/100,f=5*l/100,b="width:80%;"):("ontouchstart"in window||/tablet/i.test(navigator.userAgent))&&(v=50*c/100+20,h=5*c/100,f=5*l/100,b="width:50%;"),null==i.proto?(d=!0,s.setAttribute("style","display:block;overflow:hidden; bottom:"+f+"px !important;width:"+v+"px !important;right:"+h+"px !important;position:fixed;z-index:2147483647;")):s.setAttribute("style",b+i.iFrameStyle)}document.body.appendChild(s);var m=document.createElement("iframe"),w=!1===i.br?"0":"8";m.frameborder="0px",m.marginheight="0px",m.marginwidth="0px",m.scrolling="no",m.id="wiz-iframe";var k,C=e.display.onClick,x="";if(""!==C&&null!=C&&(x="cursor:pointer;"),1===e.msgContent.type)k=(k=(k=e.msgContent.html).replace(/##campaignId##/g,t)).replace(/##campaignId_batchId##/g,e.wzrk_id);else{var S,O,_,E,A,M='";"dark"===e.display.theme?(S="#2d2d2e",O="#eaeaea",_="#353535",E="#353535",A="#ffffff"):(S="#ffffff",O="#000000",E="#f4f4f4",_="#a5a6a6",A="#ffffff");var L=e.msgContent.title,R=e.msgContent.description,T="";null!=e.msgContent.imageUrl&&""!==e.msgContent.imageUrl&&(T=""),k=M+("
×
"+T+"
"+L+"
")+("
"+R+"
")}m.setAttribute("style","z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;"),s.appendChild(m);var j=(m.contentWindow?m.contentWindow:m.contentDocument.document?m.contentDocument.document:m.contentDocument).document,D=new Event("CT_campaign_rendered");document.dispatchEvent(D),j.open(),j.write(k),i["custom-editor"]&&P(e,j),j.close();var z=function(){p=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv").scrollHeight,!0===i["custom-editor"]||a||(p+=25),document.getElementById("wiz-iframe").contentDocument.body.style.margin="0px",document.getElementById("wiz-iframe").style.height=p+"px"},B=navigator.userAgent.toLowerCase();if(-1!==B.indexOf("safari"))if(B.indexOf("chrome")>-1)m.onload=function(){z();var t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");y(C,e,t,0,d)};else{var N=m.contentDocument||m.contentWindow;N.document&&(N=N.document),z();var F=setInterval((function(){if("complete"===N.readyState){clearInterval(F),z();var t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");y(C,e,t,0,d)}}),10)}else m.onload=function(){z();var t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");y(C,e,t,0,d)}}}}else{var U={};U.msgId=e.wzrk_id,e.wzrk_pivot&&(U.pivotId=e.wzrk_pivot),null!=e.msgContent.kv&&(U.kv=e.msgContent.kv);var q=new CustomEvent("CT_web_native_display",{detail:U});document.dispatchEvent(q)}},P=function(e,t){var i=t.createElement("script");i.innerHTML="\n const ct__camapignId = '".concat(e.wzrk_id,"';\n const ct__formatVal = (v) => {\n return v && v.trim().substring(0, 20);\n }\n const ct__parentOrigin = window.parent.origin;\n document.body.addEventListener('click', (event) => {\n const elem = event.target.closest?.('a[wzrk_c2a], button[wzrk_c2a]');\n if (elem) {\n const {innerText, id, name, value, href} = elem;\n const clickAttr = elem.getAttribute('onclick') || elem.getAttribute('click');\n const onclickURL = clickAttr?.match(/(window.open)[(](\"|')(.*)(\"|',)/)?.[3] || clickAttr?.match(/(location.href *= *)(\"|')(.*)(\"|')/)?.[3];\n const props = {innerText, id, name, value};\n let msgCTkv = Object.keys(props).reduce((acc, c) => {\n const formattedVal = ct__formatVal(props[c]);\n formattedVal && (acc['wzrk_click_' + c] = formattedVal);\n return acc;\n }, {});\n if(onclickURL) { msgCTkv['wzrk_click_' + 'url'] = onclickURL; }\n if(href) { msgCTkv['wzrk_click_' + 'c2a'] = href; }\n const notifData = { msgId: ct__camapignId, msgCTkv, pivotId: '").concat(e.wzrk_pivot,"' };\n window.parent.clevertap.renderNotificationClicked(notifData);\n }\n });\n "),t.body.appendChild(i)},S=!1,O=function(e){var t=e.display.onClick;if(window.clevertap.hasOwnProperty("notificationCallback")&&void 0!==window.clevertap.notificationCallback&&"function"==typeof window.clevertap.notificationCallback){var i=window.clevertap.notificationCallback;if(!S){var n={};n.msgContent=e.msgContent,n.msgId=e.wzrk_id,e.wzrk_pivot&&(n.pivotId=e.wzrk_pivot),null!=e.display.kv&&(n.kv=e.display.kv),window.clevertap.raiseNotificationClicked=function(){if(""!==t&&null!=t){var i=e.display.jsFunc;if(t+=v(),null!=i)return kt.fireRequest(t),void b(i,e);1===e.display.window?window.open(t,"_blank"):window.location=t}},window.clevertap.raiseNotificationViewed=function(){w(e)},i(n),S=!0}}else if(window.clevertap.popupCurrentWzrkId=e.wzrk_id,x(e),window.clevertap.hasOwnProperty("popupCallbacks")&&void 0!==window.clevertap.popupCallbacks&&"function"==typeof window.clevertap.popupCallbacks[e.wzrk_id]){var r=window.clevertap.popupCallbacks[e.wzrk_id],s={};s.msgContent=e.msgContent,s.msgId=e.wzrk_id,e.wzrk_pivot&&(s.pivotId=e.wzrk_pivot);var l=[];for(var c in e)if(c.startsWith(ee)&&c!==te){var d=o({},c,e[c]);l.push(d)}l.length>0&&(s.msgCTkv=l),null!=e.display.kv&&(s.kv=e.display.kv),window.clevertap.raisePopupNotificationClicked=function(t){if(t&&t.msgId){var i={type:"event"};if(i.evtName=ne,i.evtData=o({},te,t.msgId),e.wzrk_pivot&&(i.evtData=a(a({},i.evtData),{},{wzrk_pivot:t.pivotId})),t.msgCTkv){var n,r=m(t.msgCTkv);try{for(r.s();!(n=r.n()).done;){var s=n.value;i.evtData=a(a({},i.evtData),s)}}catch(e){r.e(e)}finally{r.f()}}p.processEvent(i)}},r(s)}},I=function(e,t){var i;if(!(null!=e&&e.clientY>0)){if(i=null==t?n:t,Le.dismissSpamControl&&0===i.display.wtarget_type&&null!=document.getElementById("intentPreview")&&null!=document.getElementById("intentOpacityDiv"))document.getElementById("intentPreview").remove(),document.getElementById("intentOpacityDiv").remove();if(null==document.getElementById("intentPreview")&&null==document.getElementById("wzrkImageOnlyDiv")&&(null!=i.display.layout||!(/mobile/i.test(navigator.userAgent)||/mini/i.test(navigator.userAgent)||/iPad/i.test(navigator.userAgent)||"ontouchstart"in window||/tablet/i.test(navigator.userAgent)))&&!1!==g(i)){var o=i.wzrk_id.split("_")[0];Le.campaignDivMap[o]="intentPreview";var r=!1,a=document.createElement("div");a.id="intentOpacityDiv";var s=i.display.opacity||.7,l="rgba(0,0,0,".concat(s,")");a.setAttribute("style","position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ".concat(l,";")),document.body.appendChild(a);var c=document.createElement("div");c.id="intentPreview",null==i.display.proto?(r=!0,c.setAttribute("style","display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;")):c.setAttribute("style",i.display.iFrameStyle),document.body.appendChild(c);var d=document.createElement("iframe"),u=!1===i.display.br?"0":"8";d.frameborder="0px",d.marginheight="0px",d.marginwidth="0px",d.scrolling="no",d.id="wiz-iframe-intent";var p,h=i.display.onClick,f="";if(""!==h&&null!=h&&(f="cursor:pointer;"),1===i.msgContent.type)p=(p=(p=i.msgContent.html).replace(/##campaignId##/g,o)).replace(/##campaignId_batchId##/g,i.wzrk_id);else{var v,b,m,w,k='";"dark"===i.display.theme?(v="#2d2d2e",b="#eaeaea",m="#353535",w="#ffffff"):(v="#ffffff",b="#000000",m="#a5a6a6",w="#ffffff");var C=i.msgContent.title,x=i.msgContent.description,S="";null!=i.msgContent.ctaText&&""!==i.msgContent.ctaText&&(S="");var O="";null!=i.msgContent.imageUrl&&""!==i.msgContent.imageUrl&&(O="
+C+
"),p=k+("
×
"+C+"
")+("
"+x+"
"+O+S+"
")}d.setAttribute("style","z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;"),c.appendChild(d);var I=(d.contentWindow?d.contentWindow:d.contentDocument.document?d.contentDocument.document:d.contentDocument).document,_=new Event("CT_campaign_rendered");document.dispatchEvent(_),I.open(),I.write(p),i.display["custom-editor"]&&P(i,I),I.close();var E=document.getElementById("wiz-iframe-intent").contentDocument.getElementById("contentDiv");y(h,i,E,0,r)}}};if(document.body){var _=function(e){Object.keys(e).map((function(t){var i,n;e[t].display.divId?(i=e[t].display.divId,n=document.getElementById(i)):(i=e[t].display.divSelector,n=document.querySelector(i)),null!==n&&(2===e[t].msgContent.type?k(e[t]):C(e[t]),delete e[t])}))};if(null!=t.inapp_notifs){for(var E={},A=0;A1&&void 0!==arguments[1]&&arguments[1],i=Me.readFromLSorCookie(pe)||{};t?(Le.inbox.inboxConfigForPreview=e,Le.inbox.isPreview=!0,Le.inbox&&Le.inbox.init()):JSON.stringify(i)!==JSON.stringify(e)&&(Me.saveToLSorCookie(pe,e),Le.inbox&&Le.inbox.init())}(t.webInboxSetting),pi(h).then((function(){L()})).catch((function(e){}))):L()),t.vars)Le.variableStore.mergeVariables(t.vars);else{var R=function(e,t){var i=Ct(),n=i[t].global;if(null!=n&&t)for(var o in e)if(e.hasOwnProperty(o)&&(delete n[e[o]],Me.read(U))){var r=JSON.parse(decodeURIComponent(Me.read(U))),a=JSON.parse(decodeURIComponent(Me.read(B)));r[a]&&r[a][t]&&r[a][t][e[o]]&&(delete r[a][t][e[o]],Me.save(U,encodeURIComponent(JSON.stringify(r))))}xt(i)};if(Me._isLocalStorageSupported())try{if(null!=t.evpr){var T=t.evpr.events,j=t.evpr.profile,D=t.evpr.expires_in,z=Ie();Me.setMetaProp("lsTime",z),Me.setMetaProp("exTs",D),function(e){if(null!=Le.globalEventsMap||(Le.globalEventsMap=Me.readFromLSorCookie(q),null!=Le.globalEventsMap)){for(var t in e)if(e.hasOwnProperty(t)){var i=Le.globalEventsMap[t],n=e[t];null!=Le.globalEventsMap[t]?null!=n[0]&&n[0]>i[0]&&(Le.globalEventsMap[t]=n):Le.globalEventsMap[t]=n}}else Le.globalEventsMap=e}(T),Me.saveToLSorCookie(q,Le.globalEventsMap),null==Le.globalProfileMap?Et(j,!0):Et(j,!1)}null!=t.arp&&function(e){if(null!=e.skipResARP&&e.skipResARP)return console.debug("Update ARP Request rejected",e),null;var t=!0===e.isOUL;if(Me._isLocalStorageSupported())try{var i=Me.readFromLSorCookie(K);if(null==i||t){for(var n in i={},e)e.hasOwnProperty(n)&&(-1===e[n]?delete i[n]:i[n]=e[n]);Me.saveToLSorCookie(K,i)}}catch(e){console.error("Unable to parse ARP JSON: "+e)}}(t.arp),null!=t.inapp_stale&&t.inapp_stale.length>0&&R(t.inapp_stale,"wp"),null!=t.inbox_stale&&t.inbox_stale.length>0&&R(t.inbox_stale,"wi")}catch(e){h.error("Unable to persist evrp/arp: "+e)}}}else f<6&&(f++,setTimeout(e,1e3,t,{device:d,session:u,request:p,logger:h}))},wi=k("isPersonalisationActive"),ki=function(){function e(i){var n=i.isPersonalisationActive;t(this,e),Object.defineProperty(this,wi,{writable:!0,value:void 0}),C(this,wi)[wi]=n}return n(e,[{key:"getTotalVisits",value:function(){if(C(this,wi)[wi]()){var e=Me.getMetaProp("sc");return null==e&&(e=1),e}}},{key:"getLastVisit",value:function(){if(C(this,wi)[wi]()){var e=Me.getMetaProp("ps");return null!=e?new Date(1e3*e):void 0}}}]),e}(),Ci=1,xi=2,Pi=3,Si=4,Oi=k("logLevel"),Ii=k("log"),_i=k("isLegacyDebug"),Ei=function(){function e(i){t(this,e),Object.defineProperty(this,_i,{get:Mi,set:void 0}),Object.defineProperty(this,Ii,{value:Ai}),Object.defineProperty(this,Oi,{writable:!0,value:void 0}),this.wzrkError={},C(this,Oi)[Oi]=null==i?i:xi,this.wzrkError={}}return n(e,[{key:"error",value:function(e){C(this,Oi)[Oi]>=Ci&&C(this,Ii)[Ii]("error",e)}},{key:"info",value:function(e){C(this,Oi)[Oi]>=xi&&C(this,Ii)[Ii]("log",e)}},{key:"debug",value:function(e){(C(this,Oi)[Oi]>=Pi||C(this,_i)[_i])&&C(this,Ii)[Ii]("debug",e)}},{key:"debugPE",value:function(e){C(this,Oi)[Oi]>=Si&&C(this,Ii)[Ii]("debug_pe",e)}},{key:"reportError",value:function(e,t){this.wzrkError.c=e,this.wzrkError.d=t,this.error("".concat(Ke," ").concat(e,": ").concat(t))}},{key:"logLevel",get:function(){return C(this,Oi)[Oi]},set:function(e){C(this,Oi)[Oi]=e}}]),e}(),Ai=function(e,t){if(window.console)try{var i=(new Date).getTime();console[e]("CleverTap [".concat(i,"]: ").concat(t))}catch(e){}},Mi=function(){return"undefined"!=typeof sessionStorage&&""===sessionStorage.WZRK_D},Li=k("logger"),Ri=k("sessionId"),Ti=k("isPersonalisationActive"),ji=function(){function e(i){var n=i.logger,o=i.isPersonalisationActive;t(this,e),Object.defineProperty(this,Li,{writable:!0,value:void 0}),Object.defineProperty(this,Ri,{writable:!0,value:void 0}),Object.defineProperty(this,Ti,{writable:!0,value:void 0}),this.cookieName=void 0,this.scookieObj=void 0,this.sessionId=Me.getMetaProp("cs"),C(this,Li)[Li]=n,C(this,Ti)[Ti]=o}return n(e,[{key:"getSessionCookieObject",value:function(){var e=Me.readCookie(this.cookieName),t={};if(null!=e)if(e=e.replace(T,'"'),t=JSON.parse(e),ye(t)){if(void 0!==t.t){var i=t.t;Ie()-i>1260&&(t={})}}else t={};return this.scookieObj=t,t}},{key:"setSessionCookieObject",value:function(e){var t=JSON.stringify(e);Me.createBroadCookie(this.cookieName,t,1200,ht())}},{key:"manageSession",value:function(e){if(void 0===this.sessionId||this.sessionId!==e){var t=Me.getMetaProp("cs");if(void 0===t)Me.setMetaProp("ps",e),Me.setMetaProp("cs",e),Me.setMetaProp("sc",1);else if(t!==e){Me.setMetaProp("ps",t),Me.setMetaProp("cs",e);var i=Me.getMetaProp("sc");void 0===i&&(i=0),Me.setMetaProp("sc",i+1)}this.sessionId=e}}},{key:"getTimeElapsed",value:function(){if(C(this,Ti)[Ti]()){null!=this.scookieObj&&(this.scookieObj=this.getSessionCookieObject());var e=this.scookieObj.s;if(null!=e){var t=Ie();return Math.floor(t-e)}}}},{key:"getPageCount",value:function(){if(C(this,Ti)[Ti]())return null!=this.scookieObj&&(this.scookieObj=this.getSessionCookieObject()),this.scookieObj.p}},{key:"sessionId",get:function(){return C(this,Ri)[Ri]},set:function(e){C(this,Ri)[Ri]=e}}]),e}(),Di=0,zi=0,Bi=k("logger"),Ni=k("account"),Fi=k("device"),Ui=k("session"),qi=k("isPersonalisationActive"),Vi=k("clearCookie"),Wi=k("addToLocalEventMap"),Ki=function(){function e(i){var n=i.logger,o=i.account,r=i.device,a=i.session,s=i.isPersonalisationActive;t(this,e),Object.defineProperty(this,Wi,{value:Gi}),Object.defineProperty(this,Bi,{writable:!0,value:void 0}),Object.defineProperty(this,Ni,{writable:!0,value:void 0}),Object.defineProperty(this,Fi,{writable:!0,value:void 0}),Object.defineProperty(this,Ui,{writable:!0,value:void 0}),Object.defineProperty(this,qi,{writable:!0,value:void 0}),Object.defineProperty(this,Vi,{writable:!0,value:!1}),this.processingBackup=!1,C(this,Bi)[Bi]=n,C(this,Ni)[Ni]=o,C(this,Fi)[Fi]=r,C(this,Ui)[Ui]=a,C(this,qi)[qi]=s,kt.logger=n,kt.device=r,kt.account=o}return n(e,[{key:"processBackupEvents",value:function(){var e=Me.readFromLSorCookie(G);if(null!=e){for(var t in this.processingBackup=!0,e)if(e.hasOwnProperty(t)){var i=e[t];void 0===i.fired&&(C(this,Bi)[Bi].debug("Processing backup event : "+i.q),void 0!==i.q&&kt.fireRequest(i.q),i.fired=!0)}Me.saveToLSorCookie(G,e),this.processingBackup=!1}}},{key:"addSystemDataToObject",value:function(e,t){void 0===t&&(e=Pe(e,C(this,Bi)[Bi])),we(C(this,Bi)[Bi].wzrkError)||(e.wzrk_error=C(this,Bi)[Bi].wzrkError,C(this,Bi)[Bi].wzrkError={}),e.id=C(this,Ni)[Ni].id,xe(C(this,Fi)[Fi].gcookie)&&(e.g=C(this,Fi)[Fi].gcookie);var i=C(this,Ui)[Ui].getSessionCookieObject();e.s=i.s,e.pg=void 0===i.p?1:i.p;var n=document.location.protocol;return n=n.replace(":",""),e.af=a({lib:"web-sdk-v1.7.3",protocol:n},Le.flutterVersion),sessionStorage.hasOwnProperty("WZRK_D")&&(e.debug=!0),e}},{key:"addFlags",value:function(e){if(C(this,Vi)[Vi]=Me.getAndClearMetaProp(j),void 0!==C(this,Vi)[Vi]&&C(this,Vi)[Vi]&&(e.rc=!0,C(this,Bi)[Bi].debug("reset cookie sent in request and cleared from meta for future requests.")),C(this,qi)[qi]()){var t=Me.getMetaProp("lsTime"),i=Me.getMetaProp("exTs");if(void 0===t||void 0===i)return void(e.dsync=!0);t+i0?Le.privacyArray:t):(n=Le.privacyArray).push.apply(n,t);return 0}},{key:"_processOldValues",value:function(){C(this,Zi)[Zi]&&C(this,Yi)[Yi](C(this,Zi)[Zi]),C(this,Zi)[Zi]=null}}]),o}(p(Array)),Xi=function(e){if(Array.isArray(e)&&e.length>0){var t=e.reduce((function(e,t){return a(a({},e),t)}),{}),i={},n={},o=!1;if(t.hasOwnProperty(J)&&"boolean"==typeof(o=t.optOut)&&(n.ct_optout=o,Le.isOptInRequest=!o),t.hasOwnProperty(Z)){var r=t.useIP,s="boolean"==typeof r&&r;Me.setMetaProp(Z,s)}if(!we(n)){i.type="profile",i.profile=n,i=C(this,Hi)[Hi].addSystemDataToObject(i,void 0);var l=ft(JSON.stringify(i),C(this,$i)[$i]),c=C(this,Ji)[Ji].dataPostURL;c=pt(c,"type",Y),c=pt(c,"d",l),c=pt(c,J,o?"true":"false"),C(this,Hi)[Hi].saveAndFireRequest(c,Le.blockRequest),e.splice(0,e.length)}}},en=k("oldValues"),tn=k("logger"),nn=k("request"),on=k("account"),rn=k("wizAlertJSPath"),an=k("fcmPublicKey"),sn=k("setUpWebPush"),ln=k("setUpWebPushNotifications"),cn=k("setApplicationServerKey"),dn=k("setUpSafariNotifications"),un=k("setUpChromeFirefoxNotifications"),pn=k("addWizAlertJS"),hn=k("removeWizAlertJS"),fn=k("handleNotificationRegistration"),gn=function(e){s(o,e);var i=g(o);function o(e,n){var r,a=e.logger,s=(e.session,e.request),l=e.account;return t(this,o),r=i.call(this),Object.defineProperty(h(r),fn,{value:xn}),Object.defineProperty(h(r),hn,{value:Cn}),Object.defineProperty(h(r),pn,{value:kn}),Object.defineProperty(h(r),un,{value:wn}),Object.defineProperty(h(r),dn,{value:mn}),Object.defineProperty(h(r),cn,{value:yn}),Object.defineProperty(h(r),ln,{value:bn}),Object.defineProperty(h(r),sn,{value:vn}),Object.defineProperty(h(r),en,{writable:!0,value:void 0}),Object.defineProperty(h(r),tn,{writable:!0,value:void 0}),Object.defineProperty(h(r),nn,{writable:!0,value:void 0}),Object.defineProperty(h(r),on,{writable:!0,value:void 0}),Object.defineProperty(h(r),rn,{writable:!0,value:void 0}),Object.defineProperty(h(r),an,{writable:!0,value:void 0}),C(h(r),rn)[rn]="https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js",C(h(r),an)[an]=null,C(h(r),en)[en]=n,C(h(r),tn)[tn]=a,C(h(r),nn)[nn]=s,C(h(r),on)[on]=l,r}return n(o,[{key:"push",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i0?C(this,fn)[fn](e):null==Le.webPushEnabled&&e.length>0?(Le.notifApi.notifEnabledFromApi=!0,Le.notifApi.displayArgs=e.slice()):!1===Le.webPushEnabled&&e.length>0&&C(this,tn)[tn].error("Make sure push notifications are fully enabled and integrated")},bn=function(e,t,i,n){-1!==navigator.userAgent.indexOf("Chrome")||-1!==navigator.userAgent.indexOf("Firefox")?C(this,un)[un](e,t):-1!==navigator.userAgent.indexOf("Safari")&&C(this,dn)[dn](e,i,n)},yn=function(e){C(this,an)[an]=e},mn=function(e,t,i){var n=this;void 0===t&&C(this,tn)[tn].error("Ensure that APNS Web Push ID is supplied"),void 0===i&&C(this,tn)[tn].error("Ensure that APNS Web Push service path is supplied"),"safari"in window&&"pushNotification"in window.safari&&window.safari.pushNotification.requestPermission(i,t,{},(function(e){if("granted"===e.permission){var t=JSON.parse(JSON.stringify(e));t.endpoint=e.deviceToken,t.browser="Safari",Me.saveToLSorCookie(re,t),C(n,nn)[nn].registerToken(t),C(n,tn)[tn].info("Safari Web Push registered. Device Token: "+e.deviceToken)}else"denied"===e.permission&&C(n,tn)[tn].info("Error subscribing to Safari web push")}))},wn=function(e,t){var i=this,n="";"serviceWorker"in navigator&&navigator.serviceWorker.register(t).then((function(e){if("undefined"!=typeof __wzrk_account_id)return new Promise((function(t){return setTimeout((function(){return t(e)}),5e3)}));n=e.scope;return/^(\.?)(\/?)([^/]*).js$/.test(t)?navigator.serviceWorker.ready:-1!==navigator.userAgent.indexOf("Chrome")?new Promise((function(t){return setTimeout((function(){return t(e)}),5e3)})):navigator.serviceWorker.getRegistrations()})).then((function(t){-1!==navigator.userAgent.indexOf("Firefox")&&Array.isArray(t)&&(t=t.filter((function(e){return e.scope===n}))[0]);var o={userVisibleOnly:!0};null!=C(i,an)[an]&&(o.applicationServerKey=function(e){for(var t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),i=window.atob(t),n=[],o=0;o0&&void 0!==arguments[0]?arguments[0]:{};t(this,e),Object.defineProperty(this,io,{value:co}),Object.defineProperty(this,to,{value:lo}),Object.defineProperty(this,eo,{value:so}),Object.defineProperty(this,Xn,{value:ao}),Object.defineProperty(this,Qn,{value:ro}),Object.defineProperty(this,Yn,{value:oo}),Object.defineProperty(this,Nn,{writable:!0,value:void 0}),Object.defineProperty(this,Fn,{writable:!0,value:void 0}),Object.defineProperty(this,Un,{writable:!0,value:void 0}),Object.defineProperty(this,qn,{writable:!0,value:void 0}),Object.defineProperty(this,Vn,{writable:!0,value:void 0}),Object.defineProperty(this,Wn,{writable:!0,value:void 0}),Object.defineProperty(this,Kn,{writable:!0,value:void 0}),Object.defineProperty(this,Gn,{writable:!0,value:void 0}),Object.defineProperty(this,Hn,{writable:!0,value:void 0}),Object.defineProperty(this,Jn,{writable:!0,value:void 0}),Object.defineProperty(this,Zn,{writable:!0,value:C(this,Xn)[Xn].bind(this)}),Object.defineProperty(this,$n,{writable:!0,value:void 0}),this.enablePersonalization=void 0,this.popupCallbacks={},this.popupCurrentWzrkId="",C(this,Un)[Un]=0,this._isPersonalisationActive=this._isPersonalisationActive.bind(this),this.raiseNotificationClicked=function(){},C(this,Nn)[Nn]=new Ei(xi),C(this,Wn)[Wn]=new M(null===(i=d.account)||void 0===i?void 0:i[0],d.region||(null===(n=d.account)||void 0===n?void 0:n[1]),d.targetDomain||(null===(r=d.account)||void 0===r?void 0:r[2]),d.token||(null===(s=d.account)||void 0===s?void 0:s[3])),C(this,qn)[qn]=new Ve({logger:C(this,Nn)[Nn]}),C(this,$n)[$n]=d.dismissSpamControl||!1,C(this,Vn)[Vn]=new ji({logger:C(this,Nn)[Nn],isPersonalisationActive:this._isPersonalisationActive}),C(this,Kn)[Kn]=new Ki({logger:C(this,Nn)[Nn],account:C(this,Wn)[Wn],device:C(this,qn)[qn],session:C(this,Vn)[Vn],isPersonalisationActive:this._isPersonalisationActive}),this.enablePersonalization=d.enablePersonalization||!1,this.event=new ct({logger:C(this,Nn)[Nn],request:C(this,Kn)[Kn],isPersonalisationActive:this._isPersonalisationActive},d.event),this.profile=new Nt({logger:C(this,Nn)[Nn],request:C(this,Kn)[Kn],account:C(this,Wn)[Wn],isPersonalisationActive:this._isPersonalisationActive},d.profile),this.onUserLogin=new Yt({request:C(this,Kn)[Kn],account:C(this,Wn)[Wn],session:C(this,Vn)[Vn],logger:C(this,Nn)[Nn],device:C(this,qn)[qn]},d.onUserLogin),this.privacy=new Qi({request:C(this,Kn)[Kn],account:C(this,Wn)[Wn],logger:C(this,Nn)[Nn]},d.privacy),this.notifications=new gn({logger:C(this,Nn)[Nn],request:C(this,Kn)[Kn],account:C(this,Wn)[Wn]},d.notifications),C(this,Gn)[Gn]=new zn({logger:C(this,Nn)[Nn],request:C(this,Kn)[Kn],account:C(this,Wn)[Wn],event:this.event}),C(this,Fn)[Fn]=new Ue({logger:C(this,Nn)[Nn],request:C(this,Kn)[Kn],device:C(this,qn)[qn],session:C(this,Vn)[Vn]}),this.spa=d.spa,this.dismissSpamControl=d.dismissSpamControl,this.user=new ki({isPersonalisationActive:this._isPersonalisationActive}),this.session={getTimeElapsed:function(){return C(c,Vn)[Vn].getTimeElapsed()},getPageCount:function(){return C(c,Vn)[Vn].getPageCount()}},this.logout=function(){C(c,Nn)[Nn].debug("logout called"),Me.setInstantDeleteFlagInK()},this.clear=function(){c.onUserLogin.clear()},this.getCleverTapID=function(){return C(c,qn)[qn].getGuid()},this.getAccountID=function(){return C(c,Wn)[Wn].id},this.getSCDomain=function(){return C(c,Wn)[Wn].finalTargetDomain},this.setLibrary=function(e,t){Le.flutterVersion=o({},e,t)},this.setSCSDKVersion=function(e){C(c,Wn)[Wn].scSDKVersion=e;var t={};t.af={scv:"sc-sdk-v"+C(c,Wn)[Wn].scSDKVersion};var i=C(c,Wn)[Wn].dataPostURL;i=pt(i,"type","page"),i=pt(i,"d",ft(JSON.stringify(t),C(c,Nn)[Nn])),C(c,Kn)[Kn].saveAndFireRequest(i,Le.blockRequest)},vi()&&(hi(),pi(C(this,Nn)[Nn])),this.getInboxMessageCount=function(){var e=di();return Object.keys(e).length},this.getInboxMessageUnreadCount=function(){if(Le.inbox)return Le.inbox.unviewedCounter;C(c,Nn)[Nn].debug("No unread messages")},this.getAllInboxMessages=function(){return di()},this.getUnreadInboxMessages=function(){if(Le.inbox)return Le.inbox.unviewedMessages;C(c,Nn)[Nn].debug("No unread messages")},this.getInboxMessageForId=function(e){var t=di();if((null!==e||""!==e)&&t.hasOwnProperty(e))return t[e];C(c,Nn)[Nn].error("No message available for message Id "+e)},this.deleteInboxMessage=function(e){var t=di();if(null===e&&""===e||!t.hasOwnProperty(e))C(c,Nn)[Nn].error("No message available for message Id "+e);else{var i=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);0===t[e].viewed&&(Le.inbox.unviewedCounter--,delete Le.inbox.unviewedMessages[e],document.getElementById("unviewedBadge").innerText=Le.inbox.unviewedCounter,document.getElementById("unviewedBadge").style.display=Le.inbox.unviewedCounter>0?"flex":"none"),i&&i.remove(),delete t[e],ui(t)}},this.markReadInboxMessage=function(e){var t=Le.inbox.unviewedMessages,i=di();if(null===e&&""===e||!t.hasOwnProperty(e))C(c,Nn)[Nn].error("No message available for message Id "+e);else{var n=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);if(null!==n&&(n.shadowRoot.getElementById("unreadMarker").style.display="none"),i[e].viewed=1,document.getElementById("unviewedBadge")){var o=parseInt(document.getElementById("unviewedBadge").innerText)-1;document.getElementById("unviewedBadge").innerText=o,document.getElementById("unviewedBadge").style.display=o>0?"flex":"none"}window.clevertap.renderNotificationViewed({msgId:i[e].wzrk_id,pivotId:i[e].pivotId}),Le.inbox.unviewedCounter--,delete Le.inbox.unviewedMessages[e],ui(i)}},this.markReadInboxMessagesForIds=function(e){if(Array.isArray(e))for(var t=0;t0?(Object.keys(e).forEach((function(e){var i=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);null!==i&&(i.shadowRoot.getElementById("unreadMarker").style.display="none"),t[e].viewed=1,window.clevertap.renderNotificationViewed({msgId:t[e].wzrk_id,pivotId:t[e].wzrk_pivot})})),document.getElementById("unviewedBadge").innerText=0,document.getElementById("unviewedBadge").style.display="none",ui(t),Le.inbox.unviewedCounter=0,Le.inbox.unviewedMessages={}):C(c,Nn)[Nn].debug("All messages are already read")},this.toggleInbox=function(e){var t;return null===(t=Le.inbox)||void 0===t?void 0:t.toggleInbox(e)},this.renderNotificationViewed=function(e){u(ie,e)},this.renderNotificationClicked=function(e){u(ne,e)};var u=function(e,t){if(t&&t.msgId){var i={type:"event"};if(i.evtName=e,i.evtData=o({},te,t.msgId),t.pivotId&&(i.evtData=a(a({},i.evtData),{},{wzrk_pivot:t.pivotId})),t.wzrk_slideNo&&(i.evtData=a(a({},i.evtData),{},{wzrk_slideNo:t.wzrk_slideNo})),t.kv&&null!==t.kv&&void 0!==t.kv)for(var n in t.kv)n.startsWith(ee)&&(i.evtData=a(a({},i.evtData),{},o({},n,t.kv[n])));if(t.msgCTkv&&null!==t.msgCTkv&&void 0!==t.msgCTkv)for(var r in t.msgCTkv)r.startsWith(ee)&&(i.evtData=a(a({},i.evtData),{},o({},r,t.msgCTkv[r])));C(c,Kn)[Kn].processEvent(i)}};this.setLogLevel=function(e){C(c,Nn)[Nn].logLevel=Number(e),3===e?sessionStorage.WZRK_D="":delete sessionStorage.WZRK_D},this.handleIncrementValue=function(e,t){c.profile._handleIncrementDecrementValue(e,t,ae)},this.handleDecrementValue=function(e,t){c.profile._handleIncrementDecrementValue(e,t,se)},this.setMultiValuesForKey=function(e,t){Array.isArray(t)?c.profile._handleMultiValueSet(e,t,le):console.error("setMultiValuesForKey should be called with a value of type array")},this.addMultiValueForKey=function(e,t){"string"==typeof t||"number"==typeof t?c.profile._handleMultiValueAdd(e,t,ce):console.error("addMultiValueForKey should be called with a value of type string or number.")},this.addMultiValuesForKey=function(e,t){Array.isArray(t)?c.profile._handleMultiValueAdd(e,t,ce):console.error("addMultiValuesForKey should be called with a value of type array.")},this.removeMultiValueForKey=function(e,t){"string"==typeof t||"number"==typeof t?c.profile._handleMultiValueRemove(e,t,de):console.error("removeMultiValueForKey should be called with a value of type string or number.")},this.removeMultiValuesForKey=function(e,t){Array.isArray(t)?c.profile._handleMultiValueRemove(e,t,de):console.error("removeMultiValuesForKey should be called with a value of type array.")},this.removeValueForKey=function(e){c.profile._handleMultiValueDelete(e,ue)};var p=function(e,t,i){Lt(e,t,i,C(c,Wn)[Wn],C(c,Nn)[Nn])};function h(e){var t=e.coords.latitude,i=e.coords.longitude;Le.location={Latitude:t,Longitude:i},this.sendLocationData({Latitude:t,Longitude:i})}function f(e){switch(e.code){case e.PERMISSION_DENIED:console.log("User denied the request for Geolocation.");break;case e.POSITION_UNAVAILABLE:console.log("Location information is unavailable.");break;case e.TIMEOUT:console.log("The request to get user location timed out.");break;case e.UNKNOWN_ERROR:console.log("An unknown error occurred.")}}this.getLocation=function(e,t){if(e&&"number"!=typeof e||t&&"number"!=typeof t)console.log("Latitude and Longitude must be of number type");else if(e&&t){if(e<=-90||e>90)return void console.log("A vaid latitude must range between -90 and 90");if(t<=-180||t>180)return void console.log("A valid longitude must range between -180 and 180");Le.location={Latitude:e,Longitude:t},this.sendLocationData({Latitude:e,Longitude:t})}else navigator.geolocation?navigator.geolocation.getCurrentPosition(h.bind(this),f):console.log("Geolocation is not supported by this browser.")};var g=C(this,Fn)[Fn];g.logout=this.logout,g.clear=this.clear,g.closeIframe=function(e,t){At(e,0,C(c,Vn)[Vn].sessionId)},g.enableWebPush=function(e,t){c.notifications._enableWebPush(e,t)},g.tr=function(e){mi(e,{device:C(c,qn)[qn],session:C(c,Vn)[Vn],request:C(c,Kn)[Kn],logger:C(c,Nn)[Nn]})},g.setEnum=function(e){Mt(e,C(c,Nn)[Nn])},g.is_onloadcalled=function(){return 1===C(c,Un)[Un]},g.subEmail=function(e){p("1",e)},g.getEmail=function(e,t){p("-1",e,t)},g.unSubEmail=function(e){p("0",e)},g.unsubEmailGroups=function(e){Le.unsubGroups=[];for(var t=document.getElementsByClassName("ct-unsub-group-input-item"),i=0;i0&&this.privacy.push(Le.privacyArray),C(this,Yn)[Yn](),this.pageChanged();var s=setInterval((function(){C(o,qn)[qn].gcookie&&(clearInterval(s),C(o,Kn)[Kn].processBackupEvents())}),3e3);C(this,Hn)[Hn]?document.addEventListener("click",C(this,Zn)[Zn]):document.removeEventListener("click",C(this,Zn)[Zn]),C(this,Un)[Un]=1}}}},{key:"pageChanged",value:function(){var e=this,t=window.location.href,i=ut(t.toLowerCase()),n=C(this,Vn)[Vn].getSessionCookieObject(),o=void 0===n.p?0:n.p;n.p=++o,C(this,Vn)[Vn].setSessionCookieObject(n);var r={},a=function(e){if(""===e)return"";var t=document.createElement("a");return t.href=e,t.hostname}(document.referrer);if(window.location.hostname!==a){var s=120;""!==a&&(a=a.length>s?a.substring(0,s):a,r.referrer=a);var l=i.utm_source||i.wzrk_source;void 0!==l&&(l=l.length>s?l.substring(0,s):l,r.us=l);var c=i.utm_medium||i.wzrk_medium;void 0!==c&&(c=c.length>s?c.substring(0,s):c,r.um=c);var d=i.utm_campaign||i.wzrk_campaign;if(void 0!==d&&(d=d.length>s?d.substring(0,s):d,r.uc=d),void 0!==i.wzrk_medium){var u=i.wzrk_medium;u.match(/^email$|^social$|^search$/)&&(r.wm=u)}}(r=C(this,Kn)[Kn].addSystemDataToObject(r,void 0)).cpg=t,r.WZRK_CAMP=St();var p=C(this,Wn)[Wn].dataPostURL;C(this,Kn)[Kn].addFlags(r),1===parseInt(r.pg)&&C(this,io)[io](r),p=pt(p,"type","page"),p=pt(p,"d",ft(JSON.stringify(r),C(this,Nn)[Nn])),C(this,Kn)[Kn].saveAndFireRequest(p,Le.blockRequest),1===parseInt(r.pg)&&this.event.push(ge,{t:4}),C(this,Jn)[Jn]=t,setTimeout((function(){o<=3&&C(e,eo)[eo](),C(e,to)[to]()&&setInterval((function(){C(e,eo)[eo]()}),3e5)}),12e4)}},{key:"_isPersonalisationActive",value:function(){return Me._isLocalStorageSupported()&&this.enablePersonalization}},{key:"sendLocationData",value:function(e){var t={af:{}},i={};(t.type="profile",null==i.tz&&(i.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),t.profile=i,e)&&Object.keys(e).forEach((function(i){t.af[i]=e[i]}));Le.location&&(t.af=a(a({},t.af),Le.location)),t=C(this,Kn)[Kn].addSystemDataToObject(t,!0),C(this,Kn)[Kn].addFlags(t);var n=ft(JSON.stringify(t),C(this,Nn)[Nn]),o=C(this,Wn)[Wn].dataPostURL;o=pt(o,"type",Y),o=pt(o,"d",n),C(this,Kn)[Kn].saveAndFireRequest(o,Le.blockRequest)}},{key:"setOffline",value:function(e){"boolean"==typeof e?(Le.offline=e,e||C(this,Kn)[Kn].processBackupEvents()):console.error("setOffline should be called with a value of type boolean")}},{key:"defineVariable",value:function(e,t){return Sn.define(e,t,C(this,Gn)[Gn])}},{key:"syncVariables",value:function(e,t){if(4===C(this,Nn)[Nn].logLevel)return C(this,Gn)[Gn].syncVariables(e,t);var i="App log level is not set to 4";return C(this,Nn)[Nn].error(i),Promise.reject(new Error(i))}},{key:"fetchVariables",value:function(e){C(this,Gn)[Gn].fetchVariables(e)}},{key:"addVariablesChangedCallback",value:function(e){C(this,Gn)[Gn].addVariablesChangedCallback(e)}},{key:"addOneTimeVariablesChangedCallback",value:function(e){C(this,Gn)[Gn].addOneTimeVariablesChangedCallback(e)}},{key:"popupCallback",set:function(e){this.popupCallbacks[this.popupCurrentWzrkId]=e}}]),e}(),oo=function(){this.onUserLogin._processOldValues(),this.privacy._processOldValues(),this.event._processOldValues(),this.profile._processOldValues(),this.notifications._processOldValues()},ro=function(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300;return function(){clearTimeout(t),t=setTimeout(e,i)}},ao=function(){var e=this;C(this,Qn)[Qn]((function(){C(e,Jn)[Jn]!==location.href&&e.pageChanged()}))()},so=function(){var e=C(this,Wn)[Wn].dataPostURL,t={};t=C(this,Kn)[Kn].addSystemDataToObject(t,void 0),e=pt(e,"type","ping"),e=pt(e,"d",ft(JSON.stringify(t),C(this,Nn)[Nn])),C(this,Kn)[Kn].saveAndFireRequest(e,Le.blockRequest)},lo=function(){return void 0!==window.wzrk_d&&"continuous"===window.wzrk_d.ping},co=function(e){this._isPersonalisationActive()&&(e.dsync=!0)},uo=new no(window.clevertap);return window.clevertap=window.wizrocket=uo,uo})); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).clevertap=t()}(this,(function(){"use strict";var e=0;function t(t){return"__private_"+e+++"_"+t}function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}const o="clevertap-prod.com",n="https:";var s=t("accountId"),r=t("region"),a=t("targetDomain"),l=t("dcSdkversion"),c=t("token");class d{constructor(){let{id:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";Object.defineProperty(this,s,{writable:!0,value:void 0}),Object.defineProperty(this,r,{writable:!0,value:""}),Object.defineProperty(this,a,{writable:!0,value:o}),Object.defineProperty(this,l,{writable:!0,value:""}),Object.defineProperty(this,c,{writable:!0,value:""}),this.id=e,t&&(this.region=t),i&&(this.targetDomain=i),n&&(this.token=n)}get id(){return i(this,s)[s]}set id(e){i(this,s)[s]=e}get region(){return i(this,r)[r]}set region(e){i(this,r)[r]=e}get dcSDKVersion(){return i(this,l)[l]}set dcSDKVersion(e){i(this,l)[l]=e}get targetDomain(){return i(this,a)[a]}set targetDomain(e){i(this,a)[a]=e}get token(){return i(this,c)[c]}set token(e){i(this,c)[c]=e}get finalTargetDomain(){return this.region?"".concat(this.region,".").concat(this.targetDomain):this.targetDomain===o?"".concat("eu1",".").concat(this.targetDomain):this.targetDomain}get dataPostPEURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/defineVars")}get dataPostURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/a?t=96")}get recorderURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/r?r=1")}get emailURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/e?r=1")}}const h=new RegExp("^\\s+|\\.|:|\\$|'|\"|\\\\|\\s+$","g"),u=new RegExp("^\\s+|'|\"|\\\\|\\s+$","g"),p=new RegExp("'","g"),g="clear",f="Charged ID",v="WZRK_CHARGED_ID",b="WZRK_G",m="WZRK_K",y="WZRK_CAMP",w="WZRK_CAMP_G",C="WZRK_EV",k="WZRK_META",x="WZRK_PR",P="WZRK_ARP",S="WZRK_L",I="global",_="optOut",O="useIP",E="WZRK_X",A="push",L=31536e3,M="wzrk_",T="wzrk_id",R="Notification Viewed",j="Notification Clicked",D="WZRK_FPU",z="WZRK_PSD",B="$incr",N="$add",F="$remove",U="$delete",q="WZRK_INBOX_CONFIG",V="WZRK_INBOX",W=1e3,K="wzrk_fetch",H=["Stayed","UTM Visited","App Launched","Notification Sent",R,j],G=e=>"string"==typeof e||e instanceof String,J=e=>"[object Object]"===Object.prototype.toString.call(e),Z=e=>"object"==typeof e&&e instanceof Date,$=e=>{for(const t in e)if(e.hasOwnProperty(t))return!1;return!0},Y=e=>!isNaN(parseFloat(e))&&isFinite(e),Q=e=>/^-?[\d.]+(?:e-?\d+)?$/.test(e)&&"number"==typeof e,X=e=>null!=e&&"undefined"!==e,ee=(e,t)=>{if("object"!=typeof e){let i;return G(e)?(i=te(e,u),i.length>1024&&(i=i.substring(0,1024),t.reportError(521,i+"... length exceeded 1024 chars. Trimmed."))):i=e,i}for(const i in e)if(e.hasOwnProperty(i)){const o=ee(e[i],t);let n;n=te(i,h),n.length>1024&&(n=n.substring(0,1024),t.reportError(520,n+"... length exceeded 1024 chars. Trimmed.")),delete e[i],e[n]=o}return e},te=(e,t)=>e.replace(t,""),ie=()=>{const e=new Date;return e.getFullYear()+""+e.getMonth()+e.getDay()},oe=()=>Math.floor((new Date).getTime()/1e3),ne=e=>"$D_"+Math.round(e.getTime()/1e3),se=e=>{if(re(e))return"$D_"+e},re=e=>{const t=/^(\d{4})(\d{2})(\d{2})$/.exec(e);if(null==t)return!1;const i=t[3],o=t[2]-1,n=t[1],s=new Date(n,o,i);return s.getDate()==i&&s.getMonth()==o&&s.getFullYear()==n};class ae{static save(e,t){return!(!e||!t)&&(this._isLocalStorageSupported()?(localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),!0):void 0)}static read(e){if(!e)return!1;let t=null;if(this._isLocalStorageSupported()&&(t=localStorage.getItem(e)),null!=t)try{t=JSON.parse(t)}catch(e){}return t}static remove(e){return!!e&&(this._isLocalStorageSupported()?(localStorage.removeItem(e),!0):void 0)}static removeCookie(e,t){let i=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";t&&(i=i+" domain="+t+"; path=/"),document.cookie=i}static createCookie(e,t,i,o){let n="",s="";if(i){const e=new Date;e.setTime(e.getTime()+1e3*i),n="; expires="+e.toGMTString()}o&&(s="; domain="+o),t=encodeURIComponent(t),document.cookie=e+"="+t+n+s+"; path=/"}static readCookie(e){const t=e+"=",i=document.cookie.split(";");for(let e=0;e=0;o--){if(a=0===o?r[o]+a:"."+r[o]+a,this.readCookie(e)){var n="test_"+e+o;if(this.createCookie(n,t,10,a),!this.readCookie(n))continue;this.removeCookie(n,a)}this.createCookie(e,t,i,a);if(this.readCookie(e)==t){s=a,le.broadDomain=s;break}}}else this.createCookie(e,t,i,s)}else this.createCookie(e,t,i,o)}static getMetaProp(e){const t=this.readFromLSorCookie(k);if(null!=t)return t[e]}static setMetaProp(e,t){if(this._isLocalStorageSupported()){let i=this.readFromLSorCookie(k);null==i&&(i={}),void 0===t?delete i[e]:i[e]=t,this.saveToLSorCookie(k,i)}}static getAndClearMetaProp(e){const t=this.getMetaProp(e);return this.setMetaProp(e,void 0),t}static setInstantDeleteFlagInK(){let e=this.readFromLSorCookie(m);null==e&&(e={}),e.flag=!0,this.saveToLSorCookie(m,e)}static backupEvent(e,t,i){let o=this.readFromLSorCookie(S);void 0===o&&(o={}),o[t]={q:e},this.saveToLSorCookie(S,o),i.debug("stored in ".concat(S," reqNo : ").concat(t," -> ").concat(e))}static removeBackup(e,t){const i=this.readFromLSorCookie(S);null!=i&&void 0!==i[e]&&(t.debug("del event: ".concat(e," data-> ").concat(i[e].q)),delete i[e],this.saveToLSorCookie(S,i))}}const le={globalCache:{gcookie:null,REQ_N:0,RESP_N:0},LRU_CACHE:null,globalProfileMap:void 0,globalEventsMap:void 0,blockRequest:!1,isOptInRequest:!1,broadDomain:null,webPushEnabled:null,campaignDivMap:{},currentSessionId:null,wiz_counter:0,notifApi:{notifEnabledFromApi:!1},unsubGroups:[],updatedCategoryLong:null,inbox:null,isPrivacyArrPushed:!1,privacyArray:[],offline:!1,location:null,dismissSpamControl:!1,globalUnsubscribe:!0,flutterVersion:null,variableStore:{}};var ce=t("keyOrder"),de=t("deleteFromObject");class he{constructor(e){Object.defineProperty(this,de,{value:ue}),Object.defineProperty(this,ce,{writable:!0,value:void 0}),this.max=e;let t=ae.readFromLSorCookie(E);if(t){const e={};i(this,ce)[ce]=[],t=t.cache;for(const o in t)t.hasOwnProperty(o)&&(e[t[o][0]]=t[o][1],i(this,ce)[ce].push(t[o][0]));this.cache=e}else this.cache={},i(this,ce)[ce]=[]}get(e){const t=this.cache[e];return t&&(this.cache=i(this,de)[de](e,this.cache),this.cache[e]=t,i(this,ce)[ce].push(e)),this.saveCacheToLS(this.cache),t}set(e,t){const o=this.cache[e],n=i(this,ce)[ce];null!=o?this.cache=i(this,de)[de](e,this.cache):n.length===this.max&&(this.cache=i(this,de)[de](n[0],this.cache)),this.cache[e]=t,i(this,ce)[ce][i(this,ce)[ce]-1]!==e&&i(this,ce)[ce].push(e),this.saveCacheToLS(this.cache)}saveCacheToLS(e){const t=[],o=i(this,ce)[ce];for(const i in o)if(o.hasOwnProperty(i)){const n=[];n.push(o[i]),n.push(e[o[i]]),t.push(n)}ae.saveToLSorCookie(E,{cache:t})}getKey(e){if(null===e)return null;const t=i(this,ce)[ce];for(const i in t)if(t.hasOwnProperty(i)&&this.cache[t[i]]===e)return t[i];return null}getSecondLastKey(){const e=i(this,ce)[ce];return null!=e&&e.length>1?e[e.length-2]:-1}getLastKey(){const e=i(this,ce)[ce].length;if(e)return i(this,ce)[ce][e-1]}}var ue=function(e,t){const o=JSON.parse(JSON.stringify(i(this,ce)[ce])),n={};let s;for(const i in o)o.hasOwnProperty(i)&&(o[i]!==e?n[o[i]]=t[o[i]]:s=i);return o.splice(s,1),i(this,ce)[ce]=JSON.parse(JSON.stringify(o)),n},pe=t("logger"),ge=t("request"),fe=t("device"),ve=t("session");class be{constructor(e){let{logger:t,request:o,device:n,session:s}=e;Object.defineProperty(this,pe,{writable:!0,value:void 0}),Object.defineProperty(this,ge,{writable:!0,value:void 0}),Object.defineProperty(this,fe,{writable:!0,value:void 0}),Object.defineProperty(this,ve,{writable:!0,value:void 0}),i(this,pe)[pe]=t,i(this,ge)[ge]=o,i(this,fe)[fe]=n,i(this,ve)[ve]=s}s(e,t,o,n,s){let r=!1,a=!1;if(window.isOULInProgress&&(o||"undefined"!==n&&n===window.oulReqN)&&(window.isOULInProgress=!1,r=!0),void 0===n&&(n=0),ae.removeBackup(n,i(this,pe)[pe]),n>le.globalCache.REQ_N)return;if(X(i(this,fe)[fe].gcookie)||e&&(a=!0),!X(i(this,fe)[fe].gcookie)||o||"boolean"==typeof s){const n=i(this,ve)[ve].getSessionCookieObject();if(window.isOULInProgress||n.s&&t{if(J(e)){for(var t in e)if(e.hasOwnProperty(t)){if(J(e[t])||Array.isArray(e[t]))return!1;Z(e[t])&&(e[t]=ne(e[t]))}return!0}return!1},Re=(e,t)=>{if(J(e)){for(var i in e)if(e.hasOwnProperty(i))if("Items"===i){if(!Array.isArray(e[i]))return!1;for(var o in e[i].length>50&&t.reportError(522,"Charged Items exceed 50 limit. Actual count: "+e[i].length),e[i])if(e[i].hasOwnProperty(o)&&(!J(e[i][o])||!Te(e[i][o])))return!1}else{if(J(e[i])||Array.isArray(e[i]))return!1;Z(e[i])&&(e[i]=ne(e[i]))}if(G(e[f])||Q(e[f])){const i=e[f]+"";if(void 0===Me&&(Me=ae.readFromLSorCookie(v)),void 0!==Me&&Me.trim()===i.trim())return t.error("Duplicate charged Id - Dropped"+e),!1;Me=i,ae.saveToLSorCookie(v,i)}return!0}return!1};var je=t("logger"),De=t("oldValues"),ze=t("request"),Be=t("isPersonalisationActive"),Ne=t("processEventArray");class Fe extends Array{constructor(e,t){let{logger:o,request:n,isPersonalisationActive:s}=e;super(),Object.defineProperty(this,Ne,{value:Ue}),Object.defineProperty(this,je,{writable:!0,value:void 0}),Object.defineProperty(this,De,{writable:!0,value:void 0}),Object.defineProperty(this,ze,{writable:!0,value:void 0}),Object.defineProperty(this,Be,{writable:!0,value:void 0}),i(this,je)[je]=o,i(this,De)[De]=t,i(this,ze)[ze]=n,i(this,Be)[Be]=s}push(){for(var e=arguments.length,t=new Array(e),o=0;o0;){var t=e.shift();if(!G(t)){i(this,je)[je].error(xe);continue}if(t.length>1024&&(t=t.substring(0,1024),i(this,je)[je].reportError(510,t+"... length exceeded 1024 chars. Trimmed.")),H.includes(t)){i(this,je)[je].reportError(513,t+" is a restricted system event. It cannot be used as an event name.");continue}const o={type:"event"};if(o.evtName=te(t,h),0!==e.length){const n=e.shift();if(J(n)){if("Charged"===t){if(!Re(n,i(this,je)[je])){i(this,je)[je].reportError(511,"Charged event structure invalid. Not sent.");continue}}else if(!Te(n)){i(this,je)[je].reportError(512,t+" event structure invalid. Not sent.");continue}o.evtData=n}else e.unshift(n)}i(this,ze)[ze].processEvent(o)}};const qe=e=>{const t={},i=e.indexOf("?");if(i>1){const o=e.substring(i+1);let n;const s=/\+/g,r=/([^&=]+)=?([^&]*)/g,a=function(e){let t=e.replace(s," ");try{t=decodeURIComponent(t)}catch(e){}return t};for(n=r.exec(o);n;)t[a(n[1])]=a(n[2]),n=r.exec(o)}return t},Ve=(e,t,i)=>e+"&"+t+"="+encodeURIComponent(i),We=()=>window.location.hostname,Ke=(e,t)=>(t&&"function"==typeof t.debug&&t.debug("dobj:"+e),Ge(e)),He=(()=>{let e="",t=0;for(t=0;t<=25;t++)e+=String.fromCharCode(t+65);for(t=0;t<=25;t++)e+=String.fromCharCode(t+97);for(t=0;t<10;t++)e+=t;return e+"+/="})(),Ge=e=>{if(null==e)return"";var t,i,o,n,s,r,a,l="",c=0;for(e=(e=>{if(null==e)return"";let t,i,o,n={},s={},r="",a="",l="",c=2,d=3,h=2,u="",p=0,g=0,f=String.fromCharCode;for(o=0;o>=1}else{for(i=1,t=0;t>=1}c--,0==c&&(c=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;c--,0==c&&(c=Math.pow(2,h),h++),n[a]=d++,l=String(r)}if(""!==l){if(Object.prototype.hasOwnProperty.call(s,l)){if(l.charCodeAt(0)<256){for(t=0;t>=1}else{for(i=1,t=0;t>=1}c--,0==c&&(c=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;c--,0==c&&(c=Math.pow(2,h),h++)}for(i=2,t=0;t>=1;for(;;){if(p<<=1,15==g){u+=f(p);break}g++}return u})(e);c<2*e.length;)c%2==0?(t=e.charCodeAt(c/2)>>8,i=255&e.charCodeAt(c/2),o=c/2+1>8:NaN):(t=255&e.charCodeAt((c-1)/2),(c+1)/2>8,o=255&e.charCodeAt((c+1)/2)):i=o=NaN),c+=3,n=t>>2,s=(3&t)<<4|i>>4,r=(15&i)<<2|o>>6,a=63&o,isNaN(i)?r=a=64:isNaN(o)&&(a=64),l=l+He.charAt(n)+He.charAt(s)+He.charAt(r)+He.charAt(a);return l};var Je=t("fireRequest"),Ze=t("dropRequestDueToOptOut"),$e=t("addUseIPToRequest"),Ye=t("addARPToRequest");class Qe{constructor(){this.networkRetryCount=0,this.minDelayFrequency=0}static fireRequest(e,t,o,n){i(this,Je)[Je](e,1,t,o,n)}getDelayFrequency(){if(this.logger.debug("Network retry #"+this.networkRetryCount),this.networkRetryCount<10)return this.logger.debug(this.account.id,"Failure count is "+this.networkRetryCount+". Setting delay frequency to 1s"),this.minDelayFrequency=W,this.minDelayFrequency;if(null==this.account.region)return this.logger.debug(this.account.id,"Setting delay frequency to 1s"),W;{const e=1e3*(Math.floor(10*Math.random())+1);return this.minDelayFrequency+=e,this.minDelayFrequency<6e5?(this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency):(this.minDelayFrequency=W,this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency)}}}Qe.logger=void 0,Qe.device=void 0,Qe.account=void 0,Object.defineProperty(Qe,Je,{value:function(e,t,o,n,s){var r,a;if(i(this,Ze)[Ze]())return void this.logger.debug("req dropped due to optout cookie: "+this.device.gcookie);if(X(this.device.gcookie)||(le.blockRequest=!0),s&&s===K)!X(this.device.gcookie)&&le.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(this.networkRetryCount)),i(this,Je)[Je](e,void 0,o,n)}),this.getDelayFrequency());else if(!X(this.device.gcookie)&&le.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(t)),i(this,Je)[Je](e,t+1,o,n)}),50);if(n?window.isOULInProgress=!0:(X(this.device.gcookie)&&(e=Ve(e,"gc",this.device.gcookie)),e=i(this,Ye)[Ye](e,o)),e=Ve(e,"tries",t),e=i(this,$e)[$e](e),e=Ve(e,"r",(new Date).getTime()),(null===(r=window.clevertap)||void 0===r?void 0:r.hasOwnProperty("plugin"))||(null===(a=window.wizrocket)||void 0===a?void 0:a.hasOwnProperty("plugin"))){const t=window.clevertap.plugin||window.wizrocket.plugin;e=Ve(e,"ct_pl",t)}-1!==e.indexOf("chrome-extension:")&&(e=e.replace("chrome-extension:","https:"));for(var l=document.getElementsByClassName("ct-jp-cb");l[0]&&l[0].parentNode;)l[0].parentNode.removeChild(l[0]);const c=document.createElement("script");c.setAttribute("type","text/javascript"),c.setAttribute("src",e),c.setAttribute("class","ct-jp-cb"),c.setAttribute("rel","nofollow"),c.async=!0,document.getElementsByTagName("head")[0].appendChild(c),this.logger.debug("req snt -> url: "+e)}}),Object.defineProperty(Qe,Ze,{value:function(){return!le.isOptInRequest&&X(this.device.gcookie)&&G(this.device.gcookie)?":OO"===this.device.gcookie.slice(-3):(le.isOptInRequest=!1,!1)}}),Object.defineProperty(Qe,$e,{value:function(e){var t=ae.getMetaProp(O);return"boolean"!=typeof t&&(t=!1),Ve(e,O,t?"true":"false")}}),Object.defineProperty(Qe,Ye,{value:function(e,t){if(!0===t){const t={skipResARP:!0};return Ve(e,"arp",Ke(JSON.stringify(t),this.logger))}return ae._isLocalStorageSupported()&&void 0!==localStorage.getItem(P)&&null!==localStorage.getItem(P)?Ve(e,"arp",Ke(JSON.stringify(ae.readFromLSorCookie(P)),this.logger)):e}});const Xe=()=>{let e={};if(ae._isLocalStorageSupported()){let t=ae.read(y);null!=t?(t=JSON.parse(decodeURIComponent(t).replace(p,'"')),t.hasOwnProperty("global")?e.wp=t:e=t):e={}}return e},et=e=>{if(ae._isLocalStorageSupported()){const t={...Xe(),...e},i=JSON.stringify(t);ae.save(y,encodeURIComponent(i)),tt()}},tt=()=>{if(ae._isLocalStorageSupported()){let i=ae.read(b);if(X(i))try{i=JSON.parse(decodeURIComponent(ae.read(b)));const o=ae.read(w)?JSON.parse(decodeURIComponent(ae.read(w))):{};if(i&&ae._isLocalStorageSupported()){var e={},t=Xe();Object.keys(t).forEach((n=>{const s=i in o&&Object.keys(o[i]).length&&o[i][n]?o[i][n]:{},r=t[n].global,a=ie(),l=t[n][a];if(void 0!==r){const e=Object.keys(r);for(const t in e){let i=[];if(e.hasOwnProperty(t)){let o=0,n=0;const a=e[t];if("tc"===a)continue;void 0!==l&&void 0!==l[a]&&(o=l[a]),void 0!==r&&void 0!==r[a]&&(n=r[a]),i=[a,o,n],s[a]=i}}}e={...e,[n]:s}})),o[i]=e,ae.save(w,encodeURIComponent(JSON.stringify(o)))}}catch(e){console.error("Invalid clevertap Id "+e)}}},it=()=>{const e=JSON.parse(decodeURIComponent(ae.read(b)));let t={};if(ae._isLocalStorageSupported()){let i={};t=Xe();const o=ae.read(w),n=o?decodeURIComponent(o):null,s=n?JSON.parse(n):null,r=e&&null!=o&&s&&s[e]&&s[e].wp?Object.values(s[e].wp):[],a=e&&null!=o&&s&&s[e]&&s[e].wi?Object.values(s[e].wi):[],l=ie();let c=0,d=0;return t.wp&&t.wp[l]&&"undefined"!==t.wp[l].tc&&(c=t.wp[l].tc),t.wi&&t.wi[l]&&"undefined"!==t.wi[l].tc&&(d=t.wi[l].tc),i={wmp:c,wimp:d,tlc:r,witlc:a},i}},ot=(e,t)=>{let{logger:i}=t,o=!1;if(J(e))for(const t in e)if(e.hasOwnProperty(t)){o=!0;let n=e[t];if(null==n){delete e[t];continue}"Gender"!==t||n.match(/^M$|^F$/)||(o=!1,i.error(Pe)),"Employed"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Se)),"Married"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Ie)),"Education"!==t||n.match(/^School$|^College$|^Graduate$/)||(o=!1,i.error(_e)),"Age"===t&&null!=n&&(Y(n)?e.Age=+n:(o=!1,i.error(Oe))),"DOB"===t?(/^\$D_/.test(n)&&11===(n+"").length||Z(n)||(o=!1,i.error(Ee)),Z(n)&&(e[t]=ne(n))):Z(n)&&(e[t]=ne(n)),"Phone"!==t||$(n)||(n.length>8&&"+"===n.charAt(0)?(n=n.substring(1,n.length),Y(n)?e.Phone=+n:(o=!1,i.error(Le+". Removed."))):(o=!1,i.error(Le+". Removed."))),o||delete e[t]}return o},nt=e=>{const t={};t.Name=e.name,null!=e.id&&(t.FBID=e.id+""),"male"===e.gender?t.Gender="M":"female"===e.gender?t.Gender="F":t.Gender="O";null!=e.relationship_status&&(t.Married="N","Married"===e.relationship_status&&(t.Married="Y"));const i=function(e){if(null!=e){let t="",i="";for(let o=0;o0?"Y":"N",null!=e.email&&(t.Email=e.email),null!=e.birthday){const i=e.birthday.split("/");t.DOB=se(i[2]+i[0]+i[1])}return t},st=(e,t)=>{let{logger:i}=t;const o={};if(null!=e.displayName&&(o.Name=e.displayName),null!=e.id&&(o.GPID=e.id+""),null!=e.gender&&("male"===e.gender?o.Gender="M":"female"===e.gender?o.Gender="F":"other"===e.gender&&(o.Gender="O")),null!=e.image&&!1===e.image.isDefault&&(o.Photo=e.image.url.split("?sz")[0]),null!=e.emails)for(let t=0;t{if(ae._isLocalStorageSupported()){if(null==le.globalProfileMap&&(le.globalProfileMap=ae.readFromLSorCookie(x),null==le.globalProfileMap&&(le.globalProfileMap={})),null!=e._custom){const t=e._custom;for(const i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);delete e._custom}for(const i in e)if(e.hasOwnProperty(i)){if(le.globalProfileMap.hasOwnProperty(i)&&!t)continue;le.globalProfileMap[i]=e[i]}null!=le.globalProfileMap._custom&&delete le.globalProfileMap._custom,ae.saveToLSorCookie(x,le.globalProfileMap)}},at=(e,t,i)=>{if(null!=e&&"-1"!==e&&ae._isLocalStorageSupported()){const t=Xe();let o=t.wp[i];null==o&&(o={},t[i]=o),o[e]="dnd",et(t)}if(null!=le.campaignDivMap){const t=le.campaignDivMap[e];null!=t&&(document.getElementById(t).style.display="none","intentPreview"===t&&null!=document.getElementById("intentOpacityDiv")&&(document.getElementById("intentOpacityDiv").style.display="none"))}};var lt=t("logger"),ct=t("request"),dt=t("account"),ht=t("oldValues"),ut=t("isPersonalisationActive"),pt=t("processProfileArray");class gt extends Array{constructor(e,t){let{logger:o,request:n,account:s,isPersonalisationActive:r}=e;super(),Object.defineProperty(this,pt,{value:ft}),Object.defineProperty(this,lt,{writable:!0,value:void 0}),Object.defineProperty(this,ct,{writable:!0,value:void 0}),Object.defineProperty(this,dt,{writable:!0,value:void 0}),Object.defineProperty(this,ht,{writable:!0,value:void 0}),Object.defineProperty(this,ut,{writable:!0,value:void 0}),i(this,lt)[lt]=o,i(this,ct)[ct]=n,i(this,dt)[dt]=s,i(this,ht)[ht]=t,i(this,ut)[ut]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o0)for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];let n,s={};if(null!=o.Site){if(n=o.Site,$(n)||!ot(n,{logger:i(this,lt)[lt]}))return}else if(null!=o.Facebook){const e=o.Facebook;$(e)||e.error||(n=nt(e))}else if(null!=o["Google Plus"]){const e=o["Google Plus"];$(e)||e.error||(n=st(e,{logger:i(this,lt)[lt]}))}if(null!=n&&!$(n)){s.type="profile",null==n.tz&&(n.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),s.profile=n,rt(n,!0),s=i(this,ct)[ct].addSystemDataToObject(s,void 0),i(this,ct)[ct].addFlags(s);const e=Ke(JSON.stringify(s),i(this,lt)[lt]);let t=i(this,dt)[dt].dataPostURL;t=Ve(t,"type",A),t=Ve(t,"d",e),i(this,ct)[ct].saveAndFireRequest(t,le.blockRequest)}}},vt=t("request"),bt=t("logger"),mt=t("account"),yt=t("session"),wt=t("oldValues"),Ct=t("device"),kt=t("processOUL"),xt=t("handleCookieFromCache"),Pt=t("deleteUser"),St=t("processLoginArray");class It extends Array{constructor(e,t){let{request:o,account:n,session:s,logger:r,device:a}=e;super(),Object.defineProperty(this,St,{value:At}),Object.defineProperty(this,Pt,{value:Et}),Object.defineProperty(this,xt,{value:Ot}),Object.defineProperty(this,kt,{value:_t}),Object.defineProperty(this,vt,{writable:!0,value:void 0}),Object.defineProperty(this,bt,{writable:!0,value:void 0}),Object.defineProperty(this,mt,{writable:!0,value:void 0}),Object.defineProperty(this,yt,{writable:!0,value:void 0}),Object.defineProperty(this,wt,{writable:!0,value:void 0}),Object.defineProperty(this,Ct,{writable:!0,value:void 0}),i(this,vt)[vt]=o,i(this,mt)[mt]=n,i(this,yt)[yt]=s,i(this,bt)[bt]=r,i(this,wt)[wt]=t,i(this,Ct)[Ct]=a}clear(){i(this,bt)[bt].debug("clear called. Reset flag has been set."),i(this,Pt)[Pt](),ae.setMetaProp(g,!0)}push(){for(var e=arguments.length,t=new Array(e),o=0;o{let o=ae.readFromLSorCookie(m);const n=ae.readFromLSorCookie(b);let s;if(null==o)o={},s=e;else{s=o.id;let r=!1,a=!1;if(null==s&&(s=e[0],r=!0),null==le.LRU_CACHE&&ae._isLocalStorageSupported()&&(le.LRU_CACHE=new he(100)),r)null!=n&&(le.LRU_CACHE.set(s,n),le.blockRequest=!1);else for(const t in e)if(e.hasOwnProperty(t)){const i=e[t];if(le.LRU_CACHE.cache[i]){s=i,a=!0;break}}if(a){s!==le.LRU_CACHE.getLastKey()?i(this,xt)[xt]():(t=!1,ae.saveToLSorCookie(D,t));const e=le.LRU_CACHE.get(s);le.LRU_CACHE.set(s,e),ae.saveToLSorCookie(b,e),i(this,Ct)[Ct].gcookie=e;const o=le.LRU_CACHE.getSecondLastKey();if(ae.readFromLSorCookie(D)&&-1!==o){const e=le.LRU_CACHE.cache[o];i(this,vt)[vt].unregisterTokenForGuid(e)}}else r?null!=n&&(i(this,Ct)[Ct].gcookie=n,ae.saveToLSorCookie(b,n),t=!1):this.clear(),ae.saveToLSorCookie(D,!1),s=e[0]}o.id=s,ae.saveToLSorCookie(m,o)};if(Array.isArray(e)&&e.length>0)for(const n in e)if(e.hasOwnProperty(n)){const s=e[n];let r,a={};if(null!=s.Site){if(r=s.Site,$(r)||!ot(r,{logger:i(this,bt)[bt]}))return}else if(null!=s.Facebook){const e=s.Facebook;$(e)||e.error||(r=nt(e))}else if(null!=s["Google Plus"]){const e=s["Google Plus"];$(e)&&!e.error&&(r=st(e,{logger:i(this,bt)[bt]}))}if(null!=r&&!$(r)){a.type="profile",null==r.tz&&(r.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),a.profile=r;const e=[];ae._isLocalStorageSupported()&&(r.Identity&&e.push(r.Identity),r.Email&&e.push(r.Email),r.GPID&&e.push("GP:"+r.GPID),r.FBID&&e.push("FB:"+r.FBID),e.length>0&&o(e)),rt(r,!0),a=i(this,vt)[vt].addSystemDataToObject(a,void 0),i(this,vt)[vt].addFlags(a),t&&(a.isOUL=!0);const n=Ke(JSON.stringify(a),i(this,bt)[bt]);let s=i(this,mt)[mt].dataPostURL;s=Ve(s,"type",A),s=Ve(s,"d",n),i(this,vt)[vt].saveAndFireRequest(s,le.blockRequest,t)}}},Ot=function(){le.blockRequest=!1,console.debug("Block request is false"),ae._isLocalStorageSupported()&&(delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),ae.removeCookie(y,We()),ae.removeCookie(i(this,yt)[yt].cookieName,le.broadDomain),ae.removeCookie(P,le.broadDomain),i(this,yt)[yt].setSessionCookieObject("")},Et=function(){le.blockRequest=!0,i(this,bt)[bt].debug("Block request is true"),le.globalCache={gcookie:null,REQ_N:0,RESP_N:0},ae._isLocalStorageSupported()&&(delete localStorage.WZRK_G,delete localStorage.WZRK_K,delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),ae.removeCookie(b,le.broadDomain),ae.removeCookie(y,We()),ae.removeCookie(m,We()),ae.removeCookie(i(this,yt)[yt].cookieName,le.broadDomain),ae.removeCookie(P,le.broadDomain),i(this,Ct)[Ct].gcookie=null,i(this,yt)[yt].setSessionCookieObject("")},At=function(e){if(Array.isArray(e)&&e.length>0){const t=e.pop();if(null!=t&&J(t)&&(null!=t.Site&&Object.keys(t.Site).length>0||null!=t.Facebook&&Object.keys(t.Facebook).length>0||null!=t["Google Plus"]&&Object.keys(t["Google Plus"]).length>0)){ae.setInstantDeleteFlagInK();try{i(this,kt)[kt]([t])}catch(e){i(this,bt)[bt].debug(e)}}else i(this,bt)[bt].error("Profile object is in incorrect format")}};class Lt extends HTMLElement{constructor(){super(),this._details=null,this.shadow=null,this.shadow=this.attachShadow({mode:"open"})}get details(){return this._details||""}set details(e){null===this._details&&(this._details=e,this.renderBanner())}renderBanner(){this.shadow.innerHTML=this.getBannerContent(),!1!==this.trackClick&&this.addEventListener("click",(()=>{const e=this.details.onClick;e&&(this.details.window?window.open(e,"_blank"):window.parent.location.href=e),window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId})}getBannerContent(){return'\n \n \n ")}}class Mt extends HTMLElement{constructor(){super(),this._target=null,this._carousel=null,this.shadow=null,this.slides=0,this.previouslySelectedItem=-1,this.selectedItem=1,this.autoSlide=null,this.stopAutoSlideTimeout=null,this.shadow=this.attachShadow({mode:"open"}),void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Lt)}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderCarousel())}get details(){return this.target.display.details}get display(){return this.target.display}renderCarousel(){this.slides=this.details.length,this.shadow.innerHTML=this.getStyles();const e=this.getCarouselContent();this.display.showNavBtns&&e.insertAdjacentHTML("beforeend",this.display.navBtnsHtml),this.display.showNavArrows&&(e.insertAdjacentHTML("beforeend",this.display.leftNavArrowHtml),e.insertAdjacentHTML("beforeend",this.display.rightNavArrowHtml)),this._carousel=e,this.shadow.appendChild(e),this.setupClick(),this.updateSelectedItem(),this.startAutoSlide(),this.setupOnHover(),window.clevertap.renderNotificationViewed({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot})}setupClick(){this._carousel.addEventListener("click",(e=>{const t=e.target.id;if(t.startsWith("carousel__button")){const e=+t.split("-")[1];e!==this.selectedItem&&(this.previouslySelectedItem=this.selectedItem,this.selectedItem=e,this.updateSelectedItem(),this.startAutoSlide())}else if(t.startsWith("carousel__arrow"))t.endsWith("right")?this.goToNext():this.goToPrev(),this.startAutoSlide();else if(t.indexOf("-")>-1){const e=+t.split("-")[1],i=e-1;window.parent.clevertap&&window.clevertap.renderNotificationClicked({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot,wzrk_slideNo:e});const o=this.details[i].onClick;""!==o&&(this.details[i].window?window.open(o,"_blank"):window.location.href=o)}}))}setupOnHover(){this._carousel.addEventListener("mouseenter",(e=>{this.stopAutoSlideTimeout=setTimeout((()=>{this.autoSlide=clearInterval(this.autoSlide)}),500)})),this._carousel.addEventListener("mouseleave",(e=>{clearTimeout(this.stopAutoSlideTimeout),void 0===this.autoSlide&&this.startAutoSlide()}))}getCarouselContent(){const e=document.createElement("div");return e.setAttribute("class","carousel"),this.details.forEach(((t,i)=>{const o=document.createElement("ct-web-personalisation-banner");o.classList.add("carousel__item"),o.trackClick=!1,o.setAttribute("id","carousel__item-".concat(i+1)),o.details=t,e.appendChild(o)})),e}getStyles(){var e,t;return"\n \n ")}updateSelectedItem(){if(-1!==this.previouslySelectedItem){const e=this.shadow.getElementById("carousel__item-".concat(this.previouslySelectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.previouslySelectedItem));e.classList.remove("carousel__item--selected"),t&&t.classList.remove("carousel__button--selected")}const e=this.shadow.getElementById("carousel__item-".concat(this.selectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.selectedItem));e.classList.add("carousel__item--selected"),t&&t.classList.add("carousel__button--selected")}startAutoSlide(){clearInterval(this.autoSlide),this.autoSlide=setInterval((()=>{this.goToNext()}),this.display.sliderTime?1e3*this.display.sliderTime:3e3)}goToNext(){this.goTo(this.selectedItem,(this.selectedItem+1)%this.slides)}goToPrev(){this.goTo(this.selectedItem,this.selectedItem-1)}goTo(e,t){this.previouslySelectedItem=e,this.selectedItem=t,0===t&&(this.selectedItem=this.slides),this.updateSelectedItem()}}class Tt extends HTMLElement{constructor(){super(),this._target=null,this._session=null,this.shadow=null,this.popup=null,this.container=null,this.resizeObserver=null,this.shadow=this.attachShadow({mode:"open"})}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderImageOnlyPopup())}get session(){return this._session||""}set session(e){this._session=e}get msgId(){return this.target.wzrk_id}get pivotId(){return this.target.wzrk_pivot}get onClickUrl(){return this.target.display.onClickUrl}renderImageOnlyPopup(){const e=this.target.wzrk_id.split("_")[0],t=this.session.sessionId;this.shadow.innerHTML=this.getImageOnlyPopupContent(),this.popup=this.shadowRoot.getElementById("imageOnlyPopup"),this.container=this.shadowRoot.getElementById("container"),this.closeIcon=this.shadowRoot.getElementById("close"),this.popup.addEventListener("load",this.updateImageAndContainerWidth()),this.resizeObserver=new ResizeObserver((()=>this.handleResize(this.popup,this.container))),this.resizeObserver.observe(this.popup),this.closeIcon.addEventListener("click",(()=>{if(this.resizeObserver.unobserve(this.popup),document.getElementById("wzrkImageOnlyDiv").style.display="none",this.remove(),null!=e&&"-1"!==e&&ae._isLocalStorageSupported()){const i=Xe();let o=i.wp[t];null==o&&(o={},i[t]=o),o[e]="dnd",et(i)}})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId}),this.onClickUrl&&this.popup.addEventListener("click",(()=>{this.target.display.window?window.open(this.onClickUrl,"_blank"):window.parent.location.href=this.onClickUrl,window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})}))}handleResize(e,t){const i=this.getRenderedImageWidth(e);t.style.setProperty("width","".concat(i,"px"))}getImageOnlyPopupContent(){return"\n ".concat(this.target.msgContent.css,"\n ").concat(this.target.msgContent.html,"\n ")}updateImageAndContainerWidth(){return()=>{const e=this.getRenderedImageWidth(this.popup);this.popup.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("height","auto"),this.container.style.setProperty("position","fixed"),this.popup.style.setProperty("visibility","visible"),this.closeIcon.style.setProperty("visibility","visible"),document.getElementById("wzrkImageOnlyDiv").style.visibility="visible"}}getRenderedImageWidth(e){const t=e.naturalWidth/e.naturalHeight;return e.height*t}}class Rt extends HTMLElement{constructor(e,t){super(),this.wrapper=null,this.snackBar=null,this.shadow=this.attachShadow({mode:"open"}),this.config=e,this.message=t,this.renderMessage(t)}get pivotId(){return this.message.wzrk_pivot}get campaignId(){return this.message.wzrk_id}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}renderMessage(e){switch(this.wrapper=this.createEl("div","messageWrapper"),e.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":{const t=this.prepareBasicMessage(e.msg[0]);this.wrapper.appendChild(t)}}const t=this.createEl("div","timeStamp");if(t.innerHTML="".concat(Wt(e.id.split("_")[1]),""),!e.viewed){const e=this.createEl("span","unreadMarker");t.appendChild(e)}this.wrapper.appendChild(t),this.shadow.appendChild(this.wrapper)}prepareBasicMessage(e){const t=this.createEl("div","message");if(e.imageUrl){const i=this.addImage(e.imageUrl,"mainImg");t.appendChild(i)}const i=this.createEl("div","iconTitleDescWrapper");if(e.iconUrl){const t=this.addImage(e.iconUrl,"iconImg");i.appendChild(t)}const o=this.createEl("div","titleDescWrapper");if(e.title){const t=this.createEl("div","title");t.innerText=e.title,o.appendChild(t)}if(e.description){const t=this.createEl("div","description");t.innerText=e.description,o.appendChild(t)}if((e.title||e.description)&&i.appendChild(o),(e.iconUrl||e.title||e.description)&&t.appendChild(i),e.buttons&&e.buttons.length){const i=this.addButtons(e.buttons);t.appendChild(i)}return t}addButtons(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.createEl("div","buttonsContainer");let i=!1;return e.forEach(((e,o)=>{const n=this.createEl("button","button-".concat(o),"button");n.innerText=e.text,o>0&&(n.style.cssText+="margin-left: 2px;"),"copy"===e.action&&(i=!0),t.appendChild(n)})),i&&this.addSnackbar(t),t}addSnackbar(e){this.snackBar=this.createEl("div","snackbar-".concat(this.campaignId),"snackbar"),this.snackBar.innerHTML=Gt;const t=this.createEl("span","snackbar-msg-".concat(this.campaignId),"snackbar-msg");t.innerText="Copied to clipboard",this.snackBar.appendChild(t),e.appendChild(this.snackBar)}addImage(e,t){const i=this.createEl("div","".concat(t,"Container")),o=this.createEl("img",t);return o.setAttribute("src",e),o.setAttribute("loading","lazy"),i.appendChild(o),i}raiseClickedEvent(e,t){switch(this.message.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":this.raiseClickedForBasicTemplates(e,t)}}raiseClickedForBasicTemplates(e,t){const i=this.message.msg[0],o={msgId:this.campaignId,pivotId:this.pivotId};if("BUTTON"===e.tagName){const t=e.id.split("-")[1],n=i.buttons[t];o.kv={wzrk_c2a:n.text},"url"===n.action?n.openUrlInNewTab?window.open(n.url,"_blank"):window.location=n.url:"copy"===n.action&&(window.focus(),navigator.clipboard.writeText(n.clipboardText),this.snackBar.style.setProperty("display","flex","important"),setTimeout((()=>{this.snackBar.style.setProperty("display","none","important")}),2e3))}else"CT-INBOX-MESSAGE"===e.tagName&&i.onClickUrl&&(i.openUrlInNewTab?window.open(i.onClickUrl,"_blank"):window.location=i.onClickUrl);t?console.log("Notifiction clicked event will be raised at run time with payload ::",o):window.clevertap.renderNotificationClicked(o)}}class jt extends HTMLElement{constructor(e){super(),this.isInboxOpen=!1,this.isInboxFromFlutter=!1,this.selectedCategory=null,this.unviewedMessages={},this.unviewedCounter=0,this.isPreview=!1,this.inboxConfigForPreview={},this.inboxSelector=null,this.inbox=null,this.emptyInboxMsg=null,this.inboxCard=null,this.unviewedBadge=null,this.observer=null,this.selectedCategoryRef=null,this.addClickListenerOnDocument=(()=>e=>{if(e.composedPath().includes(this.inbox)){const t=e.path||e.composedPath&&e.composedPath();if(t.length){const e=t[0].id;if("closeInbox"===e)this.toggleInbox();else if(e.startsWith("category-"))this.prevCategoryRef=this.selectedCategoryRef,this.selectedCategoryRef=t[0],this.updateActiveCategory(t[0].innerText);else{const e=t.filter((e=>{var t;return(null===(t=e.id)||void 0===t?void 0:t.startsWith("button-"))||"CT-INBOX-MESSAGE"===e.tagName}));if(e.length){e[e.length-1].raiseClickedEvent(e[0],this.isPreview)}}}}else(this.inboxSelector.contains(e.target)||this.isInboxOpen)&&(this.isInboxFromFlutter?this.isInboxFromFlutter=!1:this.toggleInbox(e))})(),this.setBadgeStyle=e=>{null!==this.unviewedBadge&&(this.unviewedBadge.innerText=e>9?"9+":e,this.unviewedBadge.style.display=e>0?"flex":"none")},this.logger=e,this.shadow=this.attachShadow({mode:"open"})}get incomingMessages(){return[]}set incomingMessages(e){void 0===e&&(e=[]),e.length>0&&this.inbox&&this.updateInboxMessages(e)}get incomingMessagesForPreview(){return[]}set incomingMessagesForPreview(e){void 0===e&&(e=[]);const t={};e.length>0&&this.inbox&&(this.isPreview=!0,this.unviewedCounter=0,e.forEach((e=>{const i="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=i,t[i]=e,this.unviewedMessages[i]=e,this.unviewedCounter++})),this.buildUIForMessages(t),this.updateUnviewedBadgeCounter())}connectedCallback(){this.init()}init(){this.config=this.isPreview?this.inboxConfigForPreview:ae.readFromLSorCookie(q)||{},0!==Object.keys(this.config).length&&(this.inboxSelector=document.getElementById(this.config.inboxSelector),null!==this.inboxSelector&&(this.config.styles.notificationsBadge?this.addUnviewedBadge():this.unviewedBadge&&this.unviewedBadge.remove(),this.createinbox(),document.removeEventListener("click",this.addClickListenerOnDocument),document.addEventListener("click",this.addClickListenerOnDocument),this.config.categories.length&&this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadow.innerHTML=this.getInboxStyles(),this.shadow.appendChild(this.inbox)))}addMsgsToInboxFromLS(){const e=this.deleteExpiredAndGetUnexpiredMsgs(!1),t=e?Object.keys(e):[];0!==t.length&&(t.forEach((t=>{e[t].viewed||(this.unviewedMessages[t]=e[t],this.unviewedCounter++)})),this.buildUIForMessages(e),this.updateUnviewedBadgeCounter())}deleteExpiredAndGetUnexpiredMsgs(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Nt();const i=Math.floor(Date.now()/1e3);for(const o in t)if(t[o].wzrk_ttl&&t[o].wzrk_ttl>0&&t[o].wzrk_ttl0&&(t=Object.values(t).sort(((e,t)=>t.date-e.date)).reduce(((e,t)=>(e[t.id]=t,e)),{})),Ft(t),t}updateInboxMessages(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.deleteExpiredAndGetUnexpiredMsgs(),i=Date.now(),o={};e.forEach(((e,n)=>{const s="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=s,e.date=i-n,e.viewed=0,t[s]=e,o[s]=e,this.unviewedMessages[s]=e,this.unviewedCounter++})),Ft(t),this.buildUIForMessages(o),this.updateUnviewedBadgeCounter()}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}addUnviewedBadge(){this.unviewedBadge||(this.unviewedBadge=this.createEl("div","unviewedBadge"),this.unviewedBadge.style.cssText="display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ".concat(this.config.styles.notificationsBadge.backgroundColor,"; font-size: 12px; color: ").concat(this.config.styles.notificationsBadge.textColor,"; font-weight: bold; align-items: center; justify-content: center;"),document.body.appendChild(this.unviewedBadge)),this.updateUnviewedBadgePosition(),window.addEventListener("resize",(()=>{this.updateUnviewedBadgePosition()}))}updateUnviewedBadgePosition(){const{top:e,right:t}=this.inboxSelector.getBoundingClientRect();this.unviewedBadge.style.top="".concat(e-8,"px"),this.unviewedBadge.style.left="".concat(t-8,"px")}createinbox(){this.inbox=this.createEl("div","inbox");const e=this.createEl("div","header"),t=this.createEl("div","headerTitle");t.innerText=this.config.title;const i=this.createEl("div","closeInbox");if(i.innerHTML="×",e.appendChild(t),e.appendChild(i),this.inbox.appendChild(e),this.config.categories.length){const e=this.createCategories();this.inbox.appendChild(e)}this.inboxCard=this.createEl("div","inboxCard"),this.inbox.appendChild(this.inboxCard),this.emptyInboxMsg=this.createEl("div","emptyInboxMsg"),this.emptyInboxMsg.innerText="All messages will be displayed here.",this.inboxCard.appendChild(this.emptyInboxMsg);const o={root:this.inboxCard,rootMargin:"0px",threshold:.5};this.observer=new IntersectionObserver(((e,t)=>{this.handleMessageViewed(e)}),o),this.addMsgsToInboxFromLS()}createCategories(){const e=this.createEl("div","categoriesContainer"),t=this.createEl("div","leftArrow");t.innerHTML=Ht,t.children[0].style="transform: rotate(180deg)",t.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(-70,0)})),e.appendChild(t);const i=this.createEl("div","categoriesWrapper");["All",...this.config.categories].forEach(((e,t)=>{const o=this.createEl("div","category-".concat(t),"category");o.innerText=e,0===t&&(this.selectedCategoryRef=o),i.appendChild(o)})),e.appendChild(i);const o=this.createEl("div","rightArrow");o.innerHTML=Ht,o.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(70,0)})),e.appendChild(o);const n={root:e,threshold:.9},s=i.children[0],r=i.children[this.config.categories.length];new IntersectionObserver((e=>{this.categoryObserverCb(t,e[0].intersectionRatio>=.9)}),n).observe(s);return new IntersectionObserver((e=>{this.categoryObserverCb(o,e[0].intersectionRatio>=.9)}),n).observe(r),e}categoryObserverCb(e,t){e&&(e.style.display=t?"none":"flex")}updateActiveCategory(e){this.selectedCategory=e,this.inboxCard.scrollTop=0;let t=0;this.prevCategoryRef&&this.prevCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef.setAttribute("selected","true"),this.inboxCard.childNodes.forEach((e=>{"emptyInboxMsg"!==e.getAttribute("id")&&(e.style.display="All"===this.selectedCategory||e.getAttribute("category")===this.selectedCategory?"block":"none","block"===e.style.display&&t++)})),0===t?(this.emptyInboxMsg.innerText="".concat(e," messages will be displayed here."),this.emptyInboxMsg.style.display="block"):this.emptyInboxMsg.style.display="none"}buildUIForMessages(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!this.isPreview&&this.updateTSForRenderedMsgs(),this.inboxCard.scrollTop=0;const i=null!==(e=this.config.maxMsgsInInbox)&&void 0!==e?e:15,o=this.inboxCard.firstChild,n=Object.values(t).sort(((e,t)=>t.date-e.date)).map((e=>e.id));for(const e of n){const i=new Rt(this.config,t[e]);i.setAttribute("id",t[e].id),i.setAttribute("pivot",t[e].wzrk_pivot),i.setAttribute("part","ct-inbox-message"),this.config.categories.length>0?(i.setAttribute("category",t[e].tags[0]||""),i.style.display="All"===this.selectedCategory||t[e].category===this.selectedCategory?"block":"none"):i.style.display="block",this.inboxCard.insertBefore(i,o),this.observer.observe(i)}let s=this.inboxCard.querySelectorAll("ct-inbox-message").length;for(;s>i;){const e=this.inboxCard.querySelectorAll("ct-inbox-message");e.length>0&&e[e.length-1].remove(),s--}const r=this.inboxCard.querySelectorAll('ct-inbox-message[style*="display: block"]').length;this.emptyInboxMsg.style.display=r?"none":"block"}handleMessageViewed(e){const t=!this.isPreview;this.isInboxOpen&&e.forEach((e=>{e.isIntersecting&&this.unviewedMessages.hasOwnProperty(e.target.id)&&0===e.target.message.viewed&&(e.target.message.viewed=1,t?(window.clevertap.renderNotificationViewed({msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.updateMessageInLS(e.target.id,{...e.target.message,viewed:1}),setTimeout((()=>{e.target.shadowRoot.getElementById("unreadMarker").style.display="none"}),1e3)):console.log("Notifiction viewed event will be raised at run time with payload ::",{msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.unviewedCounter--,this.updateUnviewedBadgeCounter(),delete this.unviewedMessages[e.target.id])}))}updateMessageInLS(e,t){if(!this.isPreview){const i=Nt();i[e]=t,Ft(i)}}toggleInbox(e){this.isInboxOpen=!this.isInboxOpen,this.isInboxFromFlutter=!!(null==e?void 0:e.rect),this.isInboxOpen?(this.inboxCard.scrollTop=0,!this.isPreview&&this.deleteExpiredAndGetUnexpiredMsgs(),this.inbox.style.display="block",this.inbox.style.zIndex="2147483647",this.config.categories.length&&(this.selectedCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef=this.shadowRoot.getElementById("category-0"),this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadowRoot.getElementById("categoriesWrapper").scrollLeft-=this.shadowRoot.getElementById("categoriesWrapper").scrollWidth),this.setInboxPosition(e)):this.inbox.style.display="none"}setInboxPosition(e){const t=window.outerWidth,i=getComputedStyle(le.inbox),o=i.getPropertyValue("--inbox-top"),n=i.getPropertyValue("--inbox-bottom"),s=i.getPropertyValue("--inbox-left"),r=i.getPropertyValue("--inbox-right");if(t>481&&!(o||n||s||r)){const t=Vt(e,this.inbox.clientHeight,this.inbox.clientWidth),i=t.xPos,o=t.yPos;this.inbox.style.top=o+"px",this.inbox.style.left=i+"px"}}updateUnviewedBadgeCounter(){if(this.isPreview)return void this.setBadgeStyle(this.unviewedCounter);let e=0;this.inboxCard.querySelectorAll("ct-inbox-message").forEach((t=>{const i=Nt();i[t.id]&&0===i[t.id].viewed&&e++})),this.setBadgeStyle(e)}updateTSForRenderedMsgs(){this.inboxCard.querySelectorAll("ct-inbox-message").forEach((e=>{const t=e.id.split("_")[1];e.shadow.getElementById("timeStamp").firstChild.innerText=Wt(t)}))}getInboxStyles(){const e=this.config.categories.length?64:16,t={panelBackgroundColor:this.config.styles.panelBackgroundColor,panelBorderColor:this.config.styles.panelBorderColor,headerBackgroundColor:this.config.styles.header.backgroundColor,headerTitleColor:this.config.styles.header.titleColor,closeIconColor:this.config.styles.closeIconColor,categoriesTabColor:this.config.styles.categories.tabColor,categoriesTitleColor:this.config.styles.categories.titleColor,selectedCategoryTabColor:this.config.styles.categories.selectedTab.tabColor,selectedCategoryTitleColor:this.config.styles.categories.selectedTab.titleColor,headerCategoryHeight:36+e};this.config.styles.categories.borderColor&&(t.categoriesBorderColor=this.config.styles.categories.borderColor),this.config.styles.categories.selectedTab.borderColor&&(t.selectedCategoryBorderColor=this.config.styles.categories.selectedTab.borderColor);const i=(e=>{let{panelBackgroundColor:t,panelBorderColor:i,headerBackgroundColor:o,headerTitleColor:n,closeIconColor:s,categoriesTabColor:r,categoriesTitleColor:a,categoriesBorderColor:l,selectedCategoryTabColor:c,selectedCategoryTitleColor:d,selectedCategoryBorderColor:h,headerCategoryHeight:u}=e;return'\n \n ")})(t),o=this.config.styles.cards;return i+(e=>{let{backgroundColor:t,borderColor:i,titleColor:o,descriptionColor:n,buttonColor:s,buttonTextColor:r,unreadMarkerColor:a}=e;return'\n \n ")})({backgroundColor:o.backgroundColor,borderColor:o.borderColor,titleColor:o.titleColor,descriptionColor:o.descriptionColor,buttonColor:o.buttonColor,buttonTextColor:o.buttonTextColor,unreadMarkerColor:o.unreadMarkerColor})}}const Dt=e=>{e.inbox_preview?le.inbox.incomingMessagesForPreview=e.inbox_notifs:le.inbox.incomingMessages=e},zt=e=>{qt(),le.inbox=new jt({logger:e}),document.body.appendChild(le.inbox)},Bt=e=>{const t=ae.readFromLSorCookie(V)||{};if(Object.keys(t).length>0&&Object.keys(t)[0].includes("_")){const i={};return i[e]=t,ae.saveToLSorCookie(V,i),i}return t},Nt=()=>{const e=JSON.parse(decodeURIComponent(ae.read(b)));if(!X(e))return{};const t=Bt(e);return t.hasOwnProperty(e)?t[e]:{}},Ft=e=>{const t=JSON.parse(decodeURIComponent(ae.read(b)));if(!X(t))return;const i={...Bt(t),[t]:e};ae.saveToLSorCookie(V,i)},Ut=e=>new Promise(((t,i)=>{if("complete"===document.readyState)zt(e),t();else{const i=ae.readFromLSorCookie(q)||{},o=()=>{null===le.inbox&&zt(e),t()};window.addEventListener("load",(()=>{if(document.getElementById(i.inboxSelector))o();else{let n=0;if(n<20){const s=setInterval((()=>{document.getElementById(i.inboxSelector)?(o(),clearInterval(s),t()):n>=20&&(clearInterval(s),e.debug("Failed to add inbox")),n++}),500)}}}))}})),qt=()=>{void 0===customElements.get("ct-web-inbox")&&(customElements.define("ct-web-inbox",jt),customElements.define("ct-inbox-message",Rt))},Vt=(e,t,i)=>{const o=document.scrollingElement.scrollLeft,n=document.scrollingElement.scrollTop,s=window.innerWidth+o,r=window.innerHeight+n,a=e.rect||e.target.getBoundingClientRect(),l=a.x+o,c=a.y+n,d=a.left+o,h=a.right+o,u=a.top+n,p=a.bottom,g=a.height,f=a.width;let v,b,m=!1;const y=16;if(p+t<=r){const e=r-(p+t);b=e>=y?p+y:p+e}else if(u-t>=n){const e=u-t;b=e>=y?u-t-y:u-t-e}else m=!0,b=c+g/2-t/2,br&&(b=r-t);if(m){const e=h+i;if(e<=s){v=h+(e+y<=s?y:s-e)}else{const e=d-i;v=e-(e-y>=o?y:e-o)}}else v=l+f/2-i/2,vs&&(v=h-i>=o?h-i:s-i);return{xPos:v,yPos:b}},Wt=e=>{const t=Date.now();let i=Math.floor((t-e)/6e4);return i<5?"Just now":i<60?"".concat(i," minute").concat(i>1?"s":""," ago"):(i=Math.floor(i/60),i<24?"".concat(i," hour").concat(i>1?"s":""," ago"):(i=Math.floor(i/24),"".concat(i," day").concat(i>1?"s":""," ago")))},Kt=()=>Object.keys(ae.readFromLSorCookie(q)||{}).length>0,Ht='\n\n\n',Gt='\n\n\n';let Jt;function Zt(){document.body.innerHTML="",Jt=document.createElement("div"),Jt.id="app2",Jt.style.position="relative",Jt.style.display="flex",document.body.appendChild(Jt);var e,t,i,o,n,s,r,a,l;(function(e){return new Promise(((t,i)=>{var o=document.createElement("script");o.type="module",o.src=e,o.onload=function(){"function"==typeof window.Overlay?(window.Overlay("#app2","http://localhost:8080/randomPage"),t()):i(new Error("ContentLayout not found in overlay.js"))},o.onerror=function(e){i(e)},document.head.appendChild(o)}))})("https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js").then((()=>{console.log("Overlay script loaded successfully.")})).catch((e=>{console.error("Error loading overlay script:",e)})),(e=document.createElement("link")).rel="stylesheet",e.type="text/css",e.href="https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css",document.head.appendChild(e),i={kitId:"eqj6nom",scriptTimeout:3e3,async:!0},o=document,n=o.documentElement,s=setTimeout((function(){n.className=n.className.replace(/\bwf-loading\b/g,"")+" wf-inactive"}),i.scriptTimeout),r=o.createElement("script"),a=!1,l=o.getElementsByTagName("script")[0],n.className+=" wf-loading",r.src="https://use.typekit.net/"+i.kitId+".js",r.async=!0,r.onload=r.onreadystatechange=function(){if(t=this.readyState,!(a||t&&"complete"!==t&&"loaded"!==t)){a=!0,clearTimeout(s);try{Typekit.load(i)}catch(e){}}},l.parentNode.insertBefore(r,l)}const $t=(e,t)=>{const i=e.display.details[0],o=Object.keys(i)[0],n=i[o];if(o===window.location.href)for(const i in n){const o=document.querySelector(i);if(o)o.outerHTML=n[i].html,t||window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot});else{let o=0;const s=setInterval((()=>{const r=document.querySelector(i);r?(r.outerHTML=n[i].html,t||window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot}),clearInterval(s)):(o++,o>=20&&(console.log("No element present on DOM with selector '".concat(i,"'.")),clearInterval(s)))}),500)}}},Yt=(e,t)=>{let{device:i,session:o,request:n,logger:s}=t;const r=i,a=o,l=n,c=s;let d=0;e={arp:{j_n:"Zw==",i_n:"Y2NmewICAw==",d_ts:0,dh:0,v:1,j_s:"{ }",id:"WWW-WWW-WWRZ",e_ts:0,r_ts:1649748826,rc_w:60,rc_n:5},inapp_notifs:[{msgContent:{templateType:"point-and-click",type:4},display:{divId:"hero-banner",details:[{"http://localhost:3000/":{".heroDi1v":{html:'Hello Sonam'},"#selector_2":{html:'

Hello Sonam

'}}}],wtarget_type:2,wmc:1,ff:"Desktop"},wzrk_id:"1655316906_20220620",wzrk_pivot:"wzrk_default"}]};const h=t=>{const i=t.wzrk_id.split("_")[0],o=ie(),n=(e,t,i)=>{let o=0,n=0;null!=e[t]&&(o=e[t]),o++,null!=e.tc&&(n=e.tc),i<0&&n++,e.tc=n,e[t]=o};if(ae._isLocalStorageSupported()){delete sessionStorage.WZRK_CAMP;var s={};const e=Xe();s=3===t.display.wtarget_type&&e.hasOwnProperty("wi")?e.wi:0!==t.display.wtarget_type&&1!==t.display.wtarget_type||!e.hasOwnProperty("wp")?{}:e.wp,e.hasOwnProperty("global")&&(s.wp=e),null==t.display.wmc&&(t.display.wmc=1),null==t.display.wimc&&(t.display.wimc=1);var d=-1;let n=-1,r=-1,l=-1,c=-1,g=-1,f=-1;null!=t.display.efc&&(d=parseInt(t.display.efc,10)),null!=t.display.mdc&&(n=parseInt(t.display.mdc,10)),null!=t.display.tdc&&(r=parseInt(t.display.tdc,10)),null!=t.display.tlc&&(l=parseInt(t.display.tlc,10)),null!=t.display.wmp&&(c=parseInt(t.display.wmp,10)),null!=t.display.wmc&&(g=parseInt(t.display.wmc,10)),null!=t.display.wimc&&(f=parseInt(t.display.wimc,10));var h=s[a.sessionId];if(h){const e=h[i],o=h.tc;if("dnd"===e&&!le.dismissSpamControl)return!1;if(3===t.display.wtarget_type){if(f>0&&o>=f&&d<0)return!1}else if(g>0&&o>=g&&d<0)return!1;if(n>0&&e>=n)return!1}else h={},s[a.sessionId]=h;var u=s[o];if(null!=u){const e=u[i],t=u.tc;if(c>0&&t>=c&&d<0)return!1;if(r>0&&e>=r)return!1}else u={},s[o]=u;var p=s.global;if(null!=p){const e=p[i];if(l>0&&e>=l)return!1}else p={},s.global=p}if(null!=t.display.delay&&t.display.delay>0){const i=t.display.delay;return t.display.delay=0,setTimeout(Yt,1e3*i,e,{device:r,session:a,request:l,logger:c}),!1}n(h,i,d),n(u,i,d),n(p,i,d);let g="wp";3===t.display.wtarget_type&&(g="wi");const f={};f[a.sessionId]=h,f[o]=u,f.global=p,et({[g]:f})},u=()=>{const e=r.getGuid(),t=a.getSessionCookieObject();return"&t=wc&d="+encodeURIComponent(Ge(e+"|"+t.p+"|"+t.s))},p=(e,t)=>{const i=window.parent[e];"function"==typeof i&&(null!=t.display.kv?i(t.display.kv):i())},g=(e,t,i,o,n)=>{f(t),((e,t,i,o,n)=>{if(""!==e&&null!=e){let o,s;n?o=i:null!==i&&(s=i.getElementsByClassName("jsCT_CTA"),null!=s&&1===s.length&&(o=s[0]));const r=t.display.jsFunc,l=t.display.preview;null==l&&(e+=u()),null!=o&&(o.onclick=()=>{if(null!=r)return null==l&&Qe.fireRequest(e),p(r,t),void at("-1",0,a.sessionId);1===t.display.window?window.open(e,"_blank"):window.location=e})}})(e,t,i,0,n)},f=e=>{const t={type:"event"};t.evtName=R,t.evtData={[T]:e.wzrk_id},e.wzrk_pivot&&(t.evtData={...t.evtData,wzrk_pivot:e.wzrk_pivot}),l.processEvent(t)},v=e=>{var t;void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Lt);const i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,o=document.createElement("ct-web-personalisation-banner");o.msgId=e.wzrk_id,o.pivotId=e.wzrk_pivot,o.divHeight=e.display.divHeight,o.details=e.display.details[0];const n=e.display.divId?document.getElementById(i):document.querySelector(i);n.innerHTML="",n.appendChild(o)},m=e=>{var t;void 0===customElements.get("ct-web-personalisation-carousel")&&customElements.define("ct-web-personalisation-carousel",Mt);const i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,o=document.createElement("ct-web-personalisation-carousel");o.target=e;const n=e.display.divId?document.getElementById(i):document.querySelector(i);n.innerHTML="",n.appendChild(o)},y=e=>{const t=e.wzrk_id.split("_")[0],i=e.display;if(2===i.wtarget_type&&1===e.msgContent.type){const t={};t.msgId=e.wzrk_id,e.wzrk_pivot&&(t.pivotId=e.wzrk_pivot),null!=e.msgContent.kv&&(t.kv=e.msgContent.kv);const i=new CustomEvent("CT_web_native_display",{detail:t});return void document.dispatchEvent(i)}if(1===i.layout)return _(void 0,e);if(3===i.layout){const t="wzrkImageOnlyDiv";if(!1===h(e))return;if(le.dismissSpamControl&&null!=document.getElementById(t)){document.getElementById(t).remove()}if(null!=document.getElementById(t)||null!=document.getElementById("intentPreview"))return;const i=document.createElement("div");return i.id=t,document.body.appendChild(i),void 0===customElements.get("ct-web-popup-imageonly")&&customElements.define("ct-web-popup-imageonly",Tt),(e=>{const t=document.createElement("ct-web-popup-imageonly");t.session=a,t.target=e;const i=document.getElementById("wzrkImageOnlyDiv");i.innerHTML="",i.style.visibility="hidden",i.appendChild(t)})(e)}if(!1===h(e))return;const o="wizParDiv"+i.layout;if(le.dismissSpamControl&&null!=document.getElementById(o)){document.getElementById(o).remove()}if(null!=document.getElementById(o))return;le.campaignDivMap[t]=o;const n=2===i.layout,s=document.createElement("div");s.id=o;const r=window.innerHeight,l=window.innerWidth;let c=!1;if(n)s.setAttribute("style",i.iFrameStyle);else{var d=10;let e=5*l/100,t=d+5*r/100,o=30*l/100+20,n="width:30%;";(/mobile/i.test(navigator.userAgent)||/mini/i.test(navigator.userAgent))&&!1===/iPad/i.test(navigator.userAgent)?(o=85*l/100+20,e=5*l/100,t=5*r/100,n="width:80%;"):("ontouchstart"in window||/tablet/i.test(navigator.userAgent))&&(o=50*l/100+20,e=5*l/100,t=5*r/100,n="width:50%;"),null==i.proto?(c=!0,s.setAttribute("style","display:block;overflow:hidden; bottom:"+t+"px !important;width:"+o+"px !important;right:"+e+"px !important;position:fixed;z-index:2147483647;")):s.setAttribute("style",n+i.iFrameStyle)}document.body.appendChild(s);const u=document.createElement("iframe"),p=!1===i.br?"0":"8";u.frameborder="0px",u.marginheight="0px",u.marginwidth="0px",u.scrolling="no",u.id="wiz-iframe";const f=e.display.onClick;let v,b="";if(""!==f&&null!=f&&(b="cursor:pointer;"),1===e.msgContent.type)v=e.msgContent.html,v=v.replace(/##campaignId##/g,t),v=v.replace(/##campaignId_batchId##/g,e.wzrk_id);else{const i='";let n,s,r,a,l;"dark"===e.display.theme?(n="#2d2d2e",s="#eaeaea",r="#353535",a="#353535",l="#ffffff"):(n="#ffffff",s="#000000",a="#f4f4f4",r="#a5a6a6",l="#ffffff");const c=e.msgContent.title,d=e.msgContent.description;let h="";null!=e.msgContent.imageUrl&&""!==e.msgContent.imageUrl&&(h="");v=i+("
×
"+h+"
"+c+"
")+("
"+d+"
")}u.setAttribute("style","z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;"),s.appendChild(u);const m=(u.contentWindow?u.contentWindow:u.contentDocument.document?u.contentDocument.document:u.contentDocument).document,y=new Event("CT_campaign_rendered");document.dispatchEvent(y),m.open(),m.write(v),i["custom-editor"]&&k(e,m),m.close();const w=()=>{d=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv").scrollHeight,!0===i["custom-editor"]||n||(d+=25),document.getElementById("wiz-iframe").contentDocument.body.style.margin="0px",document.getElementById("wiz-iframe").style.height=d+"px"},C=navigator.userAgent.toLowerCase();if(-1!==C.indexOf("safari"))if(C.indexOf("chrome")>-1)u.onload=()=>{w();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)};else{let t=u.contentDocument||u.contentWindow;t.document&&(t=t.document),w();const i=setInterval((()=>{if("complete"===t.readyState){clearInterval(i),w();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)}}),10)}else u.onload=()=>{w();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)}},k=(e,t)=>{const i=t.createElement("script");i.innerHTML="\n const ct__camapignId = '".concat(e.wzrk_id,"';\n const ct__formatVal = (v) => {\n return v && v.trim().substring(0, 20);\n }\n const ct__parentOrigin = window.parent.origin;\n document.body.addEventListener('click', (event) => {\n const elem = event.target.closest?.('a[wzrk_c2a], button[wzrk_c2a]');\n if (elem) {\n const {innerText, id, name, value, href} = elem;\n const clickAttr = elem.getAttribute('onclick') || elem.getAttribute('click');\n const onclickURL = clickAttr?.match(/(window.open)[(](\"|')(.*)(\"|',)/)?.[3] || clickAttr?.match(/(location.href *= *)(\"|')(.*)(\"|')/)?.[3];\n const props = {innerText, id, name, value};\n let msgCTkv = Object.keys(props).reduce((acc, c) => {\n const formattedVal = ct__formatVal(props[c]);\n formattedVal && (acc['wzrk_click_' + c] = formattedVal);\n return acc;\n }, {});\n if(onclickURL) { msgCTkv['wzrk_click_' + 'url'] = onclickURL; }\n if(href) { msgCTkv['wzrk_click_' + 'c2a'] = href; }\n const notifData = { msgId: ct__camapignId, msgCTkv, pivotId: '").concat(e.wzrk_pivot,"' };\n window.parent.clevertap.renderNotificationClicked(notifData);\n }\n });\n "),t.body.appendChild(i)};let x=!1;const S=e=>{let t=e.display.onClick;if(window.clevertap.hasOwnProperty("notificationCallback")&&void 0!==window.clevertap.notificationCallback&&"function"==typeof window.clevertap.notificationCallback){const i=window.clevertap.notificationCallback;if(!x){const o={};o.msgContent=e.msgContent,o.msgId=e.wzrk_id,e.wzrk_pivot&&(o.pivotId=e.wzrk_pivot),null!=e.display.kv&&(o.kv=e.display.kv),window.clevertap.raiseNotificationClicked=()=>{if(""!==t&&null!=t){const i=e.display.jsFunc;if(t+=u(),null!=i)return Qe.fireRequest(t),void p(i,e);1===e.display.window?window.open(t,"_blank"):window.location=t}},window.clevertap.raiseNotificationViewed=()=>{f(e)},i(o),x=!0}}else if(window.clevertap.popupCurrentWzrkId=e.wzrk_id,y(e),window.clevertap.hasOwnProperty("popupCallbacks")&&void 0!==window.clevertap.popupCallbacks&&"function"==typeof window.clevertap.popupCallbacks[e.wzrk_id]){const t=window.clevertap.popupCallbacks[e.wzrk_id],n={};n.msgContent=e.msgContent,n.msgId=e.wzrk_id,e.wzrk_pivot&&(n.pivotId=e.wzrk_pivot);var i=[];for(var o in e)if(o.startsWith(M)&&o!==T){const t={[o]:e[o]};i.push(t)}i.length>0&&(n.msgCTkv=i),null!=e.display.kv&&(n.kv=e.display.kv),window.clevertap.raisePopupNotificationClicked=t=>{if(!t||!t.msgId)return;const i={type:"event"};if(i.evtName=j,i.evtData={[T]:t.msgId},e.wzrk_pivot&&(i.evtData={...i.evtData,wzrk_pivot:t.pivotId}),t.msgCTkv)for(var o of t.msgCTkv)i.evtData={...i.evtData,...o};l.processEvent(i)},t(n)}};let I;const _=(e,t)=>{let i;if(null!=e&&e.clientY>0)return;if(i=null==t?I:t,le.dismissSpamControl&&0===i.display.wtarget_type&&null!=document.getElementById("intentPreview")&&null!=document.getElementById("intentOpacityDiv")){document.getElementById("intentPreview").remove(),document.getElementById("intentOpacityDiv").remove()}if(null!=document.getElementById("intentPreview")||null!=document.getElementById("wzrkImageOnlyDiv"))return;if(null==i.display.layout&&(/mobile/i.test(navigator.userAgent)||/mini/i.test(navigator.userAgent)||/iPad/i.test(navigator.userAgent)||"ontouchstart"in window||/tablet/i.test(navigator.userAgent)))return;if(!1===h(i))return;const o=i.wzrk_id.split("_")[0];le.campaignDivMap[o]="intentPreview";let n=!1;const s=document.createElement("div");s.id="intentOpacityDiv";const r=i.display.opacity||.7,a="rgba(0,0,0,".concat(r,")");s.setAttribute("style","position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ".concat(a,";")),document.body.appendChild(s);const l=document.createElement("div");l.id="intentPreview",null==i.display.proto?(n=!0,l.setAttribute("style","display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;")):l.setAttribute("style",i.display.iFrameStyle),document.body.appendChild(l);const c=document.createElement("iframe"),d=!1===i.display.br?"0":"8";c.frameborder="0px",c.marginheight="0px",c.marginwidth="0px",c.scrolling="no",c.id="wiz-iframe-intent";const u=i.display.onClick;let p,f="";if(""!==u&&null!=u&&(f="cursor:pointer;"),1===i.msgContent.type)p=i.msgContent.html,p=p.replace(/##campaignId##/g,o),p=p.replace(/##campaignId_batchId##/g,i.wzrk_id);else{const e='";let t,n,s,r;"dark"===i.display.theme?(t="#2d2d2e",n="#eaeaea",s="#353535",r="#ffffff"):(t="#ffffff",n="#000000",s="#a5a6a6",r="#ffffff");const a=i.msgContent.title,l=i.msgContent.description;let c="";null!=i.msgContent.ctaText&&""!==i.msgContent.ctaText&&(c="");let h="";null!=i.msgContent.imageUrl&&""!==i.msgContent.imageUrl&&(h="
+a+
");p=e+("
×
"+a+"
")+("
"+l+"
"+h+c+"
")}c.setAttribute("style","z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;"),l.appendChild(c);const v=(c.contentWindow?c.contentWindow:c.contentDocument.document?c.contentDocument.document:c.contentDocument).document,b=new Event("CT_campaign_rendered");document.dispatchEvent(b),v.open(),v.write(p),i.display["custom-editor"]&&k(i,v),v.close();const m=document.getElementById("wiz-iframe-intent").contentDocument.getElementById("contentDiv");g(u,i,m,0,n)};if(!document.body)return void(d<6&&(d++,setTimeout(Yt,1e3,e,{device:r,session:a,request:l,logger:c})));const O=e=>{Object.keys(e).map((t=>{var i,o;e[t].display.divId?(i=e[t].display.divId,o=document.getElementById(i)):(i=e[t].display.divSelector,o=document.querySelector(i)),null!==o&&(2===e[t].msgContent.type?v(e[t]):m(e[t]),delete e[t])}))};if(null!=e.inapp_notifs){const t={};for(let i=0;i{window.addEventListener("load",(()=>{let t=0;if(t<20){const i=setInterval((()=>{O(e),0!==Object.keys(e).length&&20!==t||(clearInterval(i),e={}),t++}),500)}}))})(t))}const E=()=>{if(e.inbox_preview)Dt(e);else if(e.inbox_notifs){const t=[];for(let i=0;i1&&void 0!==arguments[1]&&arguments[1];const i=ae.readFromLSorCookie(q)||{};t?(le.inbox.inboxConfigForPreview=e,le.inbox.isPreview=!0,le.inbox&&le.inbox.init()):JSON.stringify(i)!==JSON.stringify(e)&&(ae.saveToLSorCookie(q,e),le.inbox&&le.inbox.init())}(e.webInboxSetting),Ut(c).then((()=>{E()})).catch((e=>{}))):E()),e.vars)return void le.variableStore.mergeVariables(e.vars);const A=(e,t)=>{const i=Xe(),o=i[t].global;if(null!=o&&t)for(const i in e)if(e.hasOwnProperty(i)&&(delete o[e[i]],ae.read(w))){const o=JSON.parse(decodeURIComponent(ae.read(w))),n=JSON.parse(decodeURIComponent(ae.read(b)));o[n]&&o[n][t]&&o[n][t][e[i]]&&(delete o[n][t][e[i]],ae.save(w,encodeURIComponent(JSON.stringify(o))))}et(i)};if(ae._isLocalStorageSupported())try{if(null!=e.evpr){const t=e.evpr.events,i=e.evpr.profile,o=e.evpr.expires_in,n=oe();ae.setMetaProp("lsTime",n),ae.setMetaProp("exTs",o),(e=>{if(null!=le.globalEventsMap||(le.globalEventsMap=ae.readFromLSorCookie(C),null!=le.globalEventsMap)){for(const t in e)if(e.hasOwnProperty(t)){const i=le.globalEventsMap[t],o=e[t];null!=le.globalEventsMap[t]?null!=o[0]&&o[0]>i[0]&&(le.globalEventsMap[t]=o):le.globalEventsMap[t]=o}}else le.globalEventsMap=e})(t),ae.saveToLSorCookie(C,le.globalEventsMap),null==le.globalProfileMap?rt(i,!0):rt(i,!1)}null!=e.arp&&(e=>{if(null!=e.skipResARP&&e.skipResARP)return console.debug("Update ARP Request rejected",e),null;const t=!0===e.isOUL;if(ae._isLocalStorageSupported())try{let i=ae.readFromLSorCookie(P);if(null==i||t){i={};for(const t in e)e.hasOwnProperty(t)&&(-1===e[t]?delete i[t]:i[t]=e[t]);ae.saveToLSorCookie(P,i)}}catch(e){console.error("Unable to parse ARP JSON: "+e)}})(e.arp),null!=e.inapp_stale&&e.inapp_stale.length>0&&A(e.inapp_stale,"wp"),null!=e.inbox_stale&&e.inbox_stale.length>0&&A(e.inbox_stale,"wi")}catch(e){c.error("Unable to persist evrp/arp: "+e)}};var Qt=t("isPersonalisationActive");class Xt{constructor(e){let{isPersonalisationActive:t}=e;Object.defineProperty(this,Qt,{writable:!0,value:void 0}),i(this,Qt)[Qt]=t}getTotalVisits(){if(!i(this,Qt)[Qt]())return;let e=ae.getMetaProp("sc");return null==e&&(e=1),e}getLastVisit(){if(!i(this,Qt)[Qt]())return;const e=ae.getMetaProp("ps");return null!=e?new Date(1e3*e):void 0}}const ei=1,ti=2,ii=3,oi=4;var ni=t("logLevel"),si=t("log"),ri=t("isLegacyDebug");class ai{constructor(e){Object.defineProperty(this,ri,{get:ci,set:void 0}),Object.defineProperty(this,si,{value:li}),Object.defineProperty(this,ni,{writable:!0,value:void 0}),this.wzrkError={},i(this,ni)[ni]=null==e?e:ti,this.wzrkError={}}get logLevel(){return i(this,ni)[ni]}set logLevel(e){i(this,ni)[ni]=e}error(e){i(this,ni)[ni]>=ei&&i(this,si)[si]("error",e)}info(e){i(this,ni)[ni]>=ti&&i(this,si)[si]("log",e)}debug(e){(i(this,ni)[ni]>=ii||i(this,ri)[ri])&&i(this,si)[si]("debug",e)}debugPE(e){i(this,ni)[ni]>=oi&&i(this,si)[si]("debug_pe",e)}reportError(e,t){this.wzrkError.c=e,this.wzrkError.d=t,this.error("".concat(Ce," ").concat(e,": ").concat(t))}}var li=function(e,t){if(window.console)try{const i=(new Date).getTime();console[e]("CleverTap [".concat(i,"]: ").concat(t))}catch(e){}},ci=function(){return"undefined"!=typeof sessionStorage&&""===sessionStorage.WZRK_D},di=t("logger"),hi=t("sessionId"),ui=t("isPersonalisationActive");class pi{constructor(e){let{logger:t,isPersonalisationActive:o}=e;Object.defineProperty(this,di,{writable:!0,value:void 0}),Object.defineProperty(this,hi,{writable:!0,value:void 0}),Object.defineProperty(this,ui,{writable:!0,value:void 0}),this.cookieName=void 0,this.scookieObj=void 0,this.sessionId=ae.getMetaProp("cs"),i(this,di)[di]=t,i(this,ui)[ui]=o}get sessionId(){return i(this,hi)[hi]}set sessionId(e){i(this,hi)[hi]=e}getSessionCookieObject(){let e=ae.readCookie(this.cookieName),t={};if(null!=e)if(e=e.replace(p,'"'),t=JSON.parse(e),J(t)){if(void 0!==t.t){const e=t.t;oe()-e>1260&&(t={})}}else t={};return this.scookieObj=t,t}setSessionCookieObject(e){const t=JSON.stringify(e);ae.createBroadCookie(this.cookieName,t,1200,We())}manageSession(e){if(void 0===this.sessionId||this.sessionId!==e){const t=ae.getMetaProp("cs");if(void 0===t)ae.setMetaProp("ps",e),ae.setMetaProp("cs",e),ae.setMetaProp("sc",1);else if(t!==e){ae.setMetaProp("ps",t),ae.setMetaProp("cs",e);let i=ae.getMetaProp("sc");void 0===i&&(i=0),ae.setMetaProp("sc",i+1)}this.sessionId=e}}getTimeElapsed(){if(!i(this,ui)[ui]())return;null!=this.scookieObj&&(this.scookieObj=this.getSessionCookieObject());const e=this.scookieObj.s;if(null!=e){const t=oe();return Math.floor(t-e)}}getPageCount(){if(i(this,ui)[ui]())return null!=this.scookieObj&&(this.scookieObj=this.getSessionCookieObject()),this.scookieObj.p}}let gi=0,fi=0;var vi=t("logger"),bi=t("account"),mi=t("device"),yi=t("session"),wi=t("isPersonalisationActive"),Ci=t("clearCookie"),ki=t("addToLocalEventMap");class xi{constructor(e){let{logger:t,account:o,device:n,session:s,isPersonalisationActive:r}=e;Object.defineProperty(this,ki,{value:Pi}),Object.defineProperty(this,vi,{writable:!0,value:void 0}),Object.defineProperty(this,bi,{writable:!0,value:void 0}),Object.defineProperty(this,mi,{writable:!0,value:void 0}),Object.defineProperty(this,yi,{writable:!0,value:void 0}),Object.defineProperty(this,wi,{writable:!0,value:void 0}),Object.defineProperty(this,Ci,{writable:!0,value:!1}),this.processingBackup=!1,i(this,vi)[vi]=t,i(this,bi)[bi]=o,i(this,mi)[mi]=n,i(this,yi)[yi]=s,i(this,wi)[wi]=r,Qe.logger=t,Qe.device=n,Qe.account=o}processBackupEvents(){const e=ae.readFromLSorCookie(S);if(null!=e){this.processingBackup=!0;for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];void 0===o.fired&&(i(this,vi)[vi].debug("Processing backup event : "+o.q),void 0!==o.q&&Qe.fireRequest(o.q),o.fired=!0)}ae.saveToLSorCookie(S,e),this.processingBackup=!1}}addSystemDataToObject(e,t){void 0===t&&(e=ee(e,i(this,vi)[vi])),$(i(this,vi)[vi].wzrkError)||(e.wzrk_error=i(this,vi)[vi].wzrkError,i(this,vi)[vi].wzrkError={}),e.id=i(this,bi)[bi].id,X(i(this,mi)[mi].gcookie)&&(e.g=i(this,mi)[mi].gcookie);const o=i(this,yi)[yi].getSessionCookieObject();e.s=o.s,e.pg=void 0===o.p?1:o.p;let n=document.location.protocol;return n=n.replace(":",""),e.af={lib:"web-sdk-v1.7.3",protocol:n,...le.flutterVersion},sessionStorage.hasOwnProperty("WZRK_D")&&(e.debug=!0),e}addFlags(e){if(i(this,Ci)[Ci]=ae.getAndClearMetaProp(g),void 0!==i(this,Ci)[Ci]&&i(this,Ci)[Ci]&&(e.rc=!0,i(this,vi)[vi].debug("reset cookie sent in request and cleared from meta for future requests.")),i(this,wi)[wi]()){const t=ae.getMetaProp("lsTime"),i=ae.getMetaProp("exTs");if(void 0===t||void 0===i)return void(e.dsync=!0);t+i{if(e.ok)return e.json();throw e})).then((e=>(i(this,vi)[vi].debug("Sync data successful",e),e))).catch((e=>{throw i(this,vi)[vi].debug("Error in syncing variables",e),e}))}}var Pi=function(e){if(ae._isLocalStorageSupported()){void 0===le.globalEventsMap&&(le.globalEventsMap=ae.readFromLSorCookie(C),void 0===le.globalEventsMap&&(le.globalEventsMap={}));const t=oe();let i=le.globalEventsMap[e];void 0!==i?(i[2]=t,i[0]++):(i=[],i.push(1),i.push(t),i.push(t)),le.globalEventsMap[e]=i,ae.saveToLSorCookie(C,le.globalEventsMap)}},Si=t("request"),Ii=t("account"),_i=t("oldValues"),Oi=t("logger"),Ei=t("processPrivacyArray");class Ai extends Array{constructor(e,t){let{request:o,account:n,logger:s}=e;super(),Object.defineProperty(this,Ei,{value:Li}),Object.defineProperty(this,Si,{writable:!0,value:void 0}),Object.defineProperty(this,Ii,{writable:!0,value:void 0}),Object.defineProperty(this,_i,{writable:!0,value:void 0}),Object.defineProperty(this,Oi,{writable:!0,value:void 0}),i(this,Oi)[Oi]=s,i(this,Si)[Si]=o,i(this,Ii)[Ii]=n,i(this,_i)[_i]=t}push(){for(var e=arguments.length,t=new Array(e),o=0;o0?le.privacyArray:t):le.privacyArray.push(...t),0}_processOldValues(){i(this,_i)[_i]&&i(this,Ei)[Ei](i(this,_i)[_i]),i(this,_i)[_i]=null}}var Li=function(e){if(Array.isArray(e)&&e.length>0){const o=e.reduce(((e,t)=>({...e,...t})),{});let n={};const s={};var t=!1;if(o.hasOwnProperty(_)&&"boolean"==typeof(t=o.optOut)&&(s.ct_optout=t,le.isOptInRequest=!t),o.hasOwnProperty(O)){const e=o.useIP,t="boolean"==typeof e&&e;ae.setMetaProp(O,t)}if(!$(s)){n.type="profile",n.profile=s,n=i(this,Si)[Si].addSystemDataToObject(n,void 0);const o=Ke(JSON.stringify(n),i(this,Oi)[Oi]);let r=i(this,Ii)[Ii].dataPostURL;r=Ve(r,"type",A),r=Ve(r,"d",o),r=Ve(r,_,t?"true":"false"),i(this,Si)[Si].saveAndFireRequest(r,le.blockRequest),e.splice(0,e.length)}}},Mi=t("oldValues"),Ti=t("logger"),Ri=t("request"),ji=t("account"),Di=t("wizAlertJSPath"),zi=t("fcmPublicKey"),Bi=t("setUpWebPush"),Ni=t("setUpWebPushNotifications"),Fi=t("setApplicationServerKey"),Ui=t("setUpSafariNotifications"),qi=t("setUpChromeFirefoxNotifications"),Vi=t("addWizAlertJS"),Wi=t("removeWizAlertJS"),Ki=t("handleNotificationRegistration");class Hi extends Array{constructor(e,t){let{logger:o,session:n,request:s,account:r}=e;super(),Object.defineProperty(this,Ki,{value:eo}),Object.defineProperty(this,Wi,{value:Xi}),Object.defineProperty(this,Vi,{value:Qi}),Object.defineProperty(this,qi,{value:Yi}),Object.defineProperty(this,Ui,{value:$i}),Object.defineProperty(this,Fi,{value:Zi}),Object.defineProperty(this,Ni,{value:Ji}),Object.defineProperty(this,Bi,{value:Gi}),Object.defineProperty(this,Mi,{writable:!0,value:void 0}),Object.defineProperty(this,Ti,{writable:!0,value:void 0}),Object.defineProperty(this,Ri,{writable:!0,value:void 0}),Object.defineProperty(this,ji,{writable:!0,value:void 0}),Object.defineProperty(this,Di,{writable:!0,value:void 0}),Object.defineProperty(this,zi,{writable:!0,value:void 0}),i(this,Di)[Di]="https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js",i(this,zi)[zi]=null,i(this,Mi)[Mi]=t,i(this,Ti)[Ti]=o,i(this,Ri)[Ri]=s,i(this,ji)[ji]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o0?i(this,Ki)[Ki](e):null==le.webPushEnabled&&e.length>0?(le.notifApi.notifEnabledFromApi=!0,le.notifApi.displayArgs=e.slice()):!1===le.webPushEnabled&&e.length>0&&i(this,Ti)[Ti].error("Make sure push notifications are fully enabled and integrated")},Ji=function(e,t,o,n){-1!==navigator.userAgent.indexOf("Chrome")||-1!==navigator.userAgent.indexOf("Firefox")?i(this,qi)[qi](e,t):-1!==navigator.userAgent.indexOf("Safari")&&i(this,Ui)[Ui](e,o,n)},Zi=function(e){i(this,zi)[zi]=e},$i=function(e,t,o){void 0===t&&i(this,Ti)[Ti].error("Ensure that APNS Web Push ID is supplied"),void 0===o&&i(this,Ti)[Ti].error("Ensure that APNS Web Push service path is supplied"),"safari"in window&&"pushNotification"in window.safari&&window.safari.pushNotification.requestPermission(o,t,{},(e=>{if("granted"===e.permission){const t=JSON.parse(JSON.stringify(e));t.endpoint=e.deviceToken,t.browser="Safari",ae.saveToLSorCookie(z,t),i(this,Ri)[Ri].registerToken(t),i(this,Ti)[Ti].info("Safari Web Push registered. Device Token: "+e.deviceToken)}else"denied"===e.permission&&i(this,Ti)[Ti].info("Error subscribing to Safari web push")}))},Yi=function(e,t){let o="";"serviceWorker"in navigator&&navigator.serviceWorker.register(t).then((e=>{if("undefined"!=typeof __wzrk_account_id)return new Promise((t=>setTimeout((()=>t(e)),5e3)));o=e.scope;return/^(\.?)(\/?)([^/]*).js$/.test(t)?navigator.serviceWorker.ready:-1!==navigator.userAgent.indexOf("Chrome")?new Promise((t=>setTimeout((()=>t(e)),5e3))):navigator.serviceWorker.getRegistrations()})).then((t=>{-1!==navigator.userAgent.indexOf("Firefox")&&Array.isArray(t)&&(t=t.filter((e=>e.scope===o))[0]);const n={userVisibleOnly:!0};null!=i(this,zi)[zi]&&(n.applicationServerKey=(e=>{let t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),i=window.atob(t),o=[];for(let e=0;e{i(this,Ti)[Ti].info("Service Worker registered. Endpoint: "+t.endpoint);const o=JSON.parse(JSON.stringify(t));-1!==navigator.userAgent.indexOf("Chrome")?(o.endpoint=o.endpoint.split("/").pop(),o.browser="Chrome"):-1!==navigator.userAgent.indexOf("Firefox")&&(o.endpoint=o.endpoint.split("/").pop(),o.browser="Firefox"),ae.saveToLSorCookie(z,o),i(this,Ri)[Ri].registerToken(o),void 0!==e&&"function"==typeof e&&e()})).catch((e=>{i(this,Ti)[Ti].error("Error subscribing: "+e),t.pushManager.getSubscription().then((e=>{null!==e&&e.unsubscribe().then((e=>{i(this,Ti)[Ti].info("Unsubscription successful")})).catch((e=>{i(this,Ti)[Ti].error("Error unsubscribing: "+e)}))}))}))})).catch((e=>{i(this,Ti)[Ti].error("error registering service worker: "+e)}))},Qi=function(){const e=document.createElement("script");return e.setAttribute("type","text/javascript"),e.setAttribute("id","wzrk-alert-js"),e.setAttribute("src",i(this,Di)[Di]),document.getElementsByTagName("body")[0].appendChild(e),e},Xi=function(){const e=document.getElementById("wzrk-alert-js");e.parentNode.removeChild(e)},eo=function(e){let t,o,n,s,r,a,l,c,d,h,u,p,g,f,v;if(1===e.length){if(J(e[0])){const i=e[0];t=i.titleText,o=i.bodyText,n=i.okButtonText,s=i.rejectButtonText,r=i.okButtonColor,a=i.skipDialog,l=i.askAgainTimeInSeconds,c=i.okCallback,d=i.rejectCallback,h=i.subscriptionCallback,u=i.serviceWorkerPath,p=i.httpsPopupPath,g=i.httpsIframePath,f=i.apnsWebPushId,v=i.apnsWebPushServiceUrl}}else t=e[0],o=e[1],n=e[2],s=e[3],r=e[4],a=e[5],l=e[6];if(null==a&&(a=!1),null==u&&(u="/clevertap_sw.js"),void 0===navigator.serviceWorker)return;const b=null!=p&&null!=g;if("https:"!==window.location.protocol&&"localhost"!==document.location.hostname&&!b)return void i(this,Ti)[Ti].error("Make sure you are https or localhost to register for notifications");if(-1!==navigator.userAgent.indexOf("Chrome")){const e=navigator.userAgent.match(/Chrome\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}else if(-1!==navigator.userAgent.indexOf("Firefox")){const e=navigator.userAgent.match(/Firefox\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}else{if(-1===navigator.userAgent.indexOf("Safari"))return;{const e=navigator.userAgent.match(/Safari\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}}if(!b){if(null==Notification)return;if("granted"===Notification.permission)return void i(this,Ni)[Ni](h,u,f,v);if("denied"===Notification.permission)return;if(a)return void i(this,Ni)[Ni](h,u,f,v)}if(!(t&&o&&n&&s))return void i(this,Ti)[Ti].error("Missing input parameters; please specify title, body, ok button and cancel button text");null!=r&&r.match(/^#[a-f\d]{6}$/i)||(r="#f28046");const m=(new Date).getTime()/1e3;if(null==ae.getMetaProp("notif_last_time"))ae.setMetaProp("notif_last_time",m);else{if(null==l&&(l=604800),m-ae.getMetaProp("notif_last_time"){if(null!=e.data){let a={};try{a=JSON.parse(e.data)}catch(e){return}null!=a.state&&"ct"===a.from&&"not"===a.state&&(i(this,Vi)[Vi]().onload=()=>{window.wzrkPermissionPopup.wizAlert({title:t,body:o,confirmButtonText:n,confirmButtonColor:r,rejectButtonText:s},(e=>{e?("function"==typeof c&&c(),window.open(p)):"function"==typeof d&&d(),i(this,Wi)[Wi]()}))})}}),!1)}else i(this,Vi)[Vi]().onload=()=>{window.wzrkPermissionPopup.wizAlert({title:t,body:o,confirmButtonText:n,confirmButtonColor:r,rejectButtonText:s},(e=>{e?("function"==typeof c&&c(),i(this,Ni)[Ni](h,u,f,v)):"function"==typeof d&&d(),i(this,Wi)[Wi]()}))}},to=t("variableStore");class io{constructor(e){let{variableStore:t}=e;Object.defineProperty(this,to,{writable:!0,value:void 0}),this.name=null,this.defaultValue=null,this.value=null,this.type=null,this.hadStarted=!1,this.valueChangedCallbacks=[],i(this,to)[to]=t}getValue(){return this.value}getdefaultValue(){return this.defaultValue}static define(e,t,i){if(!e||"string"!=typeof e)return console.error("Empty or invalid name parameter provided."),null;if(e.startsWith(".")||e.endsWith("."))return console.error("Variable name starts or ends with a `.` which is not allowed: "+e),null;const o=typeof t;if("string"!==o&&"number"!==o&&"boolean"!==o)return console.error("Only primitive types (string, number, boolean) are accepted as value"),null;const n=i.getVariable(e);if(n)return n;const s=new io({variableStore:i});try{s.name=e,s.defaultValue=t,s.value=t,s.type=o,i.registerVariable(s),s.update(t)}catch(e){console.error(e)}return s}update(e){const t=this.value;this.value=e,null===e&&null===t||null!==e&&e===t&&this.hadStarted||i(this,to)[to].hasVarsRequestCompleted()&&(this.hadStarted=!0,this.triggerValueChanged())}triggerValueChanged(){this.valueChangedCallbacks.forEach((e=>{e(this)}))}addValueChangedCallback(e){e?(this.valueChangedCallbacks.push(e),i(this,to)[to].hasVarsRequestCompleted()&&e(this)):console.log("Invalid callback parameter provided.")}removeValueChangedCallback(e){const t=this.valueChangedCallbacks.indexOf(e);-1!==t&&this.valueChangedCallbacks.splice(t,1)}clearStartFlag(){this.hadStarted=!1}}var oo=t("logger"),no=t("account"),so=t("request"),ro=t("event"),ao=t("variables"),lo=t("remoteVariables"),co=t("fetchCallback"),ho=t("variablesChangedCallbacks"),uo=t("oneTimeVariablesChangedCallbacks"),po=t("hasVarsRequestCompleted"),go=t("runVariablesChangedCallback");class fo{constructor(e){let{logger:t,request:o,account:n,event:s}=e;Object.defineProperty(this,go,{value:vo}),Object.defineProperty(this,oo,{writable:!0,value:void 0}),Object.defineProperty(this,no,{writable:!0,value:void 0}),Object.defineProperty(this,so,{writable:!0,value:void 0}),Object.defineProperty(this,ro,{writable:!0,value:void 0}),Object.defineProperty(this,ao,{writable:!0,value:void 0}),Object.defineProperty(this,lo,{writable:!0,value:void 0}),Object.defineProperty(this,co,{writable:!0,value:void 0}),Object.defineProperty(this,ho,{writable:!0,value:void 0}),Object.defineProperty(this,uo,{writable:!0,value:void 0}),Object.defineProperty(this,po,{writable:!0,value:!1}),i(this,oo)[oo]=t,i(this,no)[no]=n,i(this,so)[so]=o,i(this,ro)[ro]=s,i(this,ao)[ao]={},i(this,lo)[lo]={},i(this,ho)[ho]=[],i(this,uo)[uo]=[],le.variableStore=this}registerVariable(e){const{name:t}=e;i(this,ao)[ao][t]=e,console.log("registerVariable",i(this,ao)[ao])}getVariable(e){return i(this,ao)[ao][e]}hasVarsRequestCompleted(){return i(this,po)[po]}syncVariables(e,t){if(!i(this,no)[no].token){const e="Account token is missing.";return i(this,oo)[oo].error(e),Promise.reject(new Error(e))}const o={type:"varsPayload",vars:{}};for(const e in i(this,ao)[ao])o.vars[e]={defaultValue:i(this,ao)[ao][e].defaultValue,type:i(this,ao)[ao][e].type};if(0===Object.keys(o.vars).length){const e="No variables are defined.";return i(this,oo)[oo].error(e),Promise.reject(new Error(e))}let n={};n=i(this,so)[so].addSystemDataToObject(n,void 0),n.tk=i(this,no)[no].token,n.type="meta";const s=JSON.stringify([n,o]),r=i(this,no)[no].dataPostPEURL;return i(this,so)[so].post(r,s).then((t=>(e&&"function"==typeof e&&e(t),t))).catch((e=>{throw t&&"function"==typeof t&&t(e),400===e.status?i(this,oo)[oo].error("Invalid sync payload or clear the existing draft"):401===e.status?i(this,oo)[oo].error("This is not a test profile"):i(this,oo)[oo].error("Sync variable failed"),e}))}fetchVariables(e){i(this,ro)[ro].push(K,{t:4}),e&&"function"==typeof e&&(i(this,co)[co]=e)}mergeVariables(e){console.log("msg vars is ",e),i(this,po)[po]=!0,ae.saveToLSorCookie("WZRK_PE",e),i(this,lo)[lo]=e;for(const t in i(this,ao)[ao])e.hasOwnProperty(t)&&i(this,ao)[ao][t].update(e[t]);i(this,co)[co]&&i(this,co)[co](),i(this,go)[go]()}addVariablesChangedCallback(e){e&&"function"==typeof e?(i(this,ho)[ho].push(e),this.hasVarsRequestCompleted()&&e()):i(this,oo)[oo].error("callback is not a function")}addOneTimeVariablesChangedCallback(e){e&&"function"==typeof e&&(this.hasVarsRequestCompleted()?e():i(this,uo)[uo].push(e))}removeVariablesChangedCallback(e){const t=i(this,ho)[ho].indexOf(e);-1!==t&&i(this,ho)[ho].splice(t,1)}removeOneTimeVariablesChangedCallback(e){const t=i(this,uo)[uo].indexOf(e);-1!==t&&i(this,uo)[uo].splice(t,1)}}var vo=function(){for(var e of i(this,ho)[ho])e();for(var t of i(this,uo)[uo])t();i(this,uo)[uo].length=0},bo=t("logger"),mo=t("api"),yo=t("onloadcalled"),wo=t("device"),Co=t("session"),ko=t("account"),xo=t("request"),Po=t("variableStore"),So=t("isSpa"),Io=t("previousUrl"),_o=t("boundCheckPageChanged"),Oo=t("dismissSpamControl"),Eo=t("processOldValues"),Ao=t("debounce"),Lo=t("checkPageChanged"),Mo=t("pingRequest"),To=t("isPingContinuous"),Ro=t("overrideDSyncFlag");var jo=function(){this.onUserLogin._processOldValues(),this.privacy._processOldValues(),this.event._processOldValues(),this.profile._processOldValues(),this.notifications._processOldValues()},Do=function(e){let t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300;return function(){clearTimeout(t),t=setTimeout(e,i)}},zo=function(){i(this,Ao)[Ao]((()=>{i(this,Io)[Io]!==location.href&&this.pageChanged()}))()},Bo=function(){let e=i(this,ko)[ko].dataPostURL,t={};t=i(this,xo)[xo].addSystemDataToObject(t,void 0),e=Ve(e,"type","ping"),e=Ve(e,"d",Ke(JSON.stringify(t),i(this,bo)[bo])),i(this,xo)[xo].saveAndFireRequest(e,le.blockRequest)},No=function(){return void 0!==window.wzrk_d&&"continuous"===window.wzrk_d.ping},Fo=function(e){this._isPersonalisationActive()&&(e.dsync=!0)};const Uo=new class{get spa(){return i(this,So)[So]}set spa(e){const t=!0===e;i(this,So)[So]!==t&&1===i(this,yo)[yo]&&(t?document.addEventListener("click",i(this,_o)[_o]):document.removeEventListener("click",i(this,_o)[_o])),i(this,So)[So]=t}get dismissSpamControl(){return i(this,Oo)[Oo]}set dismissSpamControl(e){const t=!0===e;i(this,Oo)[Oo]=t,le.dismissSpamControl=t}constructor(){var e,t,o,n,s;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.defineProperty(this,Ro,{value:Fo}),Object.defineProperty(this,To,{value:No}),Object.defineProperty(this,Mo,{value:Bo}),Object.defineProperty(this,Lo,{value:zo}),Object.defineProperty(this,Ao,{value:Do}),Object.defineProperty(this,Eo,{value:jo}),Object.defineProperty(this,bo,{writable:!0,value:void 0}),Object.defineProperty(this,mo,{writable:!0,value:void 0}),Object.defineProperty(this,yo,{writable:!0,value:void 0}),Object.defineProperty(this,wo,{writable:!0,value:void 0}),Object.defineProperty(this,Co,{writable:!0,value:void 0}),Object.defineProperty(this,ko,{writable:!0,value:void 0}),Object.defineProperty(this,xo,{writable:!0,value:void 0}),Object.defineProperty(this,Po,{writable:!0,value:void 0}),Object.defineProperty(this,So,{writable:!0,value:void 0}),Object.defineProperty(this,Io,{writable:!0,value:void 0}),Object.defineProperty(this,_o,{writable:!0,value:i(this,Lo)[Lo].bind(this)}),Object.defineProperty(this,Oo,{writable:!0,value:void 0}),this.enablePersonalization=void 0,this.popupCallbacks={},this.popupCurrentWzrkId="",i(this,yo)[yo]=0,this._isPersonalisationActive=this._isPersonalisationActive.bind(this),this.raiseNotificationClicked=()=>{},i(this,bo)[bo]=new ai(ti),i(this,ko)[ko]=new d(null===(e=r.account)||void 0===e?void 0:e[0],r.region||(null===(t=r.account)||void 0===t?void 0:t[1]),r.targetDomain||(null===(o=r.account)||void 0===o?void 0:o[2]),r.token||(null===(n=r.account)||void 0===n?void 0:n[3])),i(this,wo)[wo]=new ye({logger:i(this,bo)[bo]}),i(this,Oo)[Oo]=r.dismissSpamControl||!1,i(this,Co)[Co]=new pi({logger:i(this,bo)[bo],isPersonalisationActive:this._isPersonalisationActive}),i(this,xo)[xo]=new xi({logger:i(this,bo)[bo],account:i(this,ko)[ko],device:i(this,wo)[wo],session:i(this,Co)[Co],isPersonalisationActive:this._isPersonalisationActive}),this.enablePersonalization=r.enablePersonalization||!1,this.event=new Fe({logger:i(this,bo)[bo],request:i(this,xo)[xo],isPersonalisationActive:this._isPersonalisationActive},r.event),this.profile=new gt({logger:i(this,bo)[bo],request:i(this,xo)[xo],account:i(this,ko)[ko],isPersonalisationActive:this._isPersonalisationActive},r.profile),this.onUserLogin=new It({request:i(this,xo)[xo],account:i(this,ko)[ko],session:i(this,Co)[Co],logger:i(this,bo)[bo],device:i(this,wo)[wo]},r.onUserLogin),this.privacy=new Ai({request:i(this,xo)[xo],account:i(this,ko)[ko],logger:i(this,bo)[bo]},r.privacy),this.notifications=new Hi({logger:i(this,bo)[bo],request:i(this,xo)[xo],account:i(this,ko)[ko]},r.notifications),i(this,Po)[Po]=new fo({logger:i(this,bo)[bo],request:i(this,xo)[xo],account:i(this,ko)[ko],event:this.event}),i(this,mo)[mo]=new be({logger:i(this,bo)[bo],request:i(this,xo)[xo],device:i(this,wo)[wo],session:i(this,Co)[Co]}),this.spa=r.spa,this.dismissSpamControl=r.dismissSpamControl,this.user=new Xt({isPersonalisationActive:this._isPersonalisationActive}),this.session={getTimeElapsed:()=>i(this,Co)[Co].getTimeElapsed(),getPageCount:()=>i(this,Co)[Co].getPageCount()},this.logout=()=>{i(this,bo)[bo].debug("logout called"),ae.setInstantDeleteFlagInK()},this.clear=()=>{this.onUserLogin.clear()},this.getCleverTapID=()=>i(this,wo)[wo].getGuid(),this.getAccountID=()=>i(this,ko)[ko].id,this.getSCDomain=()=>i(this,ko)[ko].finalTargetDomain,this.setLibrary=(e,t)=>{le.flutterVersion={[e]:t}},this.setSCSDKVersion=e=>{i(this,ko)[ko].scSDKVersion=e;const t={};t.af={scv:"sc-sdk-v"+i(this,ko)[ko].scSDKVersion};let o=i(this,ko)[ko].dataPostURL;o=Ve(o,"type","page"),o=Ve(o,"d",Ke(JSON.stringify(t),i(this,bo)[bo])),i(this,xo)[xo].saveAndFireRequest(o,le.blockRequest)},Kt()&&(qt(),Ut(i(this,bo)[bo])),this.getInboxMessageCount=()=>{const e=Nt();return Object.keys(e).length},this.getInboxMessageUnreadCount=()=>{if(le.inbox)return le.inbox.unviewedCounter;i(this,bo)[bo].debug("No unread messages")},this.getAllInboxMessages=()=>Nt(),this.getUnreadInboxMessages=()=>{if(le.inbox)return le.inbox.unviewedMessages;i(this,bo)[bo].debug("No unread messages")},this.getInboxMessageForId=e=>{const t=Nt();if((null!==e||""!==e)&&t.hasOwnProperty(e))return t[e];i(this,bo)[bo].error("No message available for message Id "+e)},this.deleteInboxMessage=e=>{const t=Nt();if(null===e&&""===e||!t.hasOwnProperty(e))i(this,bo)[bo].error("No message available for message Id "+e);else{const i=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);0===t[e].viewed&&(le.inbox.unviewedCounter--,delete le.inbox.unviewedMessages[e],document.getElementById("unviewedBadge").innerText=le.inbox.unviewedCounter,document.getElementById("unviewedBadge").style.display=le.inbox.unviewedCounter>0?"flex":"none"),i&&i.remove(),delete t[e],Ft(t)}},this.markReadInboxMessage=e=>{const t=le.inbox.unviewedMessages,o=Nt();if(null===e&&""===e||!t.hasOwnProperty(e))i(this,bo)[bo].error("No message available for message Id "+e);else{const t=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);if(null!==t&&(t.shadowRoot.getElementById("unreadMarker").style.display="none"),o[e].viewed=1,document.getElementById("unviewedBadge")){var n=parseInt(document.getElementById("unviewedBadge").innerText)-1;document.getElementById("unviewedBadge").innerText=n,document.getElementById("unviewedBadge").style.display=n>0?"flex":"none"}window.clevertap.renderNotificationViewed({msgId:o[e].wzrk_id,pivotId:o[e].pivotId}),le.inbox.unviewedCounter--,delete le.inbox.unviewedMessages[e],Ft(o)}},this.markReadInboxMessagesForIds=e=>{if(Array.isArray(e))for(var t=0;t{const e=le.inbox.unviewedMessages,t=Nt();if(Object.keys(e).length>0){Object.keys(e).forEach((e=>{const i=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);null!==i&&(i.shadowRoot.getElementById("unreadMarker").style.display="none"),t[e].viewed=1,window.clevertap.renderNotificationViewed({msgId:t[e].wzrk_id,pivotId:t[e].wzrk_pivot})})),document.getElementById("unviewedBadge").innerText=0,document.getElementById("unviewedBadge").style.display="none",Ft(t),le.inbox.unviewedCounter=0,le.inbox.unviewedMessages={}}else i(this,bo)[bo].debug("All messages are already read")},this.toggleInbox=e=>{var t;return null===(t=le.inbox)||void 0===t?void 0:t.toggleInbox(e)},this.renderNotificationViewed=e=>{a(R,e)},this.renderNotificationClicked=e=>{a(j,e)};const a=(e,t)=>{if(!t||!t.msgId)return;const o={type:"event"};if(o.evtName=e,o.evtData={[T]:t.msgId},t.pivotId&&(o.evtData={...o.evtData,wzrk_pivot:t.pivotId}),t.wzrk_slideNo&&(o.evtData={...o.evtData,wzrk_slideNo:t.wzrk_slideNo}),t.kv&&null!==t.kv&&void 0!==t.kv)for(const e in t.kv)e.startsWith(M)&&(o.evtData={...o.evtData,[e]:t.kv[e]});if(t.msgCTkv&&null!==t.msgCTkv&&void 0!==t.msgCTkv)for(const e in t.msgCTkv)e.startsWith(M)&&(o.evtData={...o.evtData,[e]:t.msgCTkv[e]});i(this,xo)[xo].processEvent(o)};this.setLogLevel=e=>{i(this,bo)[bo].logLevel=Number(e),3===e?sessionStorage.WZRK_D="":delete sessionStorage.WZRK_D},this.handleIncrementValue=(e,t)=>{this.profile._handleIncrementDecrementValue(e,t,B)},this.handleDecrementValue=(e,t)=>{this.profile._handleIncrementDecrementValue(e,t,"$decr")},this.setMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueSet(e,t,"$set"):console.error("setMultiValuesForKey should be called with a value of type array")},this.addMultiValueForKey=(e,t)=>{"string"==typeof t||"number"==typeof t?this.profile._handleMultiValueAdd(e,t,N):console.error("addMultiValueForKey should be called with a value of type string or number.")},this.addMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueAdd(e,t,N):console.error("addMultiValuesForKey should be called with a value of type array.")},this.removeMultiValueForKey=(e,t)=>{"string"==typeof t||"number"==typeof t?this.profile._handleMultiValueRemove(e,t,F):console.error("removeMultiValueForKey should be called with a value of type string or number.")},this.removeMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueRemove(e,t,F):console.error("removeMultiValuesForKey should be called with a value of type array.")},this.removeValueForKey=e=>{this.profile._handleMultiValueDelete(e,U)};const l=(e,t,o)=>{((e,t,i,o,n)=>{const s=qe(location.href),r=s.e,a=s.p,l=s.page_type;if(void 0!==r){const s={};s.id=o.id,s.unsubGroups=le.unsubGroups,le.updatedCategoryLong&&(s.cUsY=le.updatedCategoryLong);let c=o.emailURL;i&&(c=Ve(c,"fetchGroups",i)),t&&(c=Ve(c,"encoded",t)),c=Ve(c,"e",r),c=Ve(c,"d",Ke(JSON.stringify(s),n)),a&&(c=Ve(c,"p",a)),"-1"!==e&&(c=Ve(c,"sub",e)),l&&(le.globalUnsubscribe=l===I,c=Ve(c,"page_type",l)),Qe.fireRequest(c)}})(e,t,o,i(this,ko)[ko],i(this,bo)[bo])};function c(e){var t=e.coords.latitude,i=e.coords.longitude;le.location={Latitude:t,Longitude:i},this.sendLocationData({Latitude:t,Longitude:i})}function h(e){switch(e.code){case e.PERMISSION_DENIED:console.log("User denied the request for Geolocation.");break;case e.POSITION_UNAVAILABLE:console.log("Location information is unavailable.");break;case e.TIMEOUT:console.log("The request to get user location timed out.");break;case e.UNKNOWN_ERROR:console.log("An unknown error occurred.")}}this.getLocation=function(e,t){if(e&&"number"!=typeof e||t&&"number"!=typeof t)console.log("Latitude and Longitude must be of number type");else if(e&&t){if(e<=-90||e>90)return void console.log("A vaid latitude must range between -90 and 90");if(t<=-180||t>180)return void console.log("A valid longitude must range between -180 and 180");le.location={Latitude:e,Longitude:t},this.sendLocationData({Latitude:e,Longitude:t})}else navigator.geolocation?navigator.geolocation.getCurrentPosition(c.bind(this),h):console.log("Geolocation is not supported by this browser.")};const u=i(this,mo)[mo];u.logout=this.logout,u.clear=this.clear,u.closeIframe=(e,t)=>{at(e,0,i(this,Co)[Co].sessionId)},u.enableWebPush=(e,t)=>{this.notifications._enableWebPush(e,t)},u.tr=e=>{Yt(e,{device:i(this,wo)[wo],session:i(this,Co)[Co],request:i(this,xo)[xo],logger:i(this,bo)[bo]})},u.setEnum=e=>{((e,t)=>{if(G(e)||Q(e))return"$E_"+e;t.error(Ae)})(e,i(this,bo)[bo])},u.is_onloadcalled=()=>1===i(this,yo)[yo],u.subEmail=e=>{l("1",e)},u.getEmail=(e,t)=>{l("-1",e,t)},u.unSubEmail=e=>{l("0",e)},u.unsubEmailGroups=e=>{le.unsubGroups=[];const t=document.getElementsByClassName("ct-unsub-group-input-item");for(let e=0;e{le.unsubGroups=e},u.getSubscriptionGroups=()=>le.unsubGroups,u.changeSubscriptionGroups=(e,t)=>{u.setSubscriptionGroups(t),l("2",e)},u.isGlobalUnsubscribe=()=>le.globalUnsubscribe,u.setIsGlobalUnsubscribe=e=>{le.globalUnsubscribe=e},u.setUpdatedCategoryLong=e=>{e.cUsY&&(le.updatedCategoryLong=e.cUsY)},window.$CLTP_WR=window.$WZRK_WR=u,(null===(s=r.account)||void 0===s?void 0:s[0].id)&&this.init()}init(e,t,o,n){if(1===i(this,yo)[yo])return;if(ae.removeCookie("WZRK_P",window.location.hostname),!i(this,ko)[ko].id){if(!e)return void i(this,bo)[bo].error(ke);i(this,ko)[ko].id=e}i(this,Co)[Co].cookieName="WZRK_S_"+i(this,ko)[ko].id,t&&(i(this,ko)[ko].region=t),o&&(i(this,ko)[ko].targetDomain=o),n&&(i(this,ko)[ko].token=n);const s=location.href,r=qe(s.toLowerCase());if(void 0!==r.e&&"0"==r.wzrk_ex)return;le.isPrivacyArrPushed=!0,le.privacyArray.length>0&&this.privacy.push(le.privacyArray),i(this,Eo)[Eo](),this.pageChanged();const a=setInterval((()=>{i(this,wo)[wo].gcookie&&(clearInterval(a),i(this,xo)[xo].processBackupEvents())}),3e3);i(this,So)[So]?document.addEventListener("click",i(this,_o)[_o]):document.removeEventListener("click",i(this,_o)[_o]),i(this,yo)[yo]=1}pageChanged(){const e=window.location.search;if("?ctBuilder"===e)return console.log("open in visual builder mode"),void document.addEventListener("DOMContentLoaded",Zt);if("?ctBuilderPreview"===e)return void console.log("open in visual builder mode");const t=window.location.href,o=qe(t.toLowerCase()),n=i(this,Co)[Co].getSessionCookieObject();let s=void 0===n.p?0:n.p;n.p=++s,i(this,Co)[Co].setSessionCookieObject(n);let r={},a=(e=>{if(""===e)return"";var t=document.createElement("a");return t.href=e,t.hostname})(document.referrer);if(window.location.hostname!==a){const e=120;""!==a&&(a=a.length>e?a.substring(0,e):a,r.referrer=a);let t=o.utm_source||o.wzrk_source;void 0!==t&&(t=t.length>e?t.substring(0,e):t,r.us=t);let i=o.utm_medium||o.wzrk_medium;void 0!==i&&(i=i.length>e?i.substring(0,e):i,r.um=i);let n=o.utm_campaign||o.wzrk_campaign;if(void 0!==n&&(n=n.length>e?n.substring(0,e):n,r.uc=n),void 0!==o.wzrk_medium){const e=o.wzrk_medium;e.match(/^email$|^social$|^search$/)&&(r.wm=e)}}r=i(this,xo)[xo].addSystemDataToObject(r,void 0),r.cpg=t,r.WZRK_CAMP=it();let l=i(this,ko)[ko].dataPostURL;i(this,xo)[xo].addFlags(r),1===parseInt(r.pg)&&i(this,Ro)[Ro](r),l=Ve(l,"type","page"),l=Ve(l,"d",Ke(JSON.stringify(r),i(this,bo)[bo])),i(this,xo)[xo].saveAndFireRequest(l,le.blockRequest),1===parseInt(r.pg)&&this.event.push(K,{t:4}),i(this,Io)[Io]=t,setTimeout((()=>{s<=3&&i(this,Mo)[Mo](),i(this,To)[To]()&&setInterval((()=>{i(this,Mo)[Mo]()}),3e5)}),12e4)}_isPersonalisationActive(){return ae._isLocalStorageSupported()&&this.enablePersonalization}set popupCallback(e){this.popupCallbacks[this.popupCurrentWzrkId]=e}sendLocationData(e){let t={af:{}};const o={};if(t.type="profile",null==o.tz&&(o.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),t.profile=o,e){Object.keys(e).forEach((i=>{t.af[i]=e[i]}))}le.location&&(t.af={...t.af,...le.location}),t=i(this,xo)[xo].addSystemDataToObject(t,!0),i(this,xo)[xo].addFlags(t);const n=Ke(JSON.stringify(t),i(this,bo)[bo]);let s=i(this,ko)[ko].dataPostURL;s=Ve(s,"type",A),s=Ve(s,"d",n),i(this,xo)[xo].saveAndFireRequest(s,le.blockRequest)}setOffline(e){"boolean"==typeof e?(le.offline=e,e||i(this,xo)[xo].processBackupEvents()):console.error("setOffline should be called with a value of type boolean")}defineVariable(e,t){return io.define(e,t,i(this,Po)[Po])}syncVariables(e,t){if(4===i(this,bo)[bo].logLevel)return i(this,Po)[Po].syncVariables(e,t);{const e="App log level is not set to 4";return i(this,bo)[bo].error(e),Promise.reject(new Error(e))}}fetchVariables(e){i(this,Po)[Po].fetchVariables(e)}addVariablesChangedCallback(e){i(this,Po)[Po].addVariablesChangedCallback(e)}addOneTimeVariablesChangedCallback(e){i(this,Po)[Po].addOneTimeVariablesChangedCallback(e)}}(window.clevertap);return window.clevertap=window.wizrocket=Uo,Uo})); diff --git a/src/clevertap.js b/src/clevertap.js index 396666a1..0e82bc2c 100644 --- a/src/clevertap.js +++ b/src/clevertap.js @@ -40,6 +40,8 @@ import NotificationHandler from './modules/notification' import { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper' import { Variable } from './modules/variables/variable' import VariableStore from './modules/variables/variableStore' +import { initialiseCTBuilder } from './modules/visualBuilder/pageBuilder' +// import { initialiseCTBuilder, renderVisualBuilder } from './modules/visualBuilder/pageBuilder' export default class CleverTap { #logger @@ -662,6 +664,20 @@ export default class CleverTap { } pageChanged () { + const search = window.location.search + if (search === '?ctBuilder') { + // open in visual builder mode + console.log('open in visual builder mode') + initialiseCTBuilder() + return + } + if (search === '?ctBuilderPreview') { + // open preview + console.log('open in visual builder mode') + // renderVisualBuilder(targetingMsgJson, true) + return + } + const currLocation = window.location.href const urlParams = getURLParams(currLocation.toLowerCase()) // -- update page count diff --git a/src/modules/visualBuilder/pageBuilder.js b/src/modules/visualBuilder/pageBuilder.js new file mode 100644 index 00000000..1d61c457 --- /dev/null +++ b/src/modules/visualBuilder/pageBuilder.js @@ -0,0 +1,144 @@ +export const initialiseCTBuilder = () => { +// const overlayPath = 'https://kkyusuftk-clevertap.s3.amazonaws.com/sampleIndex.js' + + // addOverlayScript(overlayPath).onload = async function () { + // try { + // const module = await import(overlayPath) + // const { default: isEven } = module + + // console.log(isEven(4)) + // console.log(isEven(5)) + // } catch (error) { + // console.error('Error fetching data:', error) + // } + // } + document.addEventListener('DOMContentLoaded', onContentLoad) +} + +let container + +function onContentLoad () { + document.body.innerHTML = '' + container = document.createElement('div') + container.id = 'app2' + container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form + container.style.display = 'flex' + document.body.appendChild(container) + const overlayPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js' + loadOverlayScript(overlayPath) + .then(() => { + console.log('Overlay script loaded successfully.') + }) + .catch((error) => { + console.error('Error loading overlay script:', error) + }) + loadCSS() + loadTypeKit() +} + +function loadCSS () { + var link = document.createElement('link') + link.rel = 'stylesheet' + link.type = 'text/css' + link.href = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css' + document.head.appendChild(link) +} + +function loadOverlayScript (overlayPath) { + return new Promise((resolve, reject) => { + var script = document.createElement('script') + script.type = 'module' + script.src = overlayPath + script.onload = function () { + if (typeof window.Overlay === 'function') { + window.Overlay('#app2', 'http://localhost:8080/randomPage') + resolve() + } else { + reject(new Error('ContentLayout not found in overlay.js')) + } + } + script.onerror = function (error) { + reject(error) + } + document.head.appendChild(script) + }) +} + +function loadTypeKit () { + var config = { + kitId: 'eqj6nom', + scriptTimeout: 3000, + async: true + } + + var d = document + var h = d.documentElement + var t = setTimeout(function () { + h.className = h.className.replace(/\bwf-loading\b/g, '') + ' wf-inactive' + // $(document).trigger("TypeKitReady"); + }, config.scriptTimeout) + var tk = d.createElement('script') + var f = false + var s = d.getElementsByTagName('script')[0] + var a + + h.className += ' wf-loading' + tk.src = 'https://use.typekit.net/' + config.kitId + '.js' + tk.async = true + tk.onload = tk.onreadystatechange = function () { + a = this.readyState + if (f || (a && a !== 'complete' && a !== 'loaded')) return + f = true + clearTimeout(t) + try { + // eslint-disable-next-line no-undef + Typekit.load(config) + } catch (e) {} + } + + s.parentNode.insertBefore(tk, s) +} + +export const renderVisualBuilder = (targetingMsgJson, isPreview) => { + const details = targetingMsgJson.display.details[0] + const siteUrl = Object.keys(details)[0] + const selectors = details[siteUrl] + + if (siteUrl === window.location.href) { + for (const selector in selectors) { + const element = document.querySelector(selector) + if (element) { + element.outerHTML = selectors[selector].html + if (!isPreview) { + window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot }) + } + } else { + let count = 0 + const intervalId = setInterval(() => { + const retryElement = document.querySelector(selector) + if (retryElement) { + retryElement.outerHTML = selectors[selector].html + if (!isPreview) { + window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot }) + } + clearInterval(intervalId) + } else { + count++ + if (count >= 20) { + console.log(`No element present on DOM with selector '${selector}'.`) + clearInterval(intervalId) + } + } + }, 500) + } + } + } +} +// function addOverlayScript (overlayPath) { +// const scriptTag = document.createElement('script') +// scriptTag.setAttribute('type', 'text/javascript') +// scriptTag.setAttribute('id', 'wzrk-alert-js') +// scriptTag.setAttribute('src', overlayPath) +// document.getElementsByTagName('body')[0].appendChild(scriptTag) +// return scriptTag +// } diff --git a/src/util/tr.js b/src/util/tr.js index 3ca27ff5..638e8b0a 100644 --- a/src/util/tr.js +++ b/src/util/tr.js @@ -34,6 +34,7 @@ import { CTWebPersonalisationBanner } from './web-personalisation/banner' import { CTWebPersonalisationCarousel } from './web-personalisation/carousel' import { CTWebPopupImageOnly } from './web-popupImageonly/popupImageonly' import { checkAndRegisterWebInboxElements, initializeWebInbox, processWebInboxSettings, hasWebInboxSettingsInLS, processInboxNotifs } from '../modules/web-inbox/helper' +import { renderVisualBuilder } from '../modules/visualBuilder/pageBuilder' const _tr = (msg, { device, @@ -47,6 +48,47 @@ const _tr = (msg, { const _logger = logger let _wizCounter = 0 + msg = { + arp: { + j_n: 'Zw==', + i_n: 'Y2NmewICAw==', + d_ts: 0, + dh: 0, + v: 1, + j_s: '{ }', + id: 'WWW-WWW-WWRZ', + e_ts: 0, + r_ts: 1649748826, + rc_w: 60, + rc_n: 5 + }, + inapp_notifs: [ + { + msgContent: { + templateType: 'point-and-click', + type: 4 + }, + display: { + divId: 'hero-banner', + details: [{ + 'http://localhost:3000/': { + '.heroDi1v': { + html: 'Hello Sonam' + }, + '#selector_2': { + html: '

Hello Sonam

' + } + } + }], + wtarget_type: 2, + wmc: 1, + ff: 'Desktop' + }, + wzrk_id: '1655316906_20220620', + wzrk_pivot: 'wzrk_default' + } + ] + } // Campaign House keeping const doCampHouseKeeping = (targetingMsgJson) => { const campaignId = targetingMsgJson.wzrk_id.split('_')[0] @@ -878,6 +920,38 @@ const _tr = (msg, { }) } + // const renderVisualBuilder = (targetingMsgJson) => { + // const details = targetingMsgJson.display.details[0] + // const siteUrl = Object.keys(details)[0] + // const selectors = details[siteUrl] + + // if (siteUrl === window.location.href) { + // for (const selector in selectors) { + // const element = document.querySelector(selector) + // if (element) { + // element.outerHTML = selectors[selector].html + // window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot }) + // } else { + // let count = 0 + // const intervalId = setInterval(() => { + // const retryElement = document.querySelector(selector) + // if (retryElement) { + // retryElement.outerHTML = selectors[selector].html + // window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot }) + // clearInterval(intervalId) + // } else { + // count++ + // if (count >= 20) { + // console.log(`No element present on DOM with selector '${selector}'.`) + // clearInterval(intervalId) + // } + // } + // }, 500) + // } + // } + // } + // } + if (msg.inapp_notifs != null) { const arrInAppNotifs = {} for (let index = 0; index < msg.inapp_notifs.length; index++) { @@ -895,6 +969,8 @@ const _tr = (msg, { } else { arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object } + } else if (targetNotif.msgContent.type === 4) { + renderVisualBuilder(targetNotif, false) } else { showFooterNotification(targetNotif) } From 0b9f200dbbf81e7d34c4adbca5bf712fd456151d Mon Sep 17 00:00:00 2001 From: KambleSonam Date: Wed, 8 May 2024 14:02:30 +0530 Subject: [PATCH 02/19] Added html builder logic --- src/clevertap.js | 13 ++- src/modules/visualBuilder/pageBuilder.js | 25 ++--- src/util/tr.js | 120 +++++++++-------------- 3 files changed, 65 insertions(+), 93 deletions(-) diff --git a/src/clevertap.js b/src/clevertap.js index 0e82bc2c..6bb6cb58 100644 --- a/src/clevertap.js +++ b/src/clevertap.js @@ -40,8 +40,8 @@ import NotificationHandler from './modules/notification' import { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper' import { Variable } from './modules/variables/variable' import VariableStore from './modules/variables/variableStore' -import { initialiseCTBuilder } from './modules/visualBuilder/pageBuilder' -// import { initialiseCTBuilder, renderVisualBuilder } from './modules/visualBuilder/pageBuilder' +// import { initialiseCTBuilder } from './modules/visualBuilder/pageBuilder' +import { initialiseCTBuilder, renderVisualBuilder } from './modules/visualBuilder/pageBuilder' export default class CleverTap { #logger @@ -672,9 +672,12 @@ export default class CleverTap { return } if (search === '?ctBuilderPreview') { - // open preview - console.log('open in visual builder mode') - // renderVisualBuilder(targetingMsgJson, true) + window.addEventListener('message', (event) => { + if (event.data && event.data.message && event.data.message === 'Overlay') { + renderVisualBuilder(event.data, true) + } + }, false) + window.postMessage('preview') return } diff --git a/src/modules/visualBuilder/pageBuilder.js b/src/modules/visualBuilder/pageBuilder.js index 1d61c457..3249701b 100644 --- a/src/modules/visualBuilder/pageBuilder.js +++ b/src/modules/visualBuilder/pageBuilder.js @@ -1,17 +1,4 @@ export const initialiseCTBuilder = () => { -// const overlayPath = 'https://kkyusuftk-clevertap.s3.amazonaws.com/sampleIndex.js' - - // addOverlayScript(overlayPath).onload = async function () { - // try { - // const module = await import(overlayPath) - // const { default: isEven } = module - - // console.log(isEven(4)) - // console.log(isEven(5)) - // } catch (error) { - // console.error('Error fetching data:', error) - // } - // } document.addEventListener('DOMContentLoaded', onContentLoad) } @@ -108,7 +95,11 @@ export const renderVisualBuilder = (targetingMsgJson, isPreview) => { for (const selector in selectors) { const element = document.querySelector(selector) if (element) { - element.outerHTML = selectors[selector].html + if (selectors[selector].html) { + element.outerHTML = selectors[selector].html + } else { + // Update json data + } if (!isPreview) { window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot }) } @@ -117,7 +108,11 @@ export const renderVisualBuilder = (targetingMsgJson, isPreview) => { const intervalId = setInterval(() => { const retryElement = document.querySelector(selector) if (retryElement) { - retryElement.outerHTML = selectors[selector].html + if (selectors[selector].html) { + retryElement.outerHTML = selectors[selector].html + } else { + // Update json data + } if (!isPreview) { window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot }) } diff --git a/src/util/tr.js b/src/util/tr.js index 638e8b0a..78acbf41 100644 --- a/src/util/tr.js +++ b/src/util/tr.js @@ -48,47 +48,53 @@ const _tr = (msg, { const _logger = logger let _wizCounter = 0 - msg = { - arp: { - j_n: 'Zw==', - i_n: 'Y2NmewICAw==', - d_ts: 0, - dh: 0, - v: 1, - j_s: '{ }', - id: 'WWW-WWW-WWRZ', - e_ts: 0, - r_ts: 1649748826, - rc_w: 60, - rc_n: 5 - }, - inapp_notifs: [ - { - msgContent: { - templateType: 'point-and-click', - type: 4 - }, - display: { - divId: 'hero-banner', - details: [{ - 'http://localhost:3000/': { - '.heroDi1v': { - html: 'Hello Sonam' - }, - '#selector_2': { - html: '

Hello Sonam

' - } - } - }], - wtarget_type: 2, - wmc: 1, - ff: 'Desktop' - }, - wzrk_id: '1655316906_20220620', - wzrk_pivot: 'wzrk_default' - } - ] - } + // msg = { + // arp: { + // j_n: 'Zw==', + // i_n: 'Y2NmewICAw==', + // d_ts: 0, + // dh: 0, + // v: 1, + // j_s: '{ }', + // id: 'WWW-WWW-WWRZ', + // e_ts: 0, + // r_ts: 1649748826, + // rc_w: 60, + // rc_n: 5 + // }, + // inapp_notifs: [ + // { + // msgContent: { + // templateType: 'point-and-click', + // type: 4 + // }, + // display: { + // divId: 'hero-banner', + // details: [{ + // 'http://localhost:3000/': { + // '.heroDi1v': { + // html: 'Hello Sonam' + // }, + // '#selector_2': { + // html: '

Hello Sonam

' + // }, + // '.heroDiv2': { + // json: { + // name: 'Sonam', + // identity: 1234 + // } + // } + // } + // }], + // wtarget_type: 2, + // wmc: 1, + // ff: 'Desktop' + // }, + // wzrk_id: '1655316906_20220620', + // wzrk_pivot: 'wzrk_default' + // } + // ] + // } // Campaign House keeping const doCampHouseKeeping = (targetingMsgJson) => { const campaignId = targetingMsgJson.wzrk_id.split('_')[0] @@ -920,38 +926,6 @@ const _tr = (msg, { }) } - // const renderVisualBuilder = (targetingMsgJson) => { - // const details = targetingMsgJson.display.details[0] - // const siteUrl = Object.keys(details)[0] - // const selectors = details[siteUrl] - - // if (siteUrl === window.location.href) { - // for (const selector in selectors) { - // const element = document.querySelector(selector) - // if (element) { - // element.outerHTML = selectors[selector].html - // window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot }) - // } else { - // let count = 0 - // const intervalId = setInterval(() => { - // const retryElement = document.querySelector(selector) - // if (retryElement) { - // retryElement.outerHTML = selectors[selector].html - // window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot }) - // clearInterval(intervalId) - // } else { - // count++ - // if (count >= 20) { - // console.log(`No element present on DOM with selector '${selector}'.`) - // clearInterval(intervalId) - // } - // } - // }, 500) - // } - // } - // } - // } - if (msg.inapp_notifs != null) { const arrInAppNotifs = {} for (let index = 0; index < msg.inapp_notifs.length; index++) { From f7f7ae0e95c2c2f28645dff5fbb388abfc1c10b6 Mon Sep 17 00:00:00 2001 From: KambleSonam Date: Thu, 9 May 2024 13:37:00 +0530 Subject: [PATCH 03/19] listener function update --- clevertap.js | 178 +++++++++++------------ clevertap.js.map | 2 +- clevertap.min.js | 2 +- src/clevertap.js | 19 ++- src/modules/visualBuilder/pageBuilder.js | 14 +- 5 files changed, 105 insertions(+), 110 deletions(-) diff --git a/clevertap.js b/clevertap.js index c75175c1..d991bbdd 100644 --- a/clevertap.js +++ b/clevertap.js @@ -4486,32 +4486,21 @@ const arrowSvg = "\n\n\n"; const greenTickSvg = "\n\n\n"; - const initialiseCTBuilder = () => { - // const overlayPath = 'https://kkyusuftk-clevertap.s3.amazonaws.com/sampleIndex.js' - // addOverlayScript(overlayPath).onload = async function () { - // try { - // const module = await import(overlayPath) - // const { default: isEven } = module - // console.log(isEven(4)) - // console.log(isEven(5)) - // } catch (error) { - // console.error('Error fetching data:', error) - // } - // } - document.addEventListener('DOMContentLoaded', onContentLoad); + const initialiseCTBuilder = (url, variant) => { + document.addEventListener('DOMContentLoaded', () => onContentLoad(url, variant)); }; let container; - function onContentLoad() { + function onContentLoad(url, variant) { document.body.innerHTML = ''; container = document.createElement('div'); - container.id = 'app2'; + container.id = 'overlayDiv'; container.style.position = 'relative'; // Ensure relative positioning for absolute positioning of form container.style.display = 'flex'; document.body.appendChild(container); const overlayPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js'; - loadOverlayScript(overlayPath).then(() => { + loadOverlayScript(overlayPath, url, variant).then(() => { console.log('Overlay script loaded successfully.'); }).catch(error => { console.error('Error loading overlay script:', error); @@ -4528,7 +4517,7 @@ document.head.appendChild(link); } - function loadOverlayScript(overlayPath) { + function loadOverlayScript(overlayPath, url, variant) { return new Promise((resolve, reject) => { var script = document.createElement('script'); script.type = 'module'; @@ -4536,7 +4525,7 @@ script.onload = function () { if (typeof window.Overlay === 'function') { - window.Overlay('#app2', 'http://localhost:8080/randomPage'); + window.Overlay('#overlayDiv', url, variant); resolve(); } else { reject(new Error('ContentLayout not found in overlay.js')); @@ -4595,7 +4584,9 @@ const element = document.querySelector(selector); if (element) { - element.outerHTML = selectors[selector].html; + if (selectors[selector].html) { + element.outerHTML = selectors[selector].html; + } if (!isPreview) { window.clevertap.renderNotificationViewed({ @@ -4609,7 +4600,9 @@ const retryElement = document.querySelector(selector); if (retryElement) { - retryElement.outerHTML = selectors[selector].html; + if (selectors[selector].html) { + retryElement.outerHTML = selectors[selector].html; + } if (!isPreview) { window.clevertap.renderNotificationViewed({ @@ -4651,46 +4644,54 @@ const _session = session; const _request = request; const _logger = logger; - let _wizCounter = 0; - msg = { - arp: { - j_n: 'Zw==', - i_n: 'Y2NmewICAw==', - d_ts: 0, - dh: 0, - v: 1, - j_s: '{ }', - id: 'WWW-WWW-WWRZ', - e_ts: 0, - r_ts: 1649748826, - rc_w: 60, - rc_n: 5 - }, - inapp_notifs: [{ - msgContent: { - templateType: 'point-and-click', - type: 4 - }, - display: { - divId: 'hero-banner', - details: [{ - 'http://localhost:3000/': { - '.heroDi1v': { - html: 'Hello Sonam' - }, - '#selector_2': { - html: '

Hello Sonam

' - } - } - }], - wtarget_type: 2, - wmc: 1, - ff: 'Desktop' - }, - wzrk_id: '1655316906_20220620', - wzrk_pivot: 'wzrk_default' - }] - }; // Campaign House keeping + let _wizCounter = 0; // msg = { + // arp: { + // j_n: 'Zw==', + // i_n: 'Y2NmewICAw==', + // d_ts: 0, + // dh: 0, + // v: 1, + // j_s: '{ }', + // id: 'WWW-WWW-WWRZ', + // e_ts: 0, + // r_ts: 1649748826, + // rc_w: 60, + // rc_n: 5 + // }, + // inapp_notifs: [ + // { + // msgContent: { + // templateType: 'point-and-click', + // type: 4 + // }, + // display: { + // divId: 'hero-banner', + // details: [{ + // 'http://localhost:3000/': { + // '.heroDi1v': { + // html: 'Hello Sonam' + // }, + // '#selector_2': { + // html: '

Hello Sonam

' + // }, + // '.heroDiv2': { + // json: { + // name: 'Sonam', + // identity: 1234 + // } + // } + // } + // }], + // wtarget_type: 2, + // wmc: 1, + // ff: 'Desktop' + // }, + // wzrk_id: '1655316906_20220620', + // wzrk_pivot: 'wzrk_default' + // } + // ] + // } + // Campaign House keeping const doCampHouseKeeping = targetingMsgJson => { const campaignId = targetingMsgJson.wzrk_id.split('_')[0]; @@ -5563,37 +5564,7 @@ }, 500); } }); - }; // const renderVisualBuilder = (targetingMsgJson) => { - // const details = targetingMsgJson.display.details[0] - // const siteUrl = Object.keys(details)[0] - // const selectors = details[siteUrl] - // if (siteUrl === window.location.href) { - // for (const selector in selectors) { - // const element = document.querySelector(selector) - // if (element) { - // element.outerHTML = selectors[selector].html - // window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot }) - // } else { - // let count = 0 - // const intervalId = setInterval(() => { - // const retryElement = document.querySelector(selector) - // if (retryElement) { - // retryElement.outerHTML = selectors[selector].html - // window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot }) - // clearInterval(intervalId) - // } else { - // count++ - // if (count >= 20) { - // console.log(`No element present on DOM with selector '${selector}'.`) - // clearInterval(intervalId) - // } - // } - // }, 500) - // } - // } - // } - // } - + }; if (msg.inapp_notifs != null) { const arrInAppNotifs = {}; @@ -7417,6 +7388,8 @@ var _checkPageChanged = _classPrivateFieldLooseKey("checkPageChanged"); + var _handleMessageEvent = _classPrivateFieldLooseKey("handleMessageEvent"); + var _pingRequest = _classPrivateFieldLooseKey("pingRequest"); var _isPingContinuous = _classPrivateFieldLooseKey("isPingContinuous"); @@ -7466,6 +7439,9 @@ Object.defineProperty(this, _pingRequest, { value: _pingRequest2 }); + Object.defineProperty(this, _handleMessageEvent, { + value: _handleMessageEvent2 + }); Object.defineProperty(this, _checkPageChanged, { value: _checkPageChanged2 }); @@ -8185,14 +8161,14 @@ if (search === '?ctBuilder') { // open in visual builder mode console.log('open in visual builder mode'); - initialiseCTBuilder(); + window.addEventListener('message', _classPrivateFieldLooseBase(this, _handleMessageEvent)[_handleMessageEvent], false); + window.postMessage('builder'); return; } if (search === '?ctBuilderPreview') { - // open preview - console.log('open in visual builder mode'); // renderVisualBuilder(targetingMsgJson, true) - + window.addEventListener('message', _classPrivateFieldLooseBase(this, _handleMessageEvent)[_handleMessageEvent], false); + window.postMessage('preview'); return; } @@ -8424,6 +8400,18 @@ debouncedPageChanged(); }; + var _handleMessageEvent2 = function _handleMessageEvent2(event) { + if (event.data && event.data.message) { + if (event.data.message === 'Dashboard' && event.data.url) { + var _event$data$variant; + + initialiseCTBuilder(event.data.url, (_event$data$variant = event.data.variant) !== null && _event$data$variant !== void 0 ? _event$data$variant : null); + } else if (event.data.message === 'Overlay') { + renderVisualBuilder(event.data, true); + } + } + }; + var _pingRequest2 = function _pingRequest2() { let pageLoadUrl = _classPrivateFieldLooseBase(this, _account$6)[_account$6].dataPostURL; diff --git a/clevertap.js.map b/clevertap.js.map index 0ff73091..c2c7bd5f 100644 --- a/clevertap.js.map +++ b/clevertap.js.map @@ -1 +1 @@ -{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/modules/visualBuilder/pageBuilder.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/notification.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {}\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n // Initialize array\n var array = []\n\n // Check if globalProfileMap is null, initialize if needed\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n // Check if the value to be set is either string or number\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = $ct.globalProfileMap[propKey]\n array.push(typeof propVal === 'number' ? propVal : propVal.toLowerCase())\n } else {\n $ct.globalProfileMap[propKey] = propVal\n }\n } else {\n // Check if propVal is an array\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = Array.isArray($ct.globalProfileMap[propKey]) ? $ct.globalProfileMap[propKey] : [$ct.globalProfileMap[propKey]]\n }\n\n // Check for case-sensitive inputs and filter the same ones\n for (var i = 0; i < propVal.length; i++) {\n if (typeof propVal[i] === 'number' && !array.includes(propVal[i])) {\n array.push(propVal[i])\n } else if (typeof propVal[i] === 'string' && !array.includes(propVal[i].toLowerCase())) {\n array.push(propVal[i].toLowerCase())\n } else if ((typeof propVal[i] === 'number' && array.includes(propVal[i])) || (typeof propVal[i] === 'string' && array.includes(propVal[i].toLowerCase()))) {\n console.error('Values already included')\n } else {\n console.error('Array supports only string or number type values')\n }\n }\n\n // Update globalProfileMap with the array\n $ct.globalProfileMap[propKey] = array\n }\n\n // Save to local storage or cookie\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Call the sendMultiValueData function\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n var index = $ct.globalProfileMap[propKey].indexOf(propVal)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n } else {\n for (var k = 0; k < propVal.length; k++) {\n var idx = $ct.globalProfileMap[propKey].indexOf(propVal[k])\n if (idx !== -1) {\n $ct.globalProfileMap[propKey].splice(idx, 1)\n }\n }\n }\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n // console.log('Raise notification clicked event for ', item)\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","export const initialiseCTBuilder = () => {\n// const overlayPath = 'https://kkyusuftk-clevertap.s3.amazonaws.com/sampleIndex.js'\n\n // addOverlayScript(overlayPath).onload = async function () {\n // try {\n // const module = await import(overlayPath)\n // const { default: isEven } = module\n\n // console.log(isEven(4))\n // console.log(isEven(5))\n // } catch (error) {\n // console.error('Error fetching data:', error)\n // }\n // }\n document.addEventListener('DOMContentLoaded', onContentLoad)\n}\n\nlet container\n\nfunction onContentLoad () {\n document.body.innerHTML = ''\n container = document.createElement('div')\n container.id = 'app2'\n container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form\n container.style.display = 'flex'\n document.body.appendChild(container)\n const overlayPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js'\n loadOverlayScript(overlayPath)\n .then(() => {\n console.log('Overlay script loaded successfully.')\n })\n .catch((error) => {\n console.error('Error loading overlay script:', error)\n })\n loadCSS()\n loadTypeKit()\n}\n\nfunction loadCSS () {\n var link = document.createElement('link')\n link.rel = 'stylesheet'\n link.type = 'text/css'\n link.href = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css'\n document.head.appendChild(link)\n}\n\nfunction loadOverlayScript (overlayPath) {\n return new Promise((resolve, reject) => {\n var script = document.createElement('script')\n script.type = 'module'\n script.src = overlayPath\n script.onload = function () {\n if (typeof window.Overlay === 'function') {\n window.Overlay('#app2', 'http://localhost:8080/randomPage')\n resolve()\n } else {\n reject(new Error('ContentLayout not found in overlay.js'))\n }\n }\n script.onerror = function (error) {\n reject(error)\n }\n document.head.appendChild(script)\n })\n}\n\nfunction loadTypeKit () {\n var config = {\n kitId: 'eqj6nom',\n scriptTimeout: 3000,\n async: true\n }\n\n var d = document\n var h = d.documentElement\n var t = setTimeout(function () {\n h.className = h.className.replace(/\\bwf-loading\\b/g, '') + ' wf-inactive'\n // $(document).trigger(\"TypeKitReady\");\n }, config.scriptTimeout)\n var tk = d.createElement('script')\n var f = false\n var s = d.getElementsByTagName('script')[0]\n var a\n\n h.className += ' wf-loading'\n tk.src = 'https://use.typekit.net/' + config.kitId + '.js'\n tk.async = true\n tk.onload = tk.onreadystatechange = function () {\n a = this.readyState\n if (f || (a && a !== 'complete' && a !== 'loaded')) return\n f = true\n clearTimeout(t)\n try {\n // eslint-disable-next-line no-undef\n Typekit.load(config)\n } catch (e) {}\n }\n\n s.parentNode.insertBefore(tk, s)\n}\n\nexport const renderVisualBuilder = (targetingMsgJson, isPreview) => {\n const details = targetingMsgJson.display.details[0]\n const siteUrl = Object.keys(details)[0]\n const selectors = details[siteUrl]\n\n if (siteUrl === window.location.href) {\n for (const selector in selectors) {\n const element = document.querySelector(selector)\n if (element) {\n element.outerHTML = selectors[selector].html\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n } else {\n let count = 0\n const intervalId = setInterval(() => {\n const retryElement = document.querySelector(selector)\n if (retryElement) {\n retryElement.outerHTML = selectors[selector].html\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n clearInterval(intervalId)\n } else {\n count++\n if (count >= 20) {\n console.log(`No element present on DOM with selector '${selector}'.`)\n clearInterval(intervalId)\n }\n }\n }, 500)\n }\n }\n }\n}\n// function addOverlayScript (overlayPath) {\n// const scriptTag = document.createElement('script')\n// scriptTag.setAttribute('type', 'text/javascript')\n// scriptTag.setAttribute('id', 'wzrk-alert-js')\n// scriptTag.setAttribute('src', overlayPath)\n// document.getElementsByTagName('body')[0].appendChild(scriptTag)\n// return scriptTag\n// }\n","import {\n addToLocalProfileMap,\n arp,\n getCampaignObject,\n saveCampaignObject,\n closeIframe\n} from './clevertap'\n\nimport {\n CAMP_COOKIE_NAME,\n DISPLAY,\n GLOBAL,\n EV_COOKIE,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n WZRK_PREFIX,\n WZRK_ID,\n CAMP_COOKIE_G,\n GCOOKIE_NAME\n} from './constants'\n\nimport {\n getNow,\n getToday\n} from './datetime'\n\nimport {\n compressToBase64\n} from './encoder'\n\nimport { StorageManager, $ct } from './storage'\nimport RequestDispatcher from './requestDispatcher'\nimport { CTWebPersonalisationBanner } from './web-personalisation/banner'\nimport { CTWebPersonalisationCarousel } from './web-personalisation/carousel'\nimport { CTWebPopupImageOnly } from './web-popupImageonly/popupImageonly'\nimport { checkAndRegisterWebInboxElements, initializeWebInbox, processWebInboxSettings, hasWebInboxSettingsInLS, processInboxNotifs } from '../modules/web-inbox/helper'\nimport { renderVisualBuilder } from '../modules/visualBuilder/pageBuilder'\n\nconst _tr = (msg, {\n device,\n session,\n request,\n logger\n}) => {\n const _device = device\n const _session = session\n const _request = request\n const _logger = logger\n let _wizCounter = 0\n\n msg = {\n arp: {\n j_n: 'Zw==',\n i_n: 'Y2NmewICAw==',\n d_ts: 0,\n dh: 0,\n v: 1,\n j_s: '{ }',\n id: 'WWW-WWW-WWRZ',\n e_ts: 0,\n r_ts: 1649748826,\n rc_w: 60,\n rc_n: 5\n },\n inapp_notifs: [\n {\n msgContent: {\n templateType: 'point-and-click',\n type: 4\n },\n display: {\n divId: 'hero-banner',\n details: [{\n 'http://localhost:3000/': {\n '.heroDi1v': {\n html: 'Hello Sonam'\n },\n '#selector_2': {\n html: '

Hello Sonam

'\n }\n }\n }],\n wtarget_type: 2,\n wmc: 1,\n ff: 'Desktop'\n },\n wzrk_id: '1655316906_20220620',\n wzrk_pivot: 'wzrk_default'\n }\n ]\n }\n // Campaign House keeping\n const doCampHouseKeeping = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const today = getToday()\n\n const incrCount = (obj, campaignId, excludeFromFreqCaps) => {\n let currentCount = 0\n let totalCount = 0\n if (obj[campaignId] != null) {\n currentCount = obj[campaignId]\n }\n currentCount++\n if (obj.tc != null) {\n totalCount = obj.tc\n }\n // if exclude from caps then dont add to total counts\n if (excludeFromFreqCaps < 0) {\n totalCount++\n }\n\n obj.tc = totalCount\n obj[campaignId] = currentCount\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n delete sessionStorage[CAMP_COOKIE_NAME]\n var campTypeObj = {}\n const campObj = getCampaignObject()\n if (targetingMsgJson.display.wtarget_type === 3 && campObj.hasOwnProperty('wi')) {\n campTypeObj = campObj.wi\n } else if ((targetingMsgJson.display.wtarget_type === 0 || targetingMsgJson.display.wtarget_type === 1) && campObj.hasOwnProperty('wp')) {\n campTypeObj = campObj.wp\n } else {\n campTypeObj = {}\n }\n if (campObj.hasOwnProperty('global')) {\n campTypeObj.wp = campObj\n }\n // global session limit. default is 1\n if (targetingMsgJson[DISPLAY].wmc == null) {\n targetingMsgJson[DISPLAY].wmc = 1\n }\n\n // global session limit for web inbox. default is 1\n if (targetingMsgJson[DISPLAY].wimc == null) {\n targetingMsgJson[DISPLAY].wimc = 1\n }\n\n var excludeFromFreqCaps = -1 // efc - Exclude from frequency caps\n let campaignSessionLimit = -1 // mdc - Once per session\n let campaignDailyLimit = -1 // tdc - Once per day\n let campaignTotalLimit = -1 // tlc - Once per user for the duration of campaign\n let totalDailyLimit = -1\n let totalSessionLimit = -1 // wmc - Web Popup Global Session Limit\n let totalInboxSessionLimit = -1 // wimc - Web Inbox Global Session Limit\n\n if (targetingMsgJson[DISPLAY].efc != null) { // exclude from frequency cap\n excludeFromFreqCaps = parseInt(targetingMsgJson[DISPLAY].efc, 10)\n }\n if (targetingMsgJson[DISPLAY].mdc != null) { // Campaign Session Limit\n campaignSessionLimit = parseInt(targetingMsgJson[DISPLAY].mdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tdc != null) { // No of web popups in a day per campaign\n campaignDailyLimit = parseInt(targetingMsgJson[DISPLAY].tdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tlc != null) { // Total lifetime count\n campaignTotalLimit = parseInt(targetingMsgJson[DISPLAY].tlc, 10)\n }\n if (targetingMsgJson[DISPLAY].wmp != null) { // No of campaigns per day\n totalDailyLimit = parseInt(targetingMsgJson[DISPLAY].wmp, 10)\n }\n if (targetingMsgJson[DISPLAY].wmc != null) { // No of campaigns per session\n totalSessionLimit = parseInt(targetingMsgJson[DISPLAY].wmc, 10)\n }\n\n if (targetingMsgJson[DISPLAY].wimc != null) { // No of inbox campaigns per session\n totalInboxSessionLimit = parseInt(targetingMsgJson[DISPLAY].wimc, 10)\n }\n // session level capping\n var sessionObj = campTypeObj[_session.sessionId]\n if (sessionObj) {\n const campaignSessionCount = sessionObj[campaignId]\n const totalSessionCount = sessionObj.tc\n // dnd\n if (campaignSessionCount === 'dnd' && !$ct.dismissSpamControl) {\n return false\n }\n\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n // Inbox session\n if (totalInboxSessionLimit > 0 && totalSessionCount >= totalInboxSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n } else {\n // session\n if (totalSessionLimit > 0 && totalSessionCount >= totalSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n }\n\n // campaign session\n if (campaignSessionLimit > 0 && campaignSessionCount >= campaignSessionLimit) {\n return false\n }\n } else {\n sessionObj = {}\n campTypeObj[_session.sessionId] = sessionObj\n }\n\n // daily level capping\n var dailyObj = campTypeObj[today]\n if (dailyObj != null) {\n const campaignDailyCount = dailyObj[campaignId]\n const totalDailyCount = dailyObj.tc\n // daily\n if (totalDailyLimit > 0 && totalDailyCount >= totalDailyLimit && excludeFromFreqCaps < 0) {\n return false\n }\n // campaign daily\n if (campaignDailyLimit > 0 && campaignDailyCount >= campaignDailyLimit) {\n return false\n }\n } else {\n dailyObj = {}\n campTypeObj[today] = dailyObj\n }\n\n var globalObj = campTypeObj[GLOBAL]\n if (globalObj != null) {\n const campaignTotalCount = globalObj[campaignId]\n // campaign total\n if (campaignTotalLimit > 0 && campaignTotalCount >= campaignTotalLimit) {\n return false\n }\n } else {\n globalObj = {}\n campTypeObj[GLOBAL] = globalObj\n }\n }\n // delay\n if (targetingMsgJson[DISPLAY].delay != null && targetingMsgJson[DISPLAY].delay > 0) {\n const delay = targetingMsgJson[DISPLAY].delay\n targetingMsgJson[DISPLAY].delay = 0\n setTimeout(_tr, delay * 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n return false\n }\n\n incrCount(sessionObj, campaignId, excludeFromFreqCaps)\n incrCount(dailyObj, campaignId, excludeFromFreqCaps)\n incrCount(globalObj, campaignId, excludeFromFreqCaps)\n\n let campKey = 'wp'\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n campKey = 'wi'\n }\n // get ride of stale sessions and day entries\n const newCampObj = {}\n newCampObj[_session.sessionId] = sessionObj\n newCampObj[today] = dailyObj\n newCampObj[GLOBAL] = globalObj\n saveCampaignObject({ [campKey]: newCampObj })\n }\n\n const getCookieParams = () => {\n const gcookie = _device.getGuid()\n const scookieObj = _session.getSessionCookieObject()\n return '&t=wc&d=' + encodeURIComponent(compressToBase64(gcookie + '|' + scookieObj.p + '|' + scookieObj.s))\n }\n\n const setupClickEvent = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n if (onClick !== '' && onClick != null) {\n let ctaElement\n let jsCTAElements\n if (isLegacy) {\n ctaElement = contentDiv\n } else if (contentDiv !== null) {\n jsCTAElements = contentDiv.getElementsByClassName('jsCT_CTA')\n if (jsCTAElements != null && jsCTAElements.length === 1) {\n ctaElement = jsCTAElements[0]\n }\n }\n const jsFunc = targetingMsgJson.display.jsFunc\n const isPreview = targetingMsgJson.display.preview\n if (isPreview == null) {\n onClick += getCookieParams()\n }\n\n if (ctaElement != null) {\n ctaElement.onclick = () => {\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n if (isPreview == null) {\n RequestDispatcher.fireRequest(onClick)\n }\n invokeExternalJs(jsFunc, targetingMsgJson)\n // close iframe. using -1 for no campaignId\n closeIframe('-1', divId, _session.sessionId)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n }\n }\n\n const invokeExternalJs = (jsFunc, targetingMsgJson) => {\n const func = window.parent[jsFunc]\n if (typeof func === 'function') {\n if (targetingMsgJson.display.kv != null) {\n func(targetingMsgJson.display.kv)\n } else {\n func()\n }\n }\n }\n\n const setupClickUrl = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n incrementImpression(targetingMsgJson)\n setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy)\n }\n\n const incrementImpression = (targetingMsgJson) => {\n const data = {}\n data.type = 'event'\n data.evtName = NOTIFICATION_VIEWED\n data.evtData = { [WZRK_ID]: targetingMsgJson.wzrk_id }\n if (targetingMsgJson.wzrk_pivot) {\n data.evtData = { ...data.evtData, wzrk_pivot: targetingMsgJson.wzrk_pivot }\n }\n _request.processEvent(data)\n }\n\n const renderPersonalisationBanner = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const bannerEl = document.createElement('ct-web-personalisation-banner')\n bannerEl.msgId = targetingMsgJson.wzrk_id\n bannerEl.pivotId = targetingMsgJson.wzrk_pivot\n bannerEl.divHeight = targetingMsgJson.display.divHeight\n bannerEl.details = targetingMsgJson.display.details[0]\n const containerEl = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n containerEl.innerHTML = ''\n containerEl.appendChild(bannerEl)\n }\n\n const renderPersonalisationCarousel = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-carousel') === undefined) {\n customElements.define('ct-web-personalisation-carousel', CTWebPersonalisationCarousel)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const carousel = document.createElement('ct-web-personalisation-carousel')\n carousel.target = targetingMsgJson\n const container = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n container.innerHTML = ''\n container.appendChild(carousel)\n }\n\n const renderPopUpImageOnly = (targetingMsgJson) => {\n const divId = 'wzrkImageOnlyDiv'\n const popupImageOnly = document.createElement('ct-web-popup-imageonly')\n popupImageOnly.session = _session\n popupImageOnly.target = targetingMsgJson\n const containerEl = document.getElementById(divId)\n containerEl.innerHTML = ''\n containerEl.style.visibility = 'hidden'\n containerEl.appendChild(popupImageOnly)\n }\n\n const renderFooterNotification = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const displayObj = targetingMsgJson.display\n\n if (displayObj.wtarget_type === 2) { // Handling Web Native display\n // Logic for kv pair data\n if (targetingMsgJson.msgContent.type === 1) {\n const inaObj = {}\n\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.msgContent.kv != null) {\n inaObj.kv = targetingMsgJson.msgContent.kv\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n return\n }\n }\n if (displayObj.layout === 1) { // Handling Web Exit Intent\n return showExitIntent(undefined, targetingMsgJson)\n }\n if (displayObj.layout === 3) { // Handling Web Popup Image Only\n const divId = 'wzrkImageOnlyDiv'\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById(divId) != null || document.getElementById('intentPreview') != null) {\n return\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n document.body.appendChild(msgDiv)\n if (customElements.get('ct-web-popup-imageonly') === undefined) {\n customElements.define('ct-web-popup-imageonly', CTWebPopupImageOnly)\n }\n return renderPopUpImageOnly(targetingMsgJson)\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const divId = 'wizParDiv' + displayObj.layout\n\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n if (document.getElementById(divId) != null) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = divId\n const isBanner = displayObj.layout === 2\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n const viewHeight = window.innerHeight\n const viewWidth = window.innerWidth\n let legacy = false\n\n if (!isBanner) {\n const marginBottom = viewHeight * 5 / 100\n var contentHeight = 10\n let right = viewWidth * 5 / 100\n let bottomPosition = contentHeight + marginBottom\n let width = viewWidth * 30 / 100 + 20\n let widthPerct = 'width:30%;'\n // for small devices - mobile phones\n if ((/mobile/i.test(navigator.userAgent) || (/mini/i.test(navigator.userAgent))) && /iPad/i.test(navigator.userAgent) === false) {\n width = viewWidth * 85 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:80%;'\n // medium devices - tablets\n } else if ('ontouchstart' in window || (/tablet/i.test(navigator.userAgent))) {\n width = viewWidth * 50 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:50%;'\n }\n // legacy footer notif\n if (displayObj.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden; bottom:' + bottomPosition + 'px !important;width:' + width + 'px !important;right:' + right + 'px !important;position:fixed;z-index:2147483647;')\n } else {\n msgDiv.setAttribute('style', widthPerct + displayObj.iFrameStyle)\n }\n } else {\n msgDiv.setAttribute('style', displayObj.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n\n const borderRadius = displayObj.br === false ? '0' : '8'\n\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, leftTd, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n leftTd = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n leftTd = '#f4f4f4'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"\"\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'\" + divId + \"');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"\" +\n // \"\"+\n '' + imageTd + \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
'\n html = css + title + body\n }\n\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n const ifrm = (iframe.contentWindow) ? iframe.contentWindow : (iframe.contentDocument.document) ? iframe.contentDocument.document : iframe.contentDocument\n const doc = ifrm.document\n\n // Dispatch event for popup box/banner close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n doc.open()\n doc.write(html)\n\n if (displayObj['custom-editor']) {\n appendScriptForCustomEvent(targetingMsgJson, doc)\n }\n doc.close()\n\n const adjustIFrameHeight = () => {\n // adjust iframe and body height of html inside correctly\n contentHeight = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv').scrollHeight\n if (displayObj['custom-editor'] !== true && !isBanner) {\n contentHeight += 25\n }\n document.getElementById('wiz-iframe').contentDocument.body.style.margin = '0px'\n document.getElementById('wiz-iframe').style.height = contentHeight + 'px'\n }\n\n const ua = navigator.userAgent.toLowerCase()\n if (ua.indexOf('safari') !== -1) {\n if (ua.indexOf('chrome') > -1) {\n iframe.onload = () => {\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n } else {\n let inDoc = iframe.contentDocument || iframe.contentWindow\n if (inDoc.document) inDoc = inDoc.document\n // safari iphone 7+ needs this.\n adjustIFrameHeight()\n const _timer = setInterval(() => {\n if (inDoc.readyState === 'complete') {\n clearInterval(_timer)\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }, 10)\n }\n } else {\n iframe.onload = () => {\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }\n }\n\n const appendScriptForCustomEvent = (targetingMsgJson, doc) => {\n const script = doc.createElement('script')\n script.innerHTML = `\n const ct__camapignId = '${targetingMsgJson.wzrk_id}';\n const ct__formatVal = (v) => {\n return v && v.trim().substring(0, 20);\n }\n const ct__parentOrigin = window.parent.origin;\n document.body.addEventListener('click', (event) => {\n const elem = event.target.closest?.('a[wzrk_c2a], button[wzrk_c2a]');\n if (elem) {\n const {innerText, id, name, value, href} = elem;\n const clickAttr = elem.getAttribute('onclick') || elem.getAttribute('click');\n const onclickURL = clickAttr?.match(/(window.open)[(\\](\\\"|')(.*)(\\\"|',)/)?.[3] || clickAttr?.match(/(location.href *= *)(\\\"|')(.*)(\\\"|')/)?.[3];\n const props = {innerText, id, name, value};\n let msgCTkv = Object.keys(props).reduce((acc, c) => {\n const formattedVal = ct__formatVal(props[c]);\n formattedVal && (acc['wzrk_click_' + c] = formattedVal);\n return acc;\n }, {});\n if(onclickURL) { msgCTkv['wzrk_click_' + 'url'] = onclickURL; }\n if(href) { msgCTkv['wzrk_click_' + 'c2a'] = href; }\n const notifData = { msgId: ct__camapignId, msgCTkv, pivotId: '${targetingMsgJson.wzrk_pivot}' };\n window.parent.clevertap.renderNotificationClicked(notifData);\n }\n });\n `\n doc.body.appendChild(script)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe-intent'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n const ifrm = (iframe.contentWindow) ? iframe.contentWindow : (iframe.contentDocument.document) ? iframe.contentDocument.document : iframe.contentDocument\n const doc = ifrm.document\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n doc.open()\n doc.write(html)\n if (targetingMsgJson.display['custom-editor']) {\n appendScriptForCustomEvent(targetingMsgJson, doc)\n }\n doc.close()\n\n const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n // const renderVisualBuilder = (targetingMsgJson) => {\n // const details = targetingMsgJson.display.details[0]\n // const siteUrl = Object.keys(details)[0]\n // const selectors = details[siteUrl]\n\n // if (siteUrl === window.location.href) {\n // for (const selector in selectors) {\n // const element = document.querySelector(selector)\n // if (element) {\n // element.outerHTML = selectors[selector].html\n // window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n // } else {\n // let count = 0\n // const intervalId = setInterval(() => {\n // const retryElement = document.querySelector(selector)\n // if (retryElement) {\n // retryElement.outerHTML = selectors[selector].html\n // window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n // clearInterval(intervalId)\n // } else {\n // count++\n // if (count >= 20) {\n // console.log(`No element present on DOM with selector '${selector}'.`)\n // clearInterval(intervalId)\n // }\n // }\n // }, 500)\n // }\n // }\n // }\n // }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n this.#logger.error('Error subscribing: ' + error)\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { initialiseCTBuilder } from './modules/visualBuilder/pageBuilder'\n// import { initialiseCTBuilder, renderVisualBuilder } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token) {\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n pageChanged () {\n const search = window.location.search\n if (search === '?ctBuilder') {\n // open in visual builder mode\n console.log('open in visual builder mode')\n initialiseCTBuilder()\n return\n }\n if (search === '?ctBuilderPreview') {\n // open preview\n console.log('open in visual builder mode')\n // renderVisualBuilder(targetingMsgJson, true)\n return\n }\n\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","constructor","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","dataPostPEURL","dataPostURL","recorderURL","emailURL","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","save","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","read","data","getItem","parse","e","remove","removeItem","removeCookie","name","domain","cookieStr","document","cookie","createCookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","readCookie","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","saveToLSorCookie","property","location","hostname","$ct","globalCache","readFromLSorCookie","trim","err","createBroadCookie","broadDomain","domainParts","testBroadDomain","testCookieName","tempCookie","getMetaProp","metaObj","setMetaProp","wzrkMetaObj","getAndClearMetaProp","setInstantDeleteFlagInK","k","flag","backupEvent","reqNo","backupArr","q","debug","removeBackup","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","get","item","saveCacheToLS","set","allKeys","objToArray","index","temp","getKey","getSecondLastKey","keysArr","getLastKey","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","s","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","sessionObj","getSessionCookieObject","kIdFromLS","guidFromLRUCache","lastK","lastGUID","unregisterTokenForGuid","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","_processOldValues","getDetails","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","fireRequest","skipARP","sendOULFlag","getDelayFrequency","account","randomDelay","random","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","ProfileHandler","profilesArr","getAttribute","propName","_handleIncrementDecrementValue","command","tz","profile","addSystemDataToObject","addFlags","compressedData","saveAndFireRequest","_handleMultiValueSet","arrayVal","array","toLowerCase","sendMultiValueData","_handleMultiValueAdd","propKey","propVal","_handleMultiValueRemove","_handleMultiValueDelete","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","clear","addToK","ids","g","kId","anonymousUser","foundInCache","gFromCache","Identity","cookieName","loginArr","pop","processProfile","CTWebPersonalisationBanner","HTMLElement","_details","shadow","attachShadow","mode","details","renderBanner","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","target","renderCarousel","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","button","setInterval","sliderTime","goTo","prev","cur","CTWebPopupImageOnly","_session","popup","container","resizeObserver","renderImageOnlyPopup","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","Message","config","message","wrapper","snackBar","renderMessage","createEl","part","_el","msg","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","raiseClickedEvent","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","contains","setBadgeStyle","msgCount","incomingMessages","msgs","updateInboxMessages","incomingMessagesForPreview","previewMsgs","now","buildUIForMessages","updateUnviewedBadgeCounter","connectedCallback","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","addMsgsToInboxFromLS","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","deleteMsgsFromUI","getInboxMessages","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","top","right","getBoundingClientRect","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","inbox_notifs","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","initialiseCTBuilder","onContentLoad","position","overlayPath","loadOverlayScript","then","catch","loadCSS","loadTypeKit","link","rel","head","script","src","onload","Overlay","Error","onerror","kitId","scriptTimeout","h","documentElement","className","tk","onreadystatechange","Typekit","load","renderVisualBuilder","targetingMsgJson","siteUrl","selectors","selector","element","querySelector","outerHTML","intervalId","retryElement","_tr","_device","_request","_logger","_wizCounter","j_n","i_n","d_ts","dh","j_s","e_ts","r_ts","rc_w","rc_n","inapp_notifs","wtarget_type","wmc","ff","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","onclick","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","inaObj","kvPairsEvent","CustomEvent","dispatchEvent","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","pointerCss","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","ifrm","contentWindow","contentDocument","doc","closeCampaign","Event","write","appendScriptForCustomEvent","close","adjustIFrameHeight","scrollHeight","margin","ua","inDoc","_timer","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","getTotalVisits","visitCount","getLastVisit","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","info","debugPE","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","getTimeElapsed","sessionStart","getPageCount","seqNo","requestTime","RequestManager","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","post","fetch","method","headers","response","ok","json","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","_enableWebPush","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","skipDialog","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","getValue","getdefaultValue","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","addValueChangedCallback","removeValueChangedCallback","clearStartFlag","VariableStore","syncVariables","onSyncSuccess","onSyncFailure","meta","r","status","fetchVariables","onFetchCallback","addVariablesChangedCallback","callback","addOneTimeVariablesChangedCallback","removeVariablesChangedCallback","removeOneTimeVariablesChangedCallback","callBack","CleverTap","spa","isSpa","bind","enablePersonalization","_isPersonalisationActive","ReqestManager","onUserLogin","privacy","notifications","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","handleDecrementValue","setMultiValuesForKey","addMultiValueForKey","addMultiValuesForKey","removeMultiValueForKey","removeMultiValuesForKey","removeValueForKey","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","sendLocationData","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","elements","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","setOffline","arg","defineVariable","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;EAAO,MAAMA,aAAa,GAAG,oBAAtB;EACA,MAAMC,eAAe,GAAG,QAAxB;EACA,MAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;ECAQ,MAAMC,OAAN,CAAc;EAO3BC,EAAAA,WAAW,GAAsE;EAAA,QAApE;EAAEC,MAAAA;EAAF,KAAoE,uEAA3D,EAA2D;EAAA,QAAvDC,MAAuD,uEAA9C,EAA8C;EAAA,QAA1CC,YAA0C,uEAA3BP,aAA2B;EAAA,QAAZQ,KAAY,uEAAJ,EAAI;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,aALvE;EAKuE;EAAA;EAAA;EAAA,aAJjER;EAIiE;EAAA;EAAA;EAAA,aAHjE;EAGiE;EAAA;EAAA;EAAA,aAFxE;EAEwE;EAC/E,SAAKK,EAAL,GAAUA,EAAV;;EACA,QAAIC,MAAJ,EAAY;EACV,WAAKA,MAAL,GAAcA,MAAd;EACD;;EACD,QAAIC,YAAJ,EAAkB;EAChB,WAAKA,YAAL,GAAoBA,YAApB;EACD;;EACD,QAAIC,KAAJ,EAAW;EACT,WAAKA,KAAL,GAAaA,KAAb;EACD;EACF;;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KAAL,GAAa,IAAb;EACD;EACF;;QC5wBG9uB,SAAS,GAAG,IAAIi9B,SAAJ,CAAc/qC,MAAM,CAAC8N,SAArB;EAElB9N,MAAM,CAAC8N,SAAP,GAAmB9N,MAAM,CAAC+N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/modules/visualBuilder/pageBuilder.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/notification.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {}\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n // Initialize array\n var array = []\n\n // Check if globalProfileMap is null, initialize if needed\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n // Check if the value to be set is either string or number\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = $ct.globalProfileMap[propKey]\n array.push(typeof propVal === 'number' ? propVal : propVal.toLowerCase())\n } else {\n $ct.globalProfileMap[propKey] = propVal\n }\n } else {\n // Check if propVal is an array\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = Array.isArray($ct.globalProfileMap[propKey]) ? $ct.globalProfileMap[propKey] : [$ct.globalProfileMap[propKey]]\n }\n\n // Check for case-sensitive inputs and filter the same ones\n for (var i = 0; i < propVal.length; i++) {\n if (typeof propVal[i] === 'number' && !array.includes(propVal[i])) {\n array.push(propVal[i])\n } else if (typeof propVal[i] === 'string' && !array.includes(propVal[i].toLowerCase())) {\n array.push(propVal[i].toLowerCase())\n } else if ((typeof propVal[i] === 'number' && array.includes(propVal[i])) || (typeof propVal[i] === 'string' && array.includes(propVal[i].toLowerCase()))) {\n console.error('Values already included')\n } else {\n console.error('Array supports only string or number type values')\n }\n }\n\n // Update globalProfileMap with the array\n $ct.globalProfileMap[propKey] = array\n }\n\n // Save to local storage or cookie\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Call the sendMultiValueData function\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n var index = $ct.globalProfileMap[propKey].indexOf(propVal)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n } else {\n for (var k = 0; k < propVal.length; k++) {\n var idx = $ct.globalProfileMap[propKey].indexOf(propVal[k])\n if (idx !== -1) {\n $ct.globalProfileMap[propKey].splice(idx, 1)\n }\n }\n }\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n // console.log('Raise notification clicked event for ', item)\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","export const initialiseCTBuilder = (url, variant) => {\n document.addEventListener('DOMContentLoaded', () => onContentLoad(url, variant))\n}\n\nlet container\n\nfunction onContentLoad (url, variant) {\n document.body.innerHTML = ''\n container = document.createElement('div')\n container.id = 'overlayDiv'\n container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form\n container.style.display = 'flex'\n document.body.appendChild(container)\n const overlayPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js'\n loadOverlayScript(overlayPath, url, variant)\n .then(() => {\n console.log('Overlay script loaded successfully.')\n })\n .catch((error) => {\n console.error('Error loading overlay script:', error)\n })\n loadCSS()\n loadTypeKit()\n}\n\nfunction loadCSS () {\n var link = document.createElement('link')\n link.rel = 'stylesheet'\n link.type = 'text/css'\n link.href = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css'\n document.head.appendChild(link)\n}\n\nfunction loadOverlayScript (overlayPath, url, variant) {\n return new Promise((resolve, reject) => {\n var script = document.createElement('script')\n script.type = 'module'\n script.src = overlayPath\n script.onload = function () {\n if (typeof window.Overlay === 'function') {\n window.Overlay('#overlayDiv', url, variant)\n resolve()\n } else {\n reject(new Error('ContentLayout not found in overlay.js'))\n }\n }\n script.onerror = function (error) {\n reject(error)\n }\n document.head.appendChild(script)\n })\n}\n\nfunction loadTypeKit () {\n var config = {\n kitId: 'eqj6nom',\n scriptTimeout: 3000,\n async: true\n }\n\n var d = document\n var h = d.documentElement\n var t = setTimeout(function () {\n h.className = h.className.replace(/\\bwf-loading\\b/g, '') + ' wf-inactive'\n // $(document).trigger(\"TypeKitReady\");\n }, config.scriptTimeout)\n var tk = d.createElement('script')\n var f = false\n var s = d.getElementsByTagName('script')[0]\n var a\n\n h.className += ' wf-loading'\n tk.src = 'https://use.typekit.net/' + config.kitId + '.js'\n tk.async = true\n tk.onload = tk.onreadystatechange = function () {\n a = this.readyState\n if (f || (a && a !== 'complete' && a !== 'loaded')) return\n f = true\n clearTimeout(t)\n try {\n // eslint-disable-next-line no-undef\n Typekit.load(config)\n } catch (e) {}\n }\n\n s.parentNode.insertBefore(tk, s)\n}\n\nexport const renderVisualBuilder = (targetingMsgJson, isPreview) => {\n const details = targetingMsgJson.display.details[0]\n const siteUrl = Object.keys(details)[0]\n const selectors = details[siteUrl]\n\n if (siteUrl === window.location.href) {\n for (const selector in selectors) {\n const element = document.querySelector(selector)\n if (element) {\n if (selectors[selector].html) {\n element.outerHTML = selectors[selector].html\n } else {\n // Update json data\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n } else {\n let count = 0\n const intervalId = setInterval(() => {\n const retryElement = document.querySelector(selector)\n if (retryElement) {\n if (selectors[selector].html) {\n retryElement.outerHTML = selectors[selector].html\n } else {\n // Update json data\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n clearInterval(intervalId)\n } else {\n count++\n if (count >= 20) {\n console.log(`No element present on DOM with selector '${selector}'.`)\n clearInterval(intervalId)\n }\n }\n }, 500)\n }\n }\n }\n}\n// function addOverlayScript (overlayPath) {\n// const scriptTag = document.createElement('script')\n// scriptTag.setAttribute('type', 'text/javascript')\n// scriptTag.setAttribute('id', 'wzrk-alert-js')\n// scriptTag.setAttribute('src', overlayPath)\n// document.getElementsByTagName('body')[0].appendChild(scriptTag)\n// return scriptTag\n// }\n","import {\n addToLocalProfileMap,\n arp,\n getCampaignObject,\n saveCampaignObject,\n closeIframe\n} from './clevertap'\n\nimport {\n CAMP_COOKIE_NAME,\n DISPLAY,\n GLOBAL,\n EV_COOKIE,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n WZRK_PREFIX,\n WZRK_ID,\n CAMP_COOKIE_G,\n GCOOKIE_NAME\n} from './constants'\n\nimport {\n getNow,\n getToday\n} from './datetime'\n\nimport {\n compressToBase64\n} from './encoder'\n\nimport { StorageManager, $ct } from './storage'\nimport RequestDispatcher from './requestDispatcher'\nimport { CTWebPersonalisationBanner } from './web-personalisation/banner'\nimport { CTWebPersonalisationCarousel } from './web-personalisation/carousel'\nimport { CTWebPopupImageOnly } from './web-popupImageonly/popupImageonly'\nimport { checkAndRegisterWebInboxElements, initializeWebInbox, processWebInboxSettings, hasWebInboxSettingsInLS, processInboxNotifs } from '../modules/web-inbox/helper'\nimport { renderVisualBuilder } from '../modules/visualBuilder/pageBuilder'\n\nconst _tr = (msg, {\n device,\n session,\n request,\n logger\n}) => {\n const _device = device\n const _session = session\n const _request = request\n const _logger = logger\n let _wizCounter = 0\n\n // msg = {\n // arp: {\n // j_n: 'Zw==',\n // i_n: 'Y2NmewICAw==',\n // d_ts: 0,\n // dh: 0,\n // v: 1,\n // j_s: '{ }',\n // id: 'WWW-WWW-WWRZ',\n // e_ts: 0,\n // r_ts: 1649748826,\n // rc_w: 60,\n // rc_n: 5\n // },\n // inapp_notifs: [\n // {\n // msgContent: {\n // templateType: 'point-and-click',\n // type: 4\n // },\n // display: {\n // divId: 'hero-banner',\n // details: [{\n // 'http://localhost:3000/': {\n // '.heroDi1v': {\n // html: 'Hello Sonam'\n // },\n // '#selector_2': {\n // html: '

Hello Sonam

'\n // },\n // '.heroDiv2': {\n // json: {\n // name: 'Sonam',\n // identity: 1234\n // }\n // }\n // }\n // }],\n // wtarget_type: 2,\n // wmc: 1,\n // ff: 'Desktop'\n // },\n // wzrk_id: '1655316906_20220620',\n // wzrk_pivot: 'wzrk_default'\n // }\n // ]\n // }\n // Campaign House keeping\n const doCampHouseKeeping = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const today = getToday()\n\n const incrCount = (obj, campaignId, excludeFromFreqCaps) => {\n let currentCount = 0\n let totalCount = 0\n if (obj[campaignId] != null) {\n currentCount = obj[campaignId]\n }\n currentCount++\n if (obj.tc != null) {\n totalCount = obj.tc\n }\n // if exclude from caps then dont add to total counts\n if (excludeFromFreqCaps < 0) {\n totalCount++\n }\n\n obj.tc = totalCount\n obj[campaignId] = currentCount\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n delete sessionStorage[CAMP_COOKIE_NAME]\n var campTypeObj = {}\n const campObj = getCampaignObject()\n if (targetingMsgJson.display.wtarget_type === 3 && campObj.hasOwnProperty('wi')) {\n campTypeObj = campObj.wi\n } else if ((targetingMsgJson.display.wtarget_type === 0 || targetingMsgJson.display.wtarget_type === 1) && campObj.hasOwnProperty('wp')) {\n campTypeObj = campObj.wp\n } else {\n campTypeObj = {}\n }\n if (campObj.hasOwnProperty('global')) {\n campTypeObj.wp = campObj\n }\n // global session limit. default is 1\n if (targetingMsgJson[DISPLAY].wmc == null) {\n targetingMsgJson[DISPLAY].wmc = 1\n }\n\n // global session limit for web inbox. default is 1\n if (targetingMsgJson[DISPLAY].wimc == null) {\n targetingMsgJson[DISPLAY].wimc = 1\n }\n\n var excludeFromFreqCaps = -1 // efc - Exclude from frequency caps\n let campaignSessionLimit = -1 // mdc - Once per session\n let campaignDailyLimit = -1 // tdc - Once per day\n let campaignTotalLimit = -1 // tlc - Once per user for the duration of campaign\n let totalDailyLimit = -1\n let totalSessionLimit = -1 // wmc - Web Popup Global Session Limit\n let totalInboxSessionLimit = -1 // wimc - Web Inbox Global Session Limit\n\n if (targetingMsgJson[DISPLAY].efc != null) { // exclude from frequency cap\n excludeFromFreqCaps = parseInt(targetingMsgJson[DISPLAY].efc, 10)\n }\n if (targetingMsgJson[DISPLAY].mdc != null) { // Campaign Session Limit\n campaignSessionLimit = parseInt(targetingMsgJson[DISPLAY].mdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tdc != null) { // No of web popups in a day per campaign\n campaignDailyLimit = parseInt(targetingMsgJson[DISPLAY].tdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tlc != null) { // Total lifetime count\n campaignTotalLimit = parseInt(targetingMsgJson[DISPLAY].tlc, 10)\n }\n if (targetingMsgJson[DISPLAY].wmp != null) { // No of campaigns per day\n totalDailyLimit = parseInt(targetingMsgJson[DISPLAY].wmp, 10)\n }\n if (targetingMsgJson[DISPLAY].wmc != null) { // No of campaigns per session\n totalSessionLimit = parseInt(targetingMsgJson[DISPLAY].wmc, 10)\n }\n\n if (targetingMsgJson[DISPLAY].wimc != null) { // No of inbox campaigns per session\n totalInboxSessionLimit = parseInt(targetingMsgJson[DISPLAY].wimc, 10)\n }\n // session level capping\n var sessionObj = campTypeObj[_session.sessionId]\n if (sessionObj) {\n const campaignSessionCount = sessionObj[campaignId]\n const totalSessionCount = sessionObj.tc\n // dnd\n if (campaignSessionCount === 'dnd' && !$ct.dismissSpamControl) {\n return false\n }\n\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n // Inbox session\n if (totalInboxSessionLimit > 0 && totalSessionCount >= totalInboxSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n } else {\n // session\n if (totalSessionLimit > 0 && totalSessionCount >= totalSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n }\n\n // campaign session\n if (campaignSessionLimit > 0 && campaignSessionCount >= campaignSessionLimit) {\n return false\n }\n } else {\n sessionObj = {}\n campTypeObj[_session.sessionId] = sessionObj\n }\n\n // daily level capping\n var dailyObj = campTypeObj[today]\n if (dailyObj != null) {\n const campaignDailyCount = dailyObj[campaignId]\n const totalDailyCount = dailyObj.tc\n // daily\n if (totalDailyLimit > 0 && totalDailyCount >= totalDailyLimit && excludeFromFreqCaps < 0) {\n return false\n }\n // campaign daily\n if (campaignDailyLimit > 0 && campaignDailyCount >= campaignDailyLimit) {\n return false\n }\n } else {\n dailyObj = {}\n campTypeObj[today] = dailyObj\n }\n\n var globalObj = campTypeObj[GLOBAL]\n if (globalObj != null) {\n const campaignTotalCount = globalObj[campaignId]\n // campaign total\n if (campaignTotalLimit > 0 && campaignTotalCount >= campaignTotalLimit) {\n return false\n }\n } else {\n globalObj = {}\n campTypeObj[GLOBAL] = globalObj\n }\n }\n // delay\n if (targetingMsgJson[DISPLAY].delay != null && targetingMsgJson[DISPLAY].delay > 0) {\n const delay = targetingMsgJson[DISPLAY].delay\n targetingMsgJson[DISPLAY].delay = 0\n setTimeout(_tr, delay * 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n return false\n }\n\n incrCount(sessionObj, campaignId, excludeFromFreqCaps)\n incrCount(dailyObj, campaignId, excludeFromFreqCaps)\n incrCount(globalObj, campaignId, excludeFromFreqCaps)\n\n let campKey = 'wp'\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n campKey = 'wi'\n }\n // get ride of stale sessions and day entries\n const newCampObj = {}\n newCampObj[_session.sessionId] = sessionObj\n newCampObj[today] = dailyObj\n newCampObj[GLOBAL] = globalObj\n saveCampaignObject({ [campKey]: newCampObj })\n }\n\n const getCookieParams = () => {\n const gcookie = _device.getGuid()\n const scookieObj = _session.getSessionCookieObject()\n return '&t=wc&d=' + encodeURIComponent(compressToBase64(gcookie + '|' + scookieObj.p + '|' + scookieObj.s))\n }\n\n const setupClickEvent = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n if (onClick !== '' && onClick != null) {\n let ctaElement\n let jsCTAElements\n if (isLegacy) {\n ctaElement = contentDiv\n } else if (contentDiv !== null) {\n jsCTAElements = contentDiv.getElementsByClassName('jsCT_CTA')\n if (jsCTAElements != null && jsCTAElements.length === 1) {\n ctaElement = jsCTAElements[0]\n }\n }\n const jsFunc = targetingMsgJson.display.jsFunc\n const isPreview = targetingMsgJson.display.preview\n if (isPreview == null) {\n onClick += getCookieParams()\n }\n\n if (ctaElement != null) {\n ctaElement.onclick = () => {\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n if (isPreview == null) {\n RequestDispatcher.fireRequest(onClick)\n }\n invokeExternalJs(jsFunc, targetingMsgJson)\n // close iframe. using -1 for no campaignId\n closeIframe('-1', divId, _session.sessionId)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n }\n }\n\n const invokeExternalJs = (jsFunc, targetingMsgJson) => {\n const func = window.parent[jsFunc]\n if (typeof func === 'function') {\n if (targetingMsgJson.display.kv != null) {\n func(targetingMsgJson.display.kv)\n } else {\n func()\n }\n }\n }\n\n const setupClickUrl = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n incrementImpression(targetingMsgJson)\n setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy)\n }\n\n const incrementImpression = (targetingMsgJson) => {\n const data = {}\n data.type = 'event'\n data.evtName = NOTIFICATION_VIEWED\n data.evtData = { [WZRK_ID]: targetingMsgJson.wzrk_id }\n if (targetingMsgJson.wzrk_pivot) {\n data.evtData = { ...data.evtData, wzrk_pivot: targetingMsgJson.wzrk_pivot }\n }\n _request.processEvent(data)\n }\n\n const renderPersonalisationBanner = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const bannerEl = document.createElement('ct-web-personalisation-banner')\n bannerEl.msgId = targetingMsgJson.wzrk_id\n bannerEl.pivotId = targetingMsgJson.wzrk_pivot\n bannerEl.divHeight = targetingMsgJson.display.divHeight\n bannerEl.details = targetingMsgJson.display.details[0]\n const containerEl = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n containerEl.innerHTML = ''\n containerEl.appendChild(bannerEl)\n }\n\n const renderPersonalisationCarousel = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-carousel') === undefined) {\n customElements.define('ct-web-personalisation-carousel', CTWebPersonalisationCarousel)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const carousel = document.createElement('ct-web-personalisation-carousel')\n carousel.target = targetingMsgJson\n const container = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n container.innerHTML = ''\n container.appendChild(carousel)\n }\n\n const renderPopUpImageOnly = (targetingMsgJson) => {\n const divId = 'wzrkImageOnlyDiv'\n const popupImageOnly = document.createElement('ct-web-popup-imageonly')\n popupImageOnly.session = _session\n popupImageOnly.target = targetingMsgJson\n const containerEl = document.getElementById(divId)\n containerEl.innerHTML = ''\n containerEl.style.visibility = 'hidden'\n containerEl.appendChild(popupImageOnly)\n }\n\n const renderFooterNotification = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const displayObj = targetingMsgJson.display\n\n if (displayObj.wtarget_type === 2) { // Handling Web Native display\n // Logic for kv pair data\n if (targetingMsgJson.msgContent.type === 1) {\n const inaObj = {}\n\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.msgContent.kv != null) {\n inaObj.kv = targetingMsgJson.msgContent.kv\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n return\n }\n }\n if (displayObj.layout === 1) { // Handling Web Exit Intent\n return showExitIntent(undefined, targetingMsgJson)\n }\n if (displayObj.layout === 3) { // Handling Web Popup Image Only\n const divId = 'wzrkImageOnlyDiv'\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById(divId) != null || document.getElementById('intentPreview') != null) {\n return\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n document.body.appendChild(msgDiv)\n if (customElements.get('ct-web-popup-imageonly') === undefined) {\n customElements.define('ct-web-popup-imageonly', CTWebPopupImageOnly)\n }\n return renderPopUpImageOnly(targetingMsgJson)\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const divId = 'wizParDiv' + displayObj.layout\n\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n if (document.getElementById(divId) != null) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = divId\n const isBanner = displayObj.layout === 2\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n const viewHeight = window.innerHeight\n const viewWidth = window.innerWidth\n let legacy = false\n\n if (!isBanner) {\n const marginBottom = viewHeight * 5 / 100\n var contentHeight = 10\n let right = viewWidth * 5 / 100\n let bottomPosition = contentHeight + marginBottom\n let width = viewWidth * 30 / 100 + 20\n let widthPerct = 'width:30%;'\n // for small devices - mobile phones\n if ((/mobile/i.test(navigator.userAgent) || (/mini/i.test(navigator.userAgent))) && /iPad/i.test(navigator.userAgent) === false) {\n width = viewWidth * 85 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:80%;'\n // medium devices - tablets\n } else if ('ontouchstart' in window || (/tablet/i.test(navigator.userAgent))) {\n width = viewWidth * 50 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:50%;'\n }\n // legacy footer notif\n if (displayObj.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden; bottom:' + bottomPosition + 'px !important;width:' + width + 'px !important;right:' + right + 'px !important;position:fixed;z-index:2147483647;')\n } else {\n msgDiv.setAttribute('style', widthPerct + displayObj.iFrameStyle)\n }\n } else {\n msgDiv.setAttribute('style', displayObj.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n\n const borderRadius = displayObj.br === false ? '0' : '8'\n\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, leftTd, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n leftTd = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n leftTd = '#f4f4f4'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"\"\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'\" + divId + \"');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"\" +\n // \"\"+\n '' + imageTd + \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
'\n html = css + title + body\n }\n\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n const ifrm = (iframe.contentWindow) ? iframe.contentWindow : (iframe.contentDocument.document) ? iframe.contentDocument.document : iframe.contentDocument\n const doc = ifrm.document\n\n // Dispatch event for popup box/banner close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n doc.open()\n doc.write(html)\n\n if (displayObj['custom-editor']) {\n appendScriptForCustomEvent(targetingMsgJson, doc)\n }\n doc.close()\n\n const adjustIFrameHeight = () => {\n // adjust iframe and body height of html inside correctly\n contentHeight = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv').scrollHeight\n if (displayObj['custom-editor'] !== true && !isBanner) {\n contentHeight += 25\n }\n document.getElementById('wiz-iframe').contentDocument.body.style.margin = '0px'\n document.getElementById('wiz-iframe').style.height = contentHeight + 'px'\n }\n\n const ua = navigator.userAgent.toLowerCase()\n if (ua.indexOf('safari') !== -1) {\n if (ua.indexOf('chrome') > -1) {\n iframe.onload = () => {\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n } else {\n let inDoc = iframe.contentDocument || iframe.contentWindow\n if (inDoc.document) inDoc = inDoc.document\n // safari iphone 7+ needs this.\n adjustIFrameHeight()\n const _timer = setInterval(() => {\n if (inDoc.readyState === 'complete') {\n clearInterval(_timer)\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }, 10)\n }\n } else {\n iframe.onload = () => {\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }\n }\n\n const appendScriptForCustomEvent = (targetingMsgJson, doc) => {\n const script = doc.createElement('script')\n script.innerHTML = `\n const ct__camapignId = '${targetingMsgJson.wzrk_id}';\n const ct__formatVal = (v) => {\n return v && v.trim().substring(0, 20);\n }\n const ct__parentOrigin = window.parent.origin;\n document.body.addEventListener('click', (event) => {\n const elem = event.target.closest?.('a[wzrk_c2a], button[wzrk_c2a]');\n if (elem) {\n const {innerText, id, name, value, href} = elem;\n const clickAttr = elem.getAttribute('onclick') || elem.getAttribute('click');\n const onclickURL = clickAttr?.match(/(window.open)[(\\](\\\"|')(.*)(\\\"|',)/)?.[3] || clickAttr?.match(/(location.href *= *)(\\\"|')(.*)(\\\"|')/)?.[3];\n const props = {innerText, id, name, value};\n let msgCTkv = Object.keys(props).reduce((acc, c) => {\n const formattedVal = ct__formatVal(props[c]);\n formattedVal && (acc['wzrk_click_' + c] = formattedVal);\n return acc;\n }, {});\n if(onclickURL) { msgCTkv['wzrk_click_' + 'url'] = onclickURL; }\n if(href) { msgCTkv['wzrk_click_' + 'c2a'] = href; }\n const notifData = { msgId: ct__camapignId, msgCTkv, pivotId: '${targetingMsgJson.wzrk_pivot}' };\n window.parent.clevertap.renderNotificationClicked(notifData);\n }\n });\n `\n doc.body.appendChild(script)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe-intent'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n const ifrm = (iframe.contentWindow) ? iframe.contentWindow : (iframe.contentDocument.document) ? iframe.contentDocument.document : iframe.contentDocument\n const doc = ifrm.document\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n doc.open()\n doc.write(html)\n if (targetingMsgJson.display['custom-editor']) {\n appendScriptForCustomEvent(targetingMsgJson, doc)\n }\n doc.close()\n\n const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n this.#logger.error('Error subscribing: ' + error)\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\n// import { initialiseCTBuilder } from './modules/visualBuilder/pageBuilder'\nimport { initialiseCTBuilder, renderVisualBuilder } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token) {\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n #handleMessageEvent (event) {\n if (event.data && event.data.message) {\n if (event.data.message === 'Dashboard' && event.data.url) {\n initialiseCTBuilder(event.data.url, event.data.variant ?? null)\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n }\n }\n\n pageChanged () {\n const search = window.location.search\n if (search === '?ctBuilder') {\n // open in visual builder mode\n console.log('open in visual builder mode')\n window.addEventListener('message', this.#handleMessageEvent, false)\n window.postMessage('builder')\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', this.#handleMessageEvent, false)\n window.postMessage('preview')\n return\n }\n\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","constructor","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","dataPostPEURL","dataPostURL","recorderURL","emailURL","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","save","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","read","data","getItem","parse","e","remove","removeItem","removeCookie","name","domain","cookieStr","document","cookie","createCookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","readCookie","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","saveToLSorCookie","property","location","hostname","$ct","globalCache","readFromLSorCookie","trim","err","createBroadCookie","broadDomain","domainParts","testBroadDomain","testCookieName","tempCookie","getMetaProp","metaObj","setMetaProp","wzrkMetaObj","getAndClearMetaProp","setInstantDeleteFlagInK","k","flag","backupEvent","reqNo","backupArr","q","debug","removeBackup","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","get","item","saveCacheToLS","set","allKeys","objToArray","index","temp","getKey","getSecondLastKey","keysArr","getLastKey","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","s","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","sessionObj","getSessionCookieObject","kIdFromLS","guidFromLRUCache","lastK","lastGUID","unregisterTokenForGuid","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","_processOldValues","getDetails","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","fireRequest","skipARP","sendOULFlag","getDelayFrequency","account","randomDelay","random","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","ProfileHandler","profilesArr","getAttribute","propName","_handleIncrementDecrementValue","command","tz","profile","addSystemDataToObject","addFlags","compressedData","saveAndFireRequest","_handleMultiValueSet","arrayVal","array","toLowerCase","sendMultiValueData","_handleMultiValueAdd","propKey","propVal","_handleMultiValueRemove","_handleMultiValueDelete","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","clear","addToK","ids","g","kId","anonymousUser","foundInCache","gFromCache","Identity","cookieName","loginArr","pop","processProfile","CTWebPersonalisationBanner","HTMLElement","_details","shadow","attachShadow","mode","details","renderBanner","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","target","renderCarousel","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","button","setInterval","sliderTime","goTo","prev","cur","CTWebPopupImageOnly","_session","popup","container","resizeObserver","renderImageOnlyPopup","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","Message","config","message","wrapper","snackBar","renderMessage","createEl","part","_el","msg","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","raiseClickedEvent","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","contains","setBadgeStyle","msgCount","incomingMessages","msgs","updateInboxMessages","incomingMessagesForPreview","previewMsgs","now","buildUIForMessages","updateUnviewedBadgeCounter","connectedCallback","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","addMsgsToInboxFromLS","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","deleteMsgsFromUI","getInboxMessages","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","top","right","getBoundingClientRect","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","inbox_notifs","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","initialiseCTBuilder","variant","onContentLoad","position","overlayPath","loadOverlayScript","then","catch","loadCSS","loadTypeKit","link","rel","head","script","src","onload","Overlay","Error","onerror","kitId","scriptTimeout","h","documentElement","className","tk","onreadystatechange","Typekit","load","renderVisualBuilder","targetingMsgJson","siteUrl","selectors","selector","element","querySelector","outerHTML","intervalId","retryElement","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","onclick","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","inaObj","kvPairsEvent","CustomEvent","dispatchEvent","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","pointerCss","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","ifrm","contentWindow","contentDocument","doc","closeCampaign","Event","write","appendScriptForCustomEvent","close","adjustIFrameHeight","scrollHeight","margin","ua","inDoc","_timer","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","getTotalVisits","visitCount","getLastVisit","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","info","debugPE","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","getTimeElapsed","sessionStart","getPageCount","seqNo","requestTime","RequestManager","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","post","fetch","method","headers","response","ok","json","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","_enableWebPush","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","skipDialog","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","getValue","getdefaultValue","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","addValueChangedCallback","removeValueChangedCallback","clearStartFlag","VariableStore","syncVariables","onSyncSuccess","onSyncFailure","meta","r","status","fetchVariables","onFetchCallback","addVariablesChangedCallback","callback","addOneTimeVariablesChangedCallback","removeVariablesChangedCallback","removeOneTimeVariablesChangedCallback","callBack","CleverTap","spa","isSpa","bind","enablePersonalization","_isPersonalisationActive","ReqestManager","onUserLogin","privacy","notifications","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","handleDecrementValue","setMultiValuesForKey","addMultiValueForKey","addMultiValuesForKey","removeMultiValueForKey","removeMultiValuesForKey","removeValueForKey","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","sendLocationData","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","elements","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","postMessage","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","setOffline","arg","defineVariable","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;EAAO,M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sC;EAC3CqR,MAAAA,mBAAmB,CAACxU,KAAK,CAAC3c,IAAP,EAAa,IAAb,CAAnB;EACD;EACF;EACF;;+CAiGe;EACd,MAAIqP,WAAW,GAAG,0DAAcpX,WAAhC;;EACA,MAAI+H,IAAI,GAAG,EAAX;EACAA,EAAAA,IAAI,GAAG,0DAAcqX,qBAAd,CAAoCrX,IAApC,EAA0C7C,SAA1C,CAAP;EACAkS,EAAAA,WAAW,GAAGzD,QAAQ,CAACyD,WAAD,EAAc,MAAd,EAAsBpV,QAAtB,CAAtB;EACAoV,EAAAA,WAAW,GAAGzD,QAAQ,CAACyD,WAAD,EAAc,GAAd,EAAmB3C,YAAY,CAAC7M,IAAI,CAACC,SAAL,CAAeE,IAAf,CAAD,8BAAuB,IAAvB,wBAA/B,CAAtB;;EAEA,4DAAcwX,kBAAd,CAAiCnI,WAAjC,EAA8CpN,GAAG,CAACgC,YAAlD;EACD;;yDAEoB;EACnB,SAAQ,OAAOrC,MAAM,CAACqqC,MAAd,KAAyB,WAAzB,IAAwCrqC,MAAM,CAACqqC,MAAP,CAAcC,IAAd,KAAuB,YAAvE;EACD;;yDAMmBlsC,MAAM;EACxB,MAAI,KAAKqlC,wBAAL,EAAJ,EAAqC;EACnCrlC,IAAAA,IAAI,CAAC+9B,KAAL,GAAa,IAAb;EACD;EACF;;QCtxBGruB,SAAS,GAAG,IAAIy8B,SAAJ,CAAcvqC,MAAM,CAAC8N,SAArB;EAElB9N,MAAM,CAAC8N,SAAP,GAAmB9N,MAAM,CAAC+N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file diff --git a/clevertap.min.js b/clevertap.min.js index 68268fbc..ef65b677 100644 --- a/clevertap.min.js +++ b/clevertap.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).clevertap=t()}(this,(function(){"use strict";var e=0;function t(t){return"__private_"+e+++"_"+t}function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}const o="clevertap-prod.com",n="https:";var s=t("accountId"),r=t("region"),a=t("targetDomain"),l=t("dcSdkversion"),c=t("token");class d{constructor(){let{id:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";Object.defineProperty(this,s,{writable:!0,value:void 0}),Object.defineProperty(this,r,{writable:!0,value:""}),Object.defineProperty(this,a,{writable:!0,value:o}),Object.defineProperty(this,l,{writable:!0,value:""}),Object.defineProperty(this,c,{writable:!0,value:""}),this.id=e,t&&(this.region=t),i&&(this.targetDomain=i),n&&(this.token=n)}get id(){return i(this,s)[s]}set id(e){i(this,s)[s]=e}get region(){return i(this,r)[r]}set region(e){i(this,r)[r]=e}get dcSDKVersion(){return i(this,l)[l]}set dcSDKVersion(e){i(this,l)[l]=e}get targetDomain(){return i(this,a)[a]}set targetDomain(e){i(this,a)[a]=e}get token(){return i(this,c)[c]}set token(e){i(this,c)[c]=e}get finalTargetDomain(){return this.region?"".concat(this.region,".").concat(this.targetDomain):this.targetDomain===o?"".concat("eu1",".").concat(this.targetDomain):this.targetDomain}get dataPostPEURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/defineVars")}get dataPostURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/a?t=96")}get recorderURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/r?r=1")}get emailURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/e?r=1")}}const h=new RegExp("^\\s+|\\.|:|\\$|'|\"|\\\\|\\s+$","g"),u=new RegExp("^\\s+|'|\"|\\\\|\\s+$","g"),p=new RegExp("'","g"),g="clear",f="Charged ID",v="WZRK_CHARGED_ID",b="WZRK_G",m="WZRK_K",y="WZRK_CAMP",w="WZRK_CAMP_G",C="WZRK_EV",k="WZRK_META",x="WZRK_PR",P="WZRK_ARP",S="WZRK_L",I="global",_="optOut",O="useIP",E="WZRK_X",A="push",L=31536e3,M="wzrk_",T="wzrk_id",R="Notification Viewed",j="Notification Clicked",D="WZRK_FPU",z="WZRK_PSD",B="$incr",N="$add",F="$remove",U="$delete",q="WZRK_INBOX_CONFIG",V="WZRK_INBOX",W=1e3,K="wzrk_fetch",H=["Stayed","UTM Visited","App Launched","Notification Sent",R,j],G=e=>"string"==typeof e||e instanceof String,J=e=>"[object Object]"===Object.prototype.toString.call(e),Z=e=>"object"==typeof e&&e instanceof Date,$=e=>{for(const t in e)if(e.hasOwnProperty(t))return!1;return!0},Y=e=>!isNaN(parseFloat(e))&&isFinite(e),Q=e=>/^-?[\d.]+(?:e-?\d+)?$/.test(e)&&"number"==typeof e,X=e=>null!=e&&"undefined"!==e,ee=(e,t)=>{if("object"!=typeof e){let i;return G(e)?(i=te(e,u),i.length>1024&&(i=i.substring(0,1024),t.reportError(521,i+"... length exceeded 1024 chars. Trimmed."))):i=e,i}for(const i in e)if(e.hasOwnProperty(i)){const o=ee(e[i],t);let n;n=te(i,h),n.length>1024&&(n=n.substring(0,1024),t.reportError(520,n+"... length exceeded 1024 chars. Trimmed.")),delete e[i],e[n]=o}return e},te=(e,t)=>e.replace(t,""),ie=()=>{const e=new Date;return e.getFullYear()+""+e.getMonth()+e.getDay()},oe=()=>Math.floor((new Date).getTime()/1e3),ne=e=>"$D_"+Math.round(e.getTime()/1e3),se=e=>{if(re(e))return"$D_"+e},re=e=>{const t=/^(\d{4})(\d{2})(\d{2})$/.exec(e);if(null==t)return!1;const i=t[3],o=t[2]-1,n=t[1],s=new Date(n,o,i);return s.getDate()==i&&s.getMonth()==o&&s.getFullYear()==n};class ae{static save(e,t){return!(!e||!t)&&(this._isLocalStorageSupported()?(localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),!0):void 0)}static read(e){if(!e)return!1;let t=null;if(this._isLocalStorageSupported()&&(t=localStorage.getItem(e)),null!=t)try{t=JSON.parse(t)}catch(e){}return t}static remove(e){return!!e&&(this._isLocalStorageSupported()?(localStorage.removeItem(e),!0):void 0)}static removeCookie(e,t){let i=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";t&&(i=i+" domain="+t+"; path=/"),document.cookie=i}static createCookie(e,t,i,o){let n="",s="";if(i){const e=new Date;e.setTime(e.getTime()+1e3*i),n="; expires="+e.toGMTString()}o&&(s="; domain="+o),t=encodeURIComponent(t),document.cookie=e+"="+t+n+s+"; path=/"}static readCookie(e){const t=e+"=",i=document.cookie.split(";");for(let e=0;e=0;o--){if(a=0===o?r[o]+a:"."+r[o]+a,this.readCookie(e)){var n="test_"+e+o;if(this.createCookie(n,t,10,a),!this.readCookie(n))continue;this.removeCookie(n,a)}this.createCookie(e,t,i,a);if(this.readCookie(e)==t){s=a,le.broadDomain=s;break}}}else this.createCookie(e,t,i,s)}else this.createCookie(e,t,i,o)}static getMetaProp(e){const t=this.readFromLSorCookie(k);if(null!=t)return t[e]}static setMetaProp(e,t){if(this._isLocalStorageSupported()){let i=this.readFromLSorCookie(k);null==i&&(i={}),void 0===t?delete i[e]:i[e]=t,this.saveToLSorCookie(k,i)}}static getAndClearMetaProp(e){const t=this.getMetaProp(e);return this.setMetaProp(e,void 0),t}static setInstantDeleteFlagInK(){let e=this.readFromLSorCookie(m);null==e&&(e={}),e.flag=!0,this.saveToLSorCookie(m,e)}static backupEvent(e,t,i){let o=this.readFromLSorCookie(S);void 0===o&&(o={}),o[t]={q:e},this.saveToLSorCookie(S,o),i.debug("stored in ".concat(S," reqNo : ").concat(t," -> ").concat(e))}static removeBackup(e,t){const i=this.readFromLSorCookie(S);null!=i&&void 0!==i[e]&&(t.debug("del event: ".concat(e," data-> ").concat(i[e].q)),delete i[e],this.saveToLSorCookie(S,i))}}const le={globalCache:{gcookie:null,REQ_N:0,RESP_N:0},LRU_CACHE:null,globalProfileMap:void 0,globalEventsMap:void 0,blockRequest:!1,isOptInRequest:!1,broadDomain:null,webPushEnabled:null,campaignDivMap:{},currentSessionId:null,wiz_counter:0,notifApi:{notifEnabledFromApi:!1},unsubGroups:[],updatedCategoryLong:null,inbox:null,isPrivacyArrPushed:!1,privacyArray:[],offline:!1,location:null,dismissSpamControl:!1,globalUnsubscribe:!0,flutterVersion:null,variableStore:{}};var ce=t("keyOrder"),de=t("deleteFromObject");class he{constructor(e){Object.defineProperty(this,de,{value:ue}),Object.defineProperty(this,ce,{writable:!0,value:void 0}),this.max=e;let t=ae.readFromLSorCookie(E);if(t){const e={};i(this,ce)[ce]=[],t=t.cache;for(const o in t)t.hasOwnProperty(o)&&(e[t[o][0]]=t[o][1],i(this,ce)[ce].push(t[o][0]));this.cache=e}else this.cache={},i(this,ce)[ce]=[]}get(e){const t=this.cache[e];return t&&(this.cache=i(this,de)[de](e,this.cache),this.cache[e]=t,i(this,ce)[ce].push(e)),this.saveCacheToLS(this.cache),t}set(e,t){const o=this.cache[e],n=i(this,ce)[ce];null!=o?this.cache=i(this,de)[de](e,this.cache):n.length===this.max&&(this.cache=i(this,de)[de](n[0],this.cache)),this.cache[e]=t,i(this,ce)[ce][i(this,ce)[ce]-1]!==e&&i(this,ce)[ce].push(e),this.saveCacheToLS(this.cache)}saveCacheToLS(e){const t=[],o=i(this,ce)[ce];for(const i in o)if(o.hasOwnProperty(i)){const n=[];n.push(o[i]),n.push(e[o[i]]),t.push(n)}ae.saveToLSorCookie(E,{cache:t})}getKey(e){if(null===e)return null;const t=i(this,ce)[ce];for(const i in t)if(t.hasOwnProperty(i)&&this.cache[t[i]]===e)return t[i];return null}getSecondLastKey(){const e=i(this,ce)[ce];return null!=e&&e.length>1?e[e.length-2]:-1}getLastKey(){const e=i(this,ce)[ce].length;if(e)return i(this,ce)[ce][e-1]}}var ue=function(e,t){const o=JSON.parse(JSON.stringify(i(this,ce)[ce])),n={};let s;for(const i in o)o.hasOwnProperty(i)&&(o[i]!==e?n[o[i]]=t[o[i]]:s=i);return o.splice(s,1),i(this,ce)[ce]=JSON.parse(JSON.stringify(o)),n},pe=t("logger"),ge=t("request"),fe=t("device"),ve=t("session");class be{constructor(e){let{logger:t,request:o,device:n,session:s}=e;Object.defineProperty(this,pe,{writable:!0,value:void 0}),Object.defineProperty(this,ge,{writable:!0,value:void 0}),Object.defineProperty(this,fe,{writable:!0,value:void 0}),Object.defineProperty(this,ve,{writable:!0,value:void 0}),i(this,pe)[pe]=t,i(this,ge)[ge]=o,i(this,fe)[fe]=n,i(this,ve)[ve]=s}s(e,t,o,n,s){let r=!1,a=!1;if(window.isOULInProgress&&(o||"undefined"!==n&&n===window.oulReqN)&&(window.isOULInProgress=!1,r=!0),void 0===n&&(n=0),ae.removeBackup(n,i(this,pe)[pe]),n>le.globalCache.REQ_N)return;if(X(i(this,fe)[fe].gcookie)||e&&(a=!0),!X(i(this,fe)[fe].gcookie)||o||"boolean"==typeof s){const n=i(this,ve)[ve].getSessionCookieObject();if(window.isOULInProgress||n.s&&t{if(J(e)){for(var t in e)if(e.hasOwnProperty(t)){if(J(e[t])||Array.isArray(e[t]))return!1;Z(e[t])&&(e[t]=ne(e[t]))}return!0}return!1},Re=(e,t)=>{if(J(e)){for(var i in e)if(e.hasOwnProperty(i))if("Items"===i){if(!Array.isArray(e[i]))return!1;for(var o in e[i].length>50&&t.reportError(522,"Charged Items exceed 50 limit. Actual count: "+e[i].length),e[i])if(e[i].hasOwnProperty(o)&&(!J(e[i][o])||!Te(e[i][o])))return!1}else{if(J(e[i])||Array.isArray(e[i]))return!1;Z(e[i])&&(e[i]=ne(e[i]))}if(G(e[f])||Q(e[f])){const i=e[f]+"";if(void 0===Me&&(Me=ae.readFromLSorCookie(v)),void 0!==Me&&Me.trim()===i.trim())return t.error("Duplicate charged Id - Dropped"+e),!1;Me=i,ae.saveToLSorCookie(v,i)}return!0}return!1};var je=t("logger"),De=t("oldValues"),ze=t("request"),Be=t("isPersonalisationActive"),Ne=t("processEventArray");class Fe extends Array{constructor(e,t){let{logger:o,request:n,isPersonalisationActive:s}=e;super(),Object.defineProperty(this,Ne,{value:Ue}),Object.defineProperty(this,je,{writable:!0,value:void 0}),Object.defineProperty(this,De,{writable:!0,value:void 0}),Object.defineProperty(this,ze,{writable:!0,value:void 0}),Object.defineProperty(this,Be,{writable:!0,value:void 0}),i(this,je)[je]=o,i(this,De)[De]=t,i(this,ze)[ze]=n,i(this,Be)[Be]=s}push(){for(var e=arguments.length,t=new Array(e),o=0;o0;){var t=e.shift();if(!G(t)){i(this,je)[je].error(xe);continue}if(t.length>1024&&(t=t.substring(0,1024),i(this,je)[je].reportError(510,t+"... length exceeded 1024 chars. Trimmed.")),H.includes(t)){i(this,je)[je].reportError(513,t+" is a restricted system event. It cannot be used as an event name.");continue}const o={type:"event"};if(o.evtName=te(t,h),0!==e.length){const n=e.shift();if(J(n)){if("Charged"===t){if(!Re(n,i(this,je)[je])){i(this,je)[je].reportError(511,"Charged event structure invalid. Not sent.");continue}}else if(!Te(n)){i(this,je)[je].reportError(512,t+" event structure invalid. Not sent.");continue}o.evtData=n}else e.unshift(n)}i(this,ze)[ze].processEvent(o)}};const qe=e=>{const t={},i=e.indexOf("?");if(i>1){const o=e.substring(i+1);let n;const s=/\+/g,r=/([^&=]+)=?([^&]*)/g,a=function(e){let t=e.replace(s," ");try{t=decodeURIComponent(t)}catch(e){}return t};for(n=r.exec(o);n;)t[a(n[1])]=a(n[2]),n=r.exec(o)}return t},Ve=(e,t,i)=>e+"&"+t+"="+encodeURIComponent(i),We=()=>window.location.hostname,Ke=(e,t)=>(t&&"function"==typeof t.debug&&t.debug("dobj:"+e),Ge(e)),He=(()=>{let e="",t=0;for(t=0;t<=25;t++)e+=String.fromCharCode(t+65);for(t=0;t<=25;t++)e+=String.fromCharCode(t+97);for(t=0;t<10;t++)e+=t;return e+"+/="})(),Ge=e=>{if(null==e)return"";var t,i,o,n,s,r,a,l="",c=0;for(e=(e=>{if(null==e)return"";let t,i,o,n={},s={},r="",a="",l="",c=2,d=3,h=2,u="",p=0,g=0,f=String.fromCharCode;for(o=0;o>=1}else{for(i=1,t=0;t>=1}c--,0==c&&(c=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;c--,0==c&&(c=Math.pow(2,h),h++),n[a]=d++,l=String(r)}if(""!==l){if(Object.prototype.hasOwnProperty.call(s,l)){if(l.charCodeAt(0)<256){for(t=0;t>=1}else{for(i=1,t=0;t>=1}c--,0==c&&(c=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;c--,0==c&&(c=Math.pow(2,h),h++)}for(i=2,t=0;t>=1;for(;;){if(p<<=1,15==g){u+=f(p);break}g++}return u})(e);c<2*e.length;)c%2==0?(t=e.charCodeAt(c/2)>>8,i=255&e.charCodeAt(c/2),o=c/2+1>8:NaN):(t=255&e.charCodeAt((c-1)/2),(c+1)/2>8,o=255&e.charCodeAt((c+1)/2)):i=o=NaN),c+=3,n=t>>2,s=(3&t)<<4|i>>4,r=(15&i)<<2|o>>6,a=63&o,isNaN(i)?r=a=64:isNaN(o)&&(a=64),l=l+He.charAt(n)+He.charAt(s)+He.charAt(r)+He.charAt(a);return l};var Je=t("fireRequest"),Ze=t("dropRequestDueToOptOut"),$e=t("addUseIPToRequest"),Ye=t("addARPToRequest");class Qe{constructor(){this.networkRetryCount=0,this.minDelayFrequency=0}static fireRequest(e,t,o,n){i(this,Je)[Je](e,1,t,o,n)}getDelayFrequency(){if(this.logger.debug("Network retry #"+this.networkRetryCount),this.networkRetryCount<10)return this.logger.debug(this.account.id,"Failure count is "+this.networkRetryCount+". Setting delay frequency to 1s"),this.minDelayFrequency=W,this.minDelayFrequency;if(null==this.account.region)return this.logger.debug(this.account.id,"Setting delay frequency to 1s"),W;{const e=1e3*(Math.floor(10*Math.random())+1);return this.minDelayFrequency+=e,this.minDelayFrequency<6e5?(this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency):(this.minDelayFrequency=W,this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency)}}}Qe.logger=void 0,Qe.device=void 0,Qe.account=void 0,Object.defineProperty(Qe,Je,{value:function(e,t,o,n,s){var r,a;if(i(this,Ze)[Ze]())return void this.logger.debug("req dropped due to optout cookie: "+this.device.gcookie);if(X(this.device.gcookie)||(le.blockRequest=!0),s&&s===K)!X(this.device.gcookie)&&le.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(this.networkRetryCount)),i(this,Je)[Je](e,void 0,o,n)}),this.getDelayFrequency());else if(!X(this.device.gcookie)&&le.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(t)),i(this,Je)[Je](e,t+1,o,n)}),50);if(n?window.isOULInProgress=!0:(X(this.device.gcookie)&&(e=Ve(e,"gc",this.device.gcookie)),e=i(this,Ye)[Ye](e,o)),e=Ve(e,"tries",t),e=i(this,$e)[$e](e),e=Ve(e,"r",(new Date).getTime()),(null===(r=window.clevertap)||void 0===r?void 0:r.hasOwnProperty("plugin"))||(null===(a=window.wizrocket)||void 0===a?void 0:a.hasOwnProperty("plugin"))){const t=window.clevertap.plugin||window.wizrocket.plugin;e=Ve(e,"ct_pl",t)}-1!==e.indexOf("chrome-extension:")&&(e=e.replace("chrome-extension:","https:"));for(var l=document.getElementsByClassName("ct-jp-cb");l[0]&&l[0].parentNode;)l[0].parentNode.removeChild(l[0]);const c=document.createElement("script");c.setAttribute("type","text/javascript"),c.setAttribute("src",e),c.setAttribute("class","ct-jp-cb"),c.setAttribute("rel","nofollow"),c.async=!0,document.getElementsByTagName("head")[0].appendChild(c),this.logger.debug("req snt -> url: "+e)}}),Object.defineProperty(Qe,Ze,{value:function(){return!le.isOptInRequest&&X(this.device.gcookie)&&G(this.device.gcookie)?":OO"===this.device.gcookie.slice(-3):(le.isOptInRequest=!1,!1)}}),Object.defineProperty(Qe,$e,{value:function(e){var t=ae.getMetaProp(O);return"boolean"!=typeof t&&(t=!1),Ve(e,O,t?"true":"false")}}),Object.defineProperty(Qe,Ye,{value:function(e,t){if(!0===t){const t={skipResARP:!0};return Ve(e,"arp",Ke(JSON.stringify(t),this.logger))}return ae._isLocalStorageSupported()&&void 0!==localStorage.getItem(P)&&null!==localStorage.getItem(P)?Ve(e,"arp",Ke(JSON.stringify(ae.readFromLSorCookie(P)),this.logger)):e}});const Xe=()=>{let e={};if(ae._isLocalStorageSupported()){let t=ae.read(y);null!=t?(t=JSON.parse(decodeURIComponent(t).replace(p,'"')),t.hasOwnProperty("global")?e.wp=t:e=t):e={}}return e},et=e=>{if(ae._isLocalStorageSupported()){const t={...Xe(),...e},i=JSON.stringify(t);ae.save(y,encodeURIComponent(i)),tt()}},tt=()=>{if(ae._isLocalStorageSupported()){let i=ae.read(b);if(X(i))try{i=JSON.parse(decodeURIComponent(ae.read(b)));const o=ae.read(w)?JSON.parse(decodeURIComponent(ae.read(w))):{};if(i&&ae._isLocalStorageSupported()){var e={},t=Xe();Object.keys(t).forEach((n=>{const s=i in o&&Object.keys(o[i]).length&&o[i][n]?o[i][n]:{},r=t[n].global,a=ie(),l=t[n][a];if(void 0!==r){const e=Object.keys(r);for(const t in e){let i=[];if(e.hasOwnProperty(t)){let o=0,n=0;const a=e[t];if("tc"===a)continue;void 0!==l&&void 0!==l[a]&&(o=l[a]),void 0!==r&&void 0!==r[a]&&(n=r[a]),i=[a,o,n],s[a]=i}}}e={...e,[n]:s}})),o[i]=e,ae.save(w,encodeURIComponent(JSON.stringify(o)))}}catch(e){console.error("Invalid clevertap Id "+e)}}},it=()=>{const e=JSON.parse(decodeURIComponent(ae.read(b)));let t={};if(ae._isLocalStorageSupported()){let i={};t=Xe();const o=ae.read(w),n=o?decodeURIComponent(o):null,s=n?JSON.parse(n):null,r=e&&null!=o&&s&&s[e]&&s[e].wp?Object.values(s[e].wp):[],a=e&&null!=o&&s&&s[e]&&s[e].wi?Object.values(s[e].wi):[],l=ie();let c=0,d=0;return t.wp&&t.wp[l]&&"undefined"!==t.wp[l].tc&&(c=t.wp[l].tc),t.wi&&t.wi[l]&&"undefined"!==t.wi[l].tc&&(d=t.wi[l].tc),i={wmp:c,wimp:d,tlc:r,witlc:a},i}},ot=(e,t)=>{let{logger:i}=t,o=!1;if(J(e))for(const t in e)if(e.hasOwnProperty(t)){o=!0;let n=e[t];if(null==n){delete e[t];continue}"Gender"!==t||n.match(/^M$|^F$/)||(o=!1,i.error(Pe)),"Employed"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Se)),"Married"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Ie)),"Education"!==t||n.match(/^School$|^College$|^Graduate$/)||(o=!1,i.error(_e)),"Age"===t&&null!=n&&(Y(n)?e.Age=+n:(o=!1,i.error(Oe))),"DOB"===t?(/^\$D_/.test(n)&&11===(n+"").length||Z(n)||(o=!1,i.error(Ee)),Z(n)&&(e[t]=ne(n))):Z(n)&&(e[t]=ne(n)),"Phone"!==t||$(n)||(n.length>8&&"+"===n.charAt(0)?(n=n.substring(1,n.length),Y(n)?e.Phone=+n:(o=!1,i.error(Le+". Removed."))):(o=!1,i.error(Le+". Removed."))),o||delete e[t]}return o},nt=e=>{const t={};t.Name=e.name,null!=e.id&&(t.FBID=e.id+""),"male"===e.gender?t.Gender="M":"female"===e.gender?t.Gender="F":t.Gender="O";null!=e.relationship_status&&(t.Married="N","Married"===e.relationship_status&&(t.Married="Y"));const i=function(e){if(null!=e){let t="",i="";for(let o=0;o0?"Y":"N",null!=e.email&&(t.Email=e.email),null!=e.birthday){const i=e.birthday.split("/");t.DOB=se(i[2]+i[0]+i[1])}return t},st=(e,t)=>{let{logger:i}=t;const o={};if(null!=e.displayName&&(o.Name=e.displayName),null!=e.id&&(o.GPID=e.id+""),null!=e.gender&&("male"===e.gender?o.Gender="M":"female"===e.gender?o.Gender="F":"other"===e.gender&&(o.Gender="O")),null!=e.image&&!1===e.image.isDefault&&(o.Photo=e.image.url.split("?sz")[0]),null!=e.emails)for(let t=0;t{if(ae._isLocalStorageSupported()){if(null==le.globalProfileMap&&(le.globalProfileMap=ae.readFromLSorCookie(x),null==le.globalProfileMap&&(le.globalProfileMap={})),null!=e._custom){const t=e._custom;for(const i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);delete e._custom}for(const i in e)if(e.hasOwnProperty(i)){if(le.globalProfileMap.hasOwnProperty(i)&&!t)continue;le.globalProfileMap[i]=e[i]}null!=le.globalProfileMap._custom&&delete le.globalProfileMap._custom,ae.saveToLSorCookie(x,le.globalProfileMap)}},at=(e,t,i)=>{if(null!=e&&"-1"!==e&&ae._isLocalStorageSupported()){const t=Xe();let o=t.wp[i];null==o&&(o={},t[i]=o),o[e]="dnd",et(t)}if(null!=le.campaignDivMap){const t=le.campaignDivMap[e];null!=t&&(document.getElementById(t).style.display="none","intentPreview"===t&&null!=document.getElementById("intentOpacityDiv")&&(document.getElementById("intentOpacityDiv").style.display="none"))}};var lt=t("logger"),ct=t("request"),dt=t("account"),ht=t("oldValues"),ut=t("isPersonalisationActive"),pt=t("processProfileArray");class gt extends Array{constructor(e,t){let{logger:o,request:n,account:s,isPersonalisationActive:r}=e;super(),Object.defineProperty(this,pt,{value:ft}),Object.defineProperty(this,lt,{writable:!0,value:void 0}),Object.defineProperty(this,ct,{writable:!0,value:void 0}),Object.defineProperty(this,dt,{writable:!0,value:void 0}),Object.defineProperty(this,ht,{writable:!0,value:void 0}),Object.defineProperty(this,ut,{writable:!0,value:void 0}),i(this,lt)[lt]=o,i(this,ct)[ct]=n,i(this,dt)[dt]=s,i(this,ht)[ht]=t,i(this,ut)[ut]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o0)for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];let n,s={};if(null!=o.Site){if(n=o.Site,$(n)||!ot(n,{logger:i(this,lt)[lt]}))return}else if(null!=o.Facebook){const e=o.Facebook;$(e)||e.error||(n=nt(e))}else if(null!=o["Google Plus"]){const e=o["Google Plus"];$(e)||e.error||(n=st(e,{logger:i(this,lt)[lt]}))}if(null!=n&&!$(n)){s.type="profile",null==n.tz&&(n.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),s.profile=n,rt(n,!0),s=i(this,ct)[ct].addSystemDataToObject(s,void 0),i(this,ct)[ct].addFlags(s);const e=Ke(JSON.stringify(s),i(this,lt)[lt]);let t=i(this,dt)[dt].dataPostURL;t=Ve(t,"type",A),t=Ve(t,"d",e),i(this,ct)[ct].saveAndFireRequest(t,le.blockRequest)}}},vt=t("request"),bt=t("logger"),mt=t("account"),yt=t("session"),wt=t("oldValues"),Ct=t("device"),kt=t("processOUL"),xt=t("handleCookieFromCache"),Pt=t("deleteUser"),St=t("processLoginArray");class It extends Array{constructor(e,t){let{request:o,account:n,session:s,logger:r,device:a}=e;super(),Object.defineProperty(this,St,{value:At}),Object.defineProperty(this,Pt,{value:Et}),Object.defineProperty(this,xt,{value:Ot}),Object.defineProperty(this,kt,{value:_t}),Object.defineProperty(this,vt,{writable:!0,value:void 0}),Object.defineProperty(this,bt,{writable:!0,value:void 0}),Object.defineProperty(this,mt,{writable:!0,value:void 0}),Object.defineProperty(this,yt,{writable:!0,value:void 0}),Object.defineProperty(this,wt,{writable:!0,value:void 0}),Object.defineProperty(this,Ct,{writable:!0,value:void 0}),i(this,vt)[vt]=o,i(this,mt)[mt]=n,i(this,yt)[yt]=s,i(this,bt)[bt]=r,i(this,wt)[wt]=t,i(this,Ct)[Ct]=a}clear(){i(this,bt)[bt].debug("clear called. Reset flag has been set."),i(this,Pt)[Pt](),ae.setMetaProp(g,!0)}push(){for(var e=arguments.length,t=new Array(e),o=0;o{let o=ae.readFromLSorCookie(m);const n=ae.readFromLSorCookie(b);let s;if(null==o)o={},s=e;else{s=o.id;let r=!1,a=!1;if(null==s&&(s=e[0],r=!0),null==le.LRU_CACHE&&ae._isLocalStorageSupported()&&(le.LRU_CACHE=new he(100)),r)null!=n&&(le.LRU_CACHE.set(s,n),le.blockRequest=!1);else for(const t in e)if(e.hasOwnProperty(t)){const i=e[t];if(le.LRU_CACHE.cache[i]){s=i,a=!0;break}}if(a){s!==le.LRU_CACHE.getLastKey()?i(this,xt)[xt]():(t=!1,ae.saveToLSorCookie(D,t));const e=le.LRU_CACHE.get(s);le.LRU_CACHE.set(s,e),ae.saveToLSorCookie(b,e),i(this,Ct)[Ct].gcookie=e;const o=le.LRU_CACHE.getSecondLastKey();if(ae.readFromLSorCookie(D)&&-1!==o){const e=le.LRU_CACHE.cache[o];i(this,vt)[vt].unregisterTokenForGuid(e)}}else r?null!=n&&(i(this,Ct)[Ct].gcookie=n,ae.saveToLSorCookie(b,n),t=!1):this.clear(),ae.saveToLSorCookie(D,!1),s=e[0]}o.id=s,ae.saveToLSorCookie(m,o)};if(Array.isArray(e)&&e.length>0)for(const n in e)if(e.hasOwnProperty(n)){const s=e[n];let r,a={};if(null!=s.Site){if(r=s.Site,$(r)||!ot(r,{logger:i(this,bt)[bt]}))return}else if(null!=s.Facebook){const e=s.Facebook;$(e)||e.error||(r=nt(e))}else if(null!=s["Google Plus"]){const e=s["Google Plus"];$(e)&&!e.error&&(r=st(e,{logger:i(this,bt)[bt]}))}if(null!=r&&!$(r)){a.type="profile",null==r.tz&&(r.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),a.profile=r;const e=[];ae._isLocalStorageSupported()&&(r.Identity&&e.push(r.Identity),r.Email&&e.push(r.Email),r.GPID&&e.push("GP:"+r.GPID),r.FBID&&e.push("FB:"+r.FBID),e.length>0&&o(e)),rt(r,!0),a=i(this,vt)[vt].addSystemDataToObject(a,void 0),i(this,vt)[vt].addFlags(a),t&&(a.isOUL=!0);const n=Ke(JSON.stringify(a),i(this,bt)[bt]);let s=i(this,mt)[mt].dataPostURL;s=Ve(s,"type",A),s=Ve(s,"d",n),i(this,vt)[vt].saveAndFireRequest(s,le.blockRequest,t)}}},Ot=function(){le.blockRequest=!1,console.debug("Block request is false"),ae._isLocalStorageSupported()&&(delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),ae.removeCookie(y,We()),ae.removeCookie(i(this,yt)[yt].cookieName,le.broadDomain),ae.removeCookie(P,le.broadDomain),i(this,yt)[yt].setSessionCookieObject("")},Et=function(){le.blockRequest=!0,i(this,bt)[bt].debug("Block request is true"),le.globalCache={gcookie:null,REQ_N:0,RESP_N:0},ae._isLocalStorageSupported()&&(delete localStorage.WZRK_G,delete localStorage.WZRK_K,delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),ae.removeCookie(b,le.broadDomain),ae.removeCookie(y,We()),ae.removeCookie(m,We()),ae.removeCookie(i(this,yt)[yt].cookieName,le.broadDomain),ae.removeCookie(P,le.broadDomain),i(this,Ct)[Ct].gcookie=null,i(this,yt)[yt].setSessionCookieObject("")},At=function(e){if(Array.isArray(e)&&e.length>0){const t=e.pop();if(null!=t&&J(t)&&(null!=t.Site&&Object.keys(t.Site).length>0||null!=t.Facebook&&Object.keys(t.Facebook).length>0||null!=t["Google Plus"]&&Object.keys(t["Google Plus"]).length>0)){ae.setInstantDeleteFlagInK();try{i(this,kt)[kt]([t])}catch(e){i(this,bt)[bt].debug(e)}}else i(this,bt)[bt].error("Profile object is in incorrect format")}};class Lt extends HTMLElement{constructor(){super(),this._details=null,this.shadow=null,this.shadow=this.attachShadow({mode:"open"})}get details(){return this._details||""}set details(e){null===this._details&&(this._details=e,this.renderBanner())}renderBanner(){this.shadow.innerHTML=this.getBannerContent(),!1!==this.trackClick&&this.addEventListener("click",(()=>{const e=this.details.onClick;e&&(this.details.window?window.open(e,"_blank"):window.parent.location.href=e),window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId})}getBannerContent(){return'\n \n \n ")}}class Mt extends HTMLElement{constructor(){super(),this._target=null,this._carousel=null,this.shadow=null,this.slides=0,this.previouslySelectedItem=-1,this.selectedItem=1,this.autoSlide=null,this.stopAutoSlideTimeout=null,this.shadow=this.attachShadow({mode:"open"}),void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Lt)}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderCarousel())}get details(){return this.target.display.details}get display(){return this.target.display}renderCarousel(){this.slides=this.details.length,this.shadow.innerHTML=this.getStyles();const e=this.getCarouselContent();this.display.showNavBtns&&e.insertAdjacentHTML("beforeend",this.display.navBtnsHtml),this.display.showNavArrows&&(e.insertAdjacentHTML("beforeend",this.display.leftNavArrowHtml),e.insertAdjacentHTML("beforeend",this.display.rightNavArrowHtml)),this._carousel=e,this.shadow.appendChild(e),this.setupClick(),this.updateSelectedItem(),this.startAutoSlide(),this.setupOnHover(),window.clevertap.renderNotificationViewed({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot})}setupClick(){this._carousel.addEventListener("click",(e=>{const t=e.target.id;if(t.startsWith("carousel__button")){const e=+t.split("-")[1];e!==this.selectedItem&&(this.previouslySelectedItem=this.selectedItem,this.selectedItem=e,this.updateSelectedItem(),this.startAutoSlide())}else if(t.startsWith("carousel__arrow"))t.endsWith("right")?this.goToNext():this.goToPrev(),this.startAutoSlide();else if(t.indexOf("-")>-1){const e=+t.split("-")[1],i=e-1;window.parent.clevertap&&window.clevertap.renderNotificationClicked({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot,wzrk_slideNo:e});const o=this.details[i].onClick;""!==o&&(this.details[i].window?window.open(o,"_blank"):window.location.href=o)}}))}setupOnHover(){this._carousel.addEventListener("mouseenter",(e=>{this.stopAutoSlideTimeout=setTimeout((()=>{this.autoSlide=clearInterval(this.autoSlide)}),500)})),this._carousel.addEventListener("mouseleave",(e=>{clearTimeout(this.stopAutoSlideTimeout),void 0===this.autoSlide&&this.startAutoSlide()}))}getCarouselContent(){const e=document.createElement("div");return e.setAttribute("class","carousel"),this.details.forEach(((t,i)=>{const o=document.createElement("ct-web-personalisation-banner");o.classList.add("carousel__item"),o.trackClick=!1,o.setAttribute("id","carousel__item-".concat(i+1)),o.details=t,e.appendChild(o)})),e}getStyles(){var e,t;return"\n \n ")}updateSelectedItem(){if(-1!==this.previouslySelectedItem){const e=this.shadow.getElementById("carousel__item-".concat(this.previouslySelectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.previouslySelectedItem));e.classList.remove("carousel__item--selected"),t&&t.classList.remove("carousel__button--selected")}const e=this.shadow.getElementById("carousel__item-".concat(this.selectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.selectedItem));e.classList.add("carousel__item--selected"),t&&t.classList.add("carousel__button--selected")}startAutoSlide(){clearInterval(this.autoSlide),this.autoSlide=setInterval((()=>{this.goToNext()}),this.display.sliderTime?1e3*this.display.sliderTime:3e3)}goToNext(){this.goTo(this.selectedItem,(this.selectedItem+1)%this.slides)}goToPrev(){this.goTo(this.selectedItem,this.selectedItem-1)}goTo(e,t){this.previouslySelectedItem=e,this.selectedItem=t,0===t&&(this.selectedItem=this.slides),this.updateSelectedItem()}}class Tt extends HTMLElement{constructor(){super(),this._target=null,this._session=null,this.shadow=null,this.popup=null,this.container=null,this.resizeObserver=null,this.shadow=this.attachShadow({mode:"open"})}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderImageOnlyPopup())}get session(){return this._session||""}set session(e){this._session=e}get msgId(){return this.target.wzrk_id}get pivotId(){return this.target.wzrk_pivot}get onClickUrl(){return this.target.display.onClickUrl}renderImageOnlyPopup(){const e=this.target.wzrk_id.split("_")[0],t=this.session.sessionId;this.shadow.innerHTML=this.getImageOnlyPopupContent(),this.popup=this.shadowRoot.getElementById("imageOnlyPopup"),this.container=this.shadowRoot.getElementById("container"),this.closeIcon=this.shadowRoot.getElementById("close"),this.popup.addEventListener("load",this.updateImageAndContainerWidth()),this.resizeObserver=new ResizeObserver((()=>this.handleResize(this.popup,this.container))),this.resizeObserver.observe(this.popup),this.closeIcon.addEventListener("click",(()=>{if(this.resizeObserver.unobserve(this.popup),document.getElementById("wzrkImageOnlyDiv").style.display="none",this.remove(),null!=e&&"-1"!==e&&ae._isLocalStorageSupported()){const i=Xe();let o=i.wp[t];null==o&&(o={},i[t]=o),o[e]="dnd",et(i)}})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId}),this.onClickUrl&&this.popup.addEventListener("click",(()=>{this.target.display.window?window.open(this.onClickUrl,"_blank"):window.parent.location.href=this.onClickUrl,window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})}))}handleResize(e,t){const i=this.getRenderedImageWidth(e);t.style.setProperty("width","".concat(i,"px"))}getImageOnlyPopupContent(){return"\n ".concat(this.target.msgContent.css,"\n ").concat(this.target.msgContent.html,"\n ")}updateImageAndContainerWidth(){return()=>{const e=this.getRenderedImageWidth(this.popup);this.popup.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("height","auto"),this.container.style.setProperty("position","fixed"),this.popup.style.setProperty("visibility","visible"),this.closeIcon.style.setProperty("visibility","visible"),document.getElementById("wzrkImageOnlyDiv").style.visibility="visible"}}getRenderedImageWidth(e){const t=e.naturalWidth/e.naturalHeight;return e.height*t}}class Rt extends HTMLElement{constructor(e,t){super(),this.wrapper=null,this.snackBar=null,this.shadow=this.attachShadow({mode:"open"}),this.config=e,this.message=t,this.renderMessage(t)}get pivotId(){return this.message.wzrk_pivot}get campaignId(){return this.message.wzrk_id}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}renderMessage(e){switch(this.wrapper=this.createEl("div","messageWrapper"),e.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":{const t=this.prepareBasicMessage(e.msg[0]);this.wrapper.appendChild(t)}}const t=this.createEl("div","timeStamp");if(t.innerHTML="".concat(Wt(e.id.split("_")[1]),""),!e.viewed){const e=this.createEl("span","unreadMarker");t.appendChild(e)}this.wrapper.appendChild(t),this.shadow.appendChild(this.wrapper)}prepareBasicMessage(e){const t=this.createEl("div","message");if(e.imageUrl){const i=this.addImage(e.imageUrl,"mainImg");t.appendChild(i)}const i=this.createEl("div","iconTitleDescWrapper");if(e.iconUrl){const t=this.addImage(e.iconUrl,"iconImg");i.appendChild(t)}const o=this.createEl("div","titleDescWrapper");if(e.title){const t=this.createEl("div","title");t.innerText=e.title,o.appendChild(t)}if(e.description){const t=this.createEl("div","description");t.innerText=e.description,o.appendChild(t)}if((e.title||e.description)&&i.appendChild(o),(e.iconUrl||e.title||e.description)&&t.appendChild(i),e.buttons&&e.buttons.length){const i=this.addButtons(e.buttons);t.appendChild(i)}return t}addButtons(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.createEl("div","buttonsContainer");let i=!1;return e.forEach(((e,o)=>{const n=this.createEl("button","button-".concat(o),"button");n.innerText=e.text,o>0&&(n.style.cssText+="margin-left: 2px;"),"copy"===e.action&&(i=!0),t.appendChild(n)})),i&&this.addSnackbar(t),t}addSnackbar(e){this.snackBar=this.createEl("div","snackbar-".concat(this.campaignId),"snackbar"),this.snackBar.innerHTML=Gt;const t=this.createEl("span","snackbar-msg-".concat(this.campaignId),"snackbar-msg");t.innerText="Copied to clipboard",this.snackBar.appendChild(t),e.appendChild(this.snackBar)}addImage(e,t){const i=this.createEl("div","".concat(t,"Container")),o=this.createEl("img",t);return o.setAttribute("src",e),o.setAttribute("loading","lazy"),i.appendChild(o),i}raiseClickedEvent(e,t){switch(this.message.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":this.raiseClickedForBasicTemplates(e,t)}}raiseClickedForBasicTemplates(e,t){const i=this.message.msg[0],o={msgId:this.campaignId,pivotId:this.pivotId};if("BUTTON"===e.tagName){const t=e.id.split("-")[1],n=i.buttons[t];o.kv={wzrk_c2a:n.text},"url"===n.action?n.openUrlInNewTab?window.open(n.url,"_blank"):window.location=n.url:"copy"===n.action&&(window.focus(),navigator.clipboard.writeText(n.clipboardText),this.snackBar.style.setProperty("display","flex","important"),setTimeout((()=>{this.snackBar.style.setProperty("display","none","important")}),2e3))}else"CT-INBOX-MESSAGE"===e.tagName&&i.onClickUrl&&(i.openUrlInNewTab?window.open(i.onClickUrl,"_blank"):window.location=i.onClickUrl);t?console.log("Notifiction clicked event will be raised at run time with payload ::",o):window.clevertap.renderNotificationClicked(o)}}class jt extends HTMLElement{constructor(e){super(),this.isInboxOpen=!1,this.isInboxFromFlutter=!1,this.selectedCategory=null,this.unviewedMessages={},this.unviewedCounter=0,this.isPreview=!1,this.inboxConfigForPreview={},this.inboxSelector=null,this.inbox=null,this.emptyInboxMsg=null,this.inboxCard=null,this.unviewedBadge=null,this.observer=null,this.selectedCategoryRef=null,this.addClickListenerOnDocument=(()=>e=>{if(e.composedPath().includes(this.inbox)){const t=e.path||e.composedPath&&e.composedPath();if(t.length){const e=t[0].id;if("closeInbox"===e)this.toggleInbox();else if(e.startsWith("category-"))this.prevCategoryRef=this.selectedCategoryRef,this.selectedCategoryRef=t[0],this.updateActiveCategory(t[0].innerText);else{const e=t.filter((e=>{var t;return(null===(t=e.id)||void 0===t?void 0:t.startsWith("button-"))||"CT-INBOX-MESSAGE"===e.tagName}));if(e.length){e[e.length-1].raiseClickedEvent(e[0],this.isPreview)}}}}else(this.inboxSelector.contains(e.target)||this.isInboxOpen)&&(this.isInboxFromFlutter?this.isInboxFromFlutter=!1:this.toggleInbox(e))})(),this.setBadgeStyle=e=>{null!==this.unviewedBadge&&(this.unviewedBadge.innerText=e>9?"9+":e,this.unviewedBadge.style.display=e>0?"flex":"none")},this.logger=e,this.shadow=this.attachShadow({mode:"open"})}get incomingMessages(){return[]}set incomingMessages(e){void 0===e&&(e=[]),e.length>0&&this.inbox&&this.updateInboxMessages(e)}get incomingMessagesForPreview(){return[]}set incomingMessagesForPreview(e){void 0===e&&(e=[]);const t={};e.length>0&&this.inbox&&(this.isPreview=!0,this.unviewedCounter=0,e.forEach((e=>{const i="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=i,t[i]=e,this.unviewedMessages[i]=e,this.unviewedCounter++})),this.buildUIForMessages(t),this.updateUnviewedBadgeCounter())}connectedCallback(){this.init()}init(){this.config=this.isPreview?this.inboxConfigForPreview:ae.readFromLSorCookie(q)||{},0!==Object.keys(this.config).length&&(this.inboxSelector=document.getElementById(this.config.inboxSelector),null!==this.inboxSelector&&(this.config.styles.notificationsBadge?this.addUnviewedBadge():this.unviewedBadge&&this.unviewedBadge.remove(),this.createinbox(),document.removeEventListener("click",this.addClickListenerOnDocument),document.addEventListener("click",this.addClickListenerOnDocument),this.config.categories.length&&this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadow.innerHTML=this.getInboxStyles(),this.shadow.appendChild(this.inbox)))}addMsgsToInboxFromLS(){const e=this.deleteExpiredAndGetUnexpiredMsgs(!1),t=e?Object.keys(e):[];0!==t.length&&(t.forEach((t=>{e[t].viewed||(this.unviewedMessages[t]=e[t],this.unviewedCounter++)})),this.buildUIForMessages(e),this.updateUnviewedBadgeCounter())}deleteExpiredAndGetUnexpiredMsgs(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Nt();const i=Math.floor(Date.now()/1e3);for(const o in t)if(t[o].wzrk_ttl&&t[o].wzrk_ttl>0&&t[o].wzrk_ttl0&&(t=Object.values(t).sort(((e,t)=>t.date-e.date)).reduce(((e,t)=>(e[t.id]=t,e)),{})),Ft(t),t}updateInboxMessages(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.deleteExpiredAndGetUnexpiredMsgs(),i=Date.now(),o={};e.forEach(((e,n)=>{const s="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=s,e.date=i-n,e.viewed=0,t[s]=e,o[s]=e,this.unviewedMessages[s]=e,this.unviewedCounter++})),Ft(t),this.buildUIForMessages(o),this.updateUnviewedBadgeCounter()}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}addUnviewedBadge(){this.unviewedBadge||(this.unviewedBadge=this.createEl("div","unviewedBadge"),this.unviewedBadge.style.cssText="display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ".concat(this.config.styles.notificationsBadge.backgroundColor,"; font-size: 12px; color: ").concat(this.config.styles.notificationsBadge.textColor,"; font-weight: bold; align-items: center; justify-content: center;"),document.body.appendChild(this.unviewedBadge)),this.updateUnviewedBadgePosition(),window.addEventListener("resize",(()=>{this.updateUnviewedBadgePosition()}))}updateUnviewedBadgePosition(){const{top:e,right:t}=this.inboxSelector.getBoundingClientRect();this.unviewedBadge.style.top="".concat(e-8,"px"),this.unviewedBadge.style.left="".concat(t-8,"px")}createinbox(){this.inbox=this.createEl("div","inbox");const e=this.createEl("div","header"),t=this.createEl("div","headerTitle");t.innerText=this.config.title;const i=this.createEl("div","closeInbox");if(i.innerHTML="×",e.appendChild(t),e.appendChild(i),this.inbox.appendChild(e),this.config.categories.length){const e=this.createCategories();this.inbox.appendChild(e)}this.inboxCard=this.createEl("div","inboxCard"),this.inbox.appendChild(this.inboxCard),this.emptyInboxMsg=this.createEl("div","emptyInboxMsg"),this.emptyInboxMsg.innerText="All messages will be displayed here.",this.inboxCard.appendChild(this.emptyInboxMsg);const o={root:this.inboxCard,rootMargin:"0px",threshold:.5};this.observer=new IntersectionObserver(((e,t)=>{this.handleMessageViewed(e)}),o),this.addMsgsToInboxFromLS()}createCategories(){const e=this.createEl("div","categoriesContainer"),t=this.createEl("div","leftArrow");t.innerHTML=Ht,t.children[0].style="transform: rotate(180deg)",t.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(-70,0)})),e.appendChild(t);const i=this.createEl("div","categoriesWrapper");["All",...this.config.categories].forEach(((e,t)=>{const o=this.createEl("div","category-".concat(t),"category");o.innerText=e,0===t&&(this.selectedCategoryRef=o),i.appendChild(o)})),e.appendChild(i);const o=this.createEl("div","rightArrow");o.innerHTML=Ht,o.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(70,0)})),e.appendChild(o);const n={root:e,threshold:.9},s=i.children[0],r=i.children[this.config.categories.length];new IntersectionObserver((e=>{this.categoryObserverCb(t,e[0].intersectionRatio>=.9)}),n).observe(s);return new IntersectionObserver((e=>{this.categoryObserverCb(o,e[0].intersectionRatio>=.9)}),n).observe(r),e}categoryObserverCb(e,t){e&&(e.style.display=t?"none":"flex")}updateActiveCategory(e){this.selectedCategory=e,this.inboxCard.scrollTop=0;let t=0;this.prevCategoryRef&&this.prevCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef.setAttribute("selected","true"),this.inboxCard.childNodes.forEach((e=>{"emptyInboxMsg"!==e.getAttribute("id")&&(e.style.display="All"===this.selectedCategory||e.getAttribute("category")===this.selectedCategory?"block":"none","block"===e.style.display&&t++)})),0===t?(this.emptyInboxMsg.innerText="".concat(e," messages will be displayed here."),this.emptyInboxMsg.style.display="block"):this.emptyInboxMsg.style.display="none"}buildUIForMessages(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!this.isPreview&&this.updateTSForRenderedMsgs(),this.inboxCard.scrollTop=0;const i=null!==(e=this.config.maxMsgsInInbox)&&void 0!==e?e:15,o=this.inboxCard.firstChild,n=Object.values(t).sort(((e,t)=>t.date-e.date)).map((e=>e.id));for(const e of n){const i=new Rt(this.config,t[e]);i.setAttribute("id",t[e].id),i.setAttribute("pivot",t[e].wzrk_pivot),i.setAttribute("part","ct-inbox-message"),this.config.categories.length>0?(i.setAttribute("category",t[e].tags[0]||""),i.style.display="All"===this.selectedCategory||t[e].category===this.selectedCategory?"block":"none"):i.style.display="block",this.inboxCard.insertBefore(i,o),this.observer.observe(i)}let s=this.inboxCard.querySelectorAll("ct-inbox-message").length;for(;s>i;){const e=this.inboxCard.querySelectorAll("ct-inbox-message");e.length>0&&e[e.length-1].remove(),s--}const r=this.inboxCard.querySelectorAll('ct-inbox-message[style*="display: block"]').length;this.emptyInboxMsg.style.display=r?"none":"block"}handleMessageViewed(e){const t=!this.isPreview;this.isInboxOpen&&e.forEach((e=>{e.isIntersecting&&this.unviewedMessages.hasOwnProperty(e.target.id)&&0===e.target.message.viewed&&(e.target.message.viewed=1,t?(window.clevertap.renderNotificationViewed({msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.updateMessageInLS(e.target.id,{...e.target.message,viewed:1}),setTimeout((()=>{e.target.shadowRoot.getElementById("unreadMarker").style.display="none"}),1e3)):console.log("Notifiction viewed event will be raised at run time with payload ::",{msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.unviewedCounter--,this.updateUnviewedBadgeCounter(),delete this.unviewedMessages[e.target.id])}))}updateMessageInLS(e,t){if(!this.isPreview){const i=Nt();i[e]=t,Ft(i)}}toggleInbox(e){this.isInboxOpen=!this.isInboxOpen,this.isInboxFromFlutter=!!(null==e?void 0:e.rect),this.isInboxOpen?(this.inboxCard.scrollTop=0,!this.isPreview&&this.deleteExpiredAndGetUnexpiredMsgs(),this.inbox.style.display="block",this.inbox.style.zIndex="2147483647",this.config.categories.length&&(this.selectedCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef=this.shadowRoot.getElementById("category-0"),this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadowRoot.getElementById("categoriesWrapper").scrollLeft-=this.shadowRoot.getElementById("categoriesWrapper").scrollWidth),this.setInboxPosition(e)):this.inbox.style.display="none"}setInboxPosition(e){const t=window.outerWidth,i=getComputedStyle(le.inbox),o=i.getPropertyValue("--inbox-top"),n=i.getPropertyValue("--inbox-bottom"),s=i.getPropertyValue("--inbox-left"),r=i.getPropertyValue("--inbox-right");if(t>481&&!(o||n||s||r)){const t=Vt(e,this.inbox.clientHeight,this.inbox.clientWidth),i=t.xPos,o=t.yPos;this.inbox.style.top=o+"px",this.inbox.style.left=i+"px"}}updateUnviewedBadgeCounter(){if(this.isPreview)return void this.setBadgeStyle(this.unviewedCounter);let e=0;this.inboxCard.querySelectorAll("ct-inbox-message").forEach((t=>{const i=Nt();i[t.id]&&0===i[t.id].viewed&&e++})),this.setBadgeStyle(e)}updateTSForRenderedMsgs(){this.inboxCard.querySelectorAll("ct-inbox-message").forEach((e=>{const t=e.id.split("_")[1];e.shadow.getElementById("timeStamp").firstChild.innerText=Wt(t)}))}getInboxStyles(){const e=this.config.categories.length?64:16,t={panelBackgroundColor:this.config.styles.panelBackgroundColor,panelBorderColor:this.config.styles.panelBorderColor,headerBackgroundColor:this.config.styles.header.backgroundColor,headerTitleColor:this.config.styles.header.titleColor,closeIconColor:this.config.styles.closeIconColor,categoriesTabColor:this.config.styles.categories.tabColor,categoriesTitleColor:this.config.styles.categories.titleColor,selectedCategoryTabColor:this.config.styles.categories.selectedTab.tabColor,selectedCategoryTitleColor:this.config.styles.categories.selectedTab.titleColor,headerCategoryHeight:36+e};this.config.styles.categories.borderColor&&(t.categoriesBorderColor=this.config.styles.categories.borderColor),this.config.styles.categories.selectedTab.borderColor&&(t.selectedCategoryBorderColor=this.config.styles.categories.selectedTab.borderColor);const i=(e=>{let{panelBackgroundColor:t,panelBorderColor:i,headerBackgroundColor:o,headerTitleColor:n,closeIconColor:s,categoriesTabColor:r,categoriesTitleColor:a,categoriesBorderColor:l,selectedCategoryTabColor:c,selectedCategoryTitleColor:d,selectedCategoryBorderColor:h,headerCategoryHeight:u}=e;return'\n \n ")})(t),o=this.config.styles.cards;return i+(e=>{let{backgroundColor:t,borderColor:i,titleColor:o,descriptionColor:n,buttonColor:s,buttonTextColor:r,unreadMarkerColor:a}=e;return'\n \n ")})({backgroundColor:o.backgroundColor,borderColor:o.borderColor,titleColor:o.titleColor,descriptionColor:o.descriptionColor,buttonColor:o.buttonColor,buttonTextColor:o.buttonTextColor,unreadMarkerColor:o.unreadMarkerColor})}}const Dt=e=>{e.inbox_preview?le.inbox.incomingMessagesForPreview=e.inbox_notifs:le.inbox.incomingMessages=e},zt=e=>{qt(),le.inbox=new jt({logger:e}),document.body.appendChild(le.inbox)},Bt=e=>{const t=ae.readFromLSorCookie(V)||{};if(Object.keys(t).length>0&&Object.keys(t)[0].includes("_")){const i={};return i[e]=t,ae.saveToLSorCookie(V,i),i}return t},Nt=()=>{const e=JSON.parse(decodeURIComponent(ae.read(b)));if(!X(e))return{};const t=Bt(e);return t.hasOwnProperty(e)?t[e]:{}},Ft=e=>{const t=JSON.parse(decodeURIComponent(ae.read(b)));if(!X(t))return;const i={...Bt(t),[t]:e};ae.saveToLSorCookie(V,i)},Ut=e=>new Promise(((t,i)=>{if("complete"===document.readyState)zt(e),t();else{const i=ae.readFromLSorCookie(q)||{},o=()=>{null===le.inbox&&zt(e),t()};window.addEventListener("load",(()=>{if(document.getElementById(i.inboxSelector))o();else{let n=0;if(n<20){const s=setInterval((()=>{document.getElementById(i.inboxSelector)?(o(),clearInterval(s),t()):n>=20&&(clearInterval(s),e.debug("Failed to add inbox")),n++}),500)}}}))}})),qt=()=>{void 0===customElements.get("ct-web-inbox")&&(customElements.define("ct-web-inbox",jt),customElements.define("ct-inbox-message",Rt))},Vt=(e,t,i)=>{const o=document.scrollingElement.scrollLeft,n=document.scrollingElement.scrollTop,s=window.innerWidth+o,r=window.innerHeight+n,a=e.rect||e.target.getBoundingClientRect(),l=a.x+o,c=a.y+n,d=a.left+o,h=a.right+o,u=a.top+n,p=a.bottom,g=a.height,f=a.width;let v,b,m=!1;const y=16;if(p+t<=r){const e=r-(p+t);b=e>=y?p+y:p+e}else if(u-t>=n){const e=u-t;b=e>=y?u-t-y:u-t-e}else m=!0,b=c+g/2-t/2,br&&(b=r-t);if(m){const e=h+i;if(e<=s){v=h+(e+y<=s?y:s-e)}else{const e=d-i;v=e-(e-y>=o?y:e-o)}}else v=l+f/2-i/2,vs&&(v=h-i>=o?h-i:s-i);return{xPos:v,yPos:b}},Wt=e=>{const t=Date.now();let i=Math.floor((t-e)/6e4);return i<5?"Just now":i<60?"".concat(i," minute").concat(i>1?"s":""," ago"):(i=Math.floor(i/60),i<24?"".concat(i," hour").concat(i>1?"s":""," ago"):(i=Math.floor(i/24),"".concat(i," day").concat(i>1?"s":""," ago")))},Kt=()=>Object.keys(ae.readFromLSorCookie(q)||{}).length>0,Ht='\n\n\n',Gt='\n\n\n';let Jt;function Zt(){document.body.innerHTML="",Jt=document.createElement("div"),Jt.id="app2",Jt.style.position="relative",Jt.style.display="flex",document.body.appendChild(Jt);var e,t,i,o,n,s,r,a,l;(function(e){return new Promise(((t,i)=>{var o=document.createElement("script");o.type="module",o.src=e,o.onload=function(){"function"==typeof window.Overlay?(window.Overlay("#app2","http://localhost:8080/randomPage"),t()):i(new Error("ContentLayout not found in overlay.js"))},o.onerror=function(e){i(e)},document.head.appendChild(o)}))})("https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js").then((()=>{console.log("Overlay script loaded successfully.")})).catch((e=>{console.error("Error loading overlay script:",e)})),(e=document.createElement("link")).rel="stylesheet",e.type="text/css",e.href="https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css",document.head.appendChild(e),i={kitId:"eqj6nom",scriptTimeout:3e3,async:!0},o=document,n=o.documentElement,s=setTimeout((function(){n.className=n.className.replace(/\bwf-loading\b/g,"")+" wf-inactive"}),i.scriptTimeout),r=o.createElement("script"),a=!1,l=o.getElementsByTagName("script")[0],n.className+=" wf-loading",r.src="https://use.typekit.net/"+i.kitId+".js",r.async=!0,r.onload=r.onreadystatechange=function(){if(t=this.readyState,!(a||t&&"complete"!==t&&"loaded"!==t)){a=!0,clearTimeout(s);try{Typekit.load(i)}catch(e){}}},l.parentNode.insertBefore(r,l)}const $t=(e,t)=>{const i=e.display.details[0],o=Object.keys(i)[0],n=i[o];if(o===window.location.href)for(const i in n){const o=document.querySelector(i);if(o)o.outerHTML=n[i].html,t||window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot});else{let o=0;const s=setInterval((()=>{const r=document.querySelector(i);r?(r.outerHTML=n[i].html,t||window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot}),clearInterval(s)):(o++,o>=20&&(console.log("No element present on DOM with selector '".concat(i,"'.")),clearInterval(s)))}),500)}}},Yt=(e,t)=>{let{device:i,session:o,request:n,logger:s}=t;const r=i,a=o,l=n,c=s;let d=0;e={arp:{j_n:"Zw==",i_n:"Y2NmewICAw==",d_ts:0,dh:0,v:1,j_s:"{ }",id:"WWW-WWW-WWRZ",e_ts:0,r_ts:1649748826,rc_w:60,rc_n:5},inapp_notifs:[{msgContent:{templateType:"point-and-click",type:4},display:{divId:"hero-banner",details:[{"http://localhost:3000/":{".heroDi1v":{html:'Hello Sonam'},"#selector_2":{html:'

Hello Sonam

'}}}],wtarget_type:2,wmc:1,ff:"Desktop"},wzrk_id:"1655316906_20220620",wzrk_pivot:"wzrk_default"}]};const h=t=>{const i=t.wzrk_id.split("_")[0],o=ie(),n=(e,t,i)=>{let o=0,n=0;null!=e[t]&&(o=e[t]),o++,null!=e.tc&&(n=e.tc),i<0&&n++,e.tc=n,e[t]=o};if(ae._isLocalStorageSupported()){delete sessionStorage.WZRK_CAMP;var s={};const e=Xe();s=3===t.display.wtarget_type&&e.hasOwnProperty("wi")?e.wi:0!==t.display.wtarget_type&&1!==t.display.wtarget_type||!e.hasOwnProperty("wp")?{}:e.wp,e.hasOwnProperty("global")&&(s.wp=e),null==t.display.wmc&&(t.display.wmc=1),null==t.display.wimc&&(t.display.wimc=1);var d=-1;let n=-1,r=-1,l=-1,c=-1,g=-1,f=-1;null!=t.display.efc&&(d=parseInt(t.display.efc,10)),null!=t.display.mdc&&(n=parseInt(t.display.mdc,10)),null!=t.display.tdc&&(r=parseInt(t.display.tdc,10)),null!=t.display.tlc&&(l=parseInt(t.display.tlc,10)),null!=t.display.wmp&&(c=parseInt(t.display.wmp,10)),null!=t.display.wmc&&(g=parseInt(t.display.wmc,10)),null!=t.display.wimc&&(f=parseInt(t.display.wimc,10));var h=s[a.sessionId];if(h){const e=h[i],o=h.tc;if("dnd"===e&&!le.dismissSpamControl)return!1;if(3===t.display.wtarget_type){if(f>0&&o>=f&&d<0)return!1}else if(g>0&&o>=g&&d<0)return!1;if(n>0&&e>=n)return!1}else h={},s[a.sessionId]=h;var u=s[o];if(null!=u){const e=u[i],t=u.tc;if(c>0&&t>=c&&d<0)return!1;if(r>0&&e>=r)return!1}else u={},s[o]=u;var p=s.global;if(null!=p){const e=p[i];if(l>0&&e>=l)return!1}else p={},s.global=p}if(null!=t.display.delay&&t.display.delay>0){const i=t.display.delay;return t.display.delay=0,setTimeout(Yt,1e3*i,e,{device:r,session:a,request:l,logger:c}),!1}n(h,i,d),n(u,i,d),n(p,i,d);let g="wp";3===t.display.wtarget_type&&(g="wi");const f={};f[a.sessionId]=h,f[o]=u,f.global=p,et({[g]:f})},u=()=>{const e=r.getGuid(),t=a.getSessionCookieObject();return"&t=wc&d="+encodeURIComponent(Ge(e+"|"+t.p+"|"+t.s))},p=(e,t)=>{const i=window.parent[e];"function"==typeof i&&(null!=t.display.kv?i(t.display.kv):i())},g=(e,t,i,o,n)=>{f(t),((e,t,i,o,n)=>{if(""!==e&&null!=e){let o,s;n?o=i:null!==i&&(s=i.getElementsByClassName("jsCT_CTA"),null!=s&&1===s.length&&(o=s[0]));const r=t.display.jsFunc,l=t.display.preview;null==l&&(e+=u()),null!=o&&(o.onclick=()=>{if(null!=r)return null==l&&Qe.fireRequest(e),p(r,t),void at("-1",0,a.sessionId);1===t.display.window?window.open(e,"_blank"):window.location=e})}})(e,t,i,0,n)},f=e=>{const t={type:"event"};t.evtName=R,t.evtData={[T]:e.wzrk_id},e.wzrk_pivot&&(t.evtData={...t.evtData,wzrk_pivot:e.wzrk_pivot}),l.processEvent(t)},v=e=>{var t;void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Lt);const i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,o=document.createElement("ct-web-personalisation-banner");o.msgId=e.wzrk_id,o.pivotId=e.wzrk_pivot,o.divHeight=e.display.divHeight,o.details=e.display.details[0];const n=e.display.divId?document.getElementById(i):document.querySelector(i);n.innerHTML="",n.appendChild(o)},m=e=>{var t;void 0===customElements.get("ct-web-personalisation-carousel")&&customElements.define("ct-web-personalisation-carousel",Mt);const i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,o=document.createElement("ct-web-personalisation-carousel");o.target=e;const n=e.display.divId?document.getElementById(i):document.querySelector(i);n.innerHTML="",n.appendChild(o)},y=e=>{const t=e.wzrk_id.split("_")[0],i=e.display;if(2===i.wtarget_type&&1===e.msgContent.type){const t={};t.msgId=e.wzrk_id,e.wzrk_pivot&&(t.pivotId=e.wzrk_pivot),null!=e.msgContent.kv&&(t.kv=e.msgContent.kv);const i=new CustomEvent("CT_web_native_display",{detail:t});return void document.dispatchEvent(i)}if(1===i.layout)return _(void 0,e);if(3===i.layout){const t="wzrkImageOnlyDiv";if(!1===h(e))return;if(le.dismissSpamControl&&null!=document.getElementById(t)){document.getElementById(t).remove()}if(null!=document.getElementById(t)||null!=document.getElementById("intentPreview"))return;const i=document.createElement("div");return i.id=t,document.body.appendChild(i),void 0===customElements.get("ct-web-popup-imageonly")&&customElements.define("ct-web-popup-imageonly",Tt),(e=>{const t=document.createElement("ct-web-popup-imageonly");t.session=a,t.target=e;const i=document.getElementById("wzrkImageOnlyDiv");i.innerHTML="",i.style.visibility="hidden",i.appendChild(t)})(e)}if(!1===h(e))return;const o="wizParDiv"+i.layout;if(le.dismissSpamControl&&null!=document.getElementById(o)){document.getElementById(o).remove()}if(null!=document.getElementById(o))return;le.campaignDivMap[t]=o;const n=2===i.layout,s=document.createElement("div");s.id=o;const r=window.innerHeight,l=window.innerWidth;let c=!1;if(n)s.setAttribute("style",i.iFrameStyle);else{var d=10;let e=5*l/100,t=d+5*r/100,o=30*l/100+20,n="width:30%;";(/mobile/i.test(navigator.userAgent)||/mini/i.test(navigator.userAgent))&&!1===/iPad/i.test(navigator.userAgent)?(o=85*l/100+20,e=5*l/100,t=5*r/100,n="width:80%;"):("ontouchstart"in window||/tablet/i.test(navigator.userAgent))&&(o=50*l/100+20,e=5*l/100,t=5*r/100,n="width:50%;"),null==i.proto?(c=!0,s.setAttribute("style","display:block;overflow:hidden; bottom:"+t+"px !important;width:"+o+"px !important;right:"+e+"px !important;position:fixed;z-index:2147483647;")):s.setAttribute("style",n+i.iFrameStyle)}document.body.appendChild(s);const u=document.createElement("iframe"),p=!1===i.br?"0":"8";u.frameborder="0px",u.marginheight="0px",u.marginwidth="0px",u.scrolling="no",u.id="wiz-iframe";const f=e.display.onClick;let v,b="";if(""!==f&&null!=f&&(b="cursor:pointer;"),1===e.msgContent.type)v=e.msgContent.html,v=v.replace(/##campaignId##/g,t),v=v.replace(/##campaignId_batchId##/g,e.wzrk_id);else{const i='";let n,s,r,a,l;"dark"===e.display.theme?(n="#2d2d2e",s="#eaeaea",r="#353535",a="#353535",l="#ffffff"):(n="#ffffff",s="#000000",a="#f4f4f4",r="#a5a6a6",l="#ffffff");const c=e.msgContent.title,d=e.msgContent.description;let h="";null!=e.msgContent.imageUrl&&""!==e.msgContent.imageUrl&&(h="");v=i+("
×
"+h+"
"+c+"
")+("
"+d+"
")}u.setAttribute("style","z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;"),s.appendChild(u);const m=(u.contentWindow?u.contentWindow:u.contentDocument.document?u.contentDocument.document:u.contentDocument).document,y=new Event("CT_campaign_rendered");document.dispatchEvent(y),m.open(),m.write(v),i["custom-editor"]&&k(e,m),m.close();const w=()=>{d=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv").scrollHeight,!0===i["custom-editor"]||n||(d+=25),document.getElementById("wiz-iframe").contentDocument.body.style.margin="0px",document.getElementById("wiz-iframe").style.height=d+"px"},C=navigator.userAgent.toLowerCase();if(-1!==C.indexOf("safari"))if(C.indexOf("chrome")>-1)u.onload=()=>{w();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)};else{let t=u.contentDocument||u.contentWindow;t.document&&(t=t.document),w();const i=setInterval((()=>{if("complete"===t.readyState){clearInterval(i),w();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)}}),10)}else u.onload=()=>{w();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)}},k=(e,t)=>{const i=t.createElement("script");i.innerHTML="\n const ct__camapignId = '".concat(e.wzrk_id,"';\n const ct__formatVal = (v) => {\n return v && v.trim().substring(0, 20);\n }\n const ct__parentOrigin = window.parent.origin;\n document.body.addEventListener('click', (event) => {\n const elem = event.target.closest?.('a[wzrk_c2a], button[wzrk_c2a]');\n if (elem) {\n const {innerText, id, name, value, href} = elem;\n const clickAttr = elem.getAttribute('onclick') || elem.getAttribute('click');\n const onclickURL = clickAttr?.match(/(window.open)[(](\"|')(.*)(\"|',)/)?.[3] || clickAttr?.match(/(location.href *= *)(\"|')(.*)(\"|')/)?.[3];\n const props = {innerText, id, name, value};\n let msgCTkv = Object.keys(props).reduce((acc, c) => {\n const formattedVal = ct__formatVal(props[c]);\n formattedVal && (acc['wzrk_click_' + c] = formattedVal);\n return acc;\n }, {});\n if(onclickURL) { msgCTkv['wzrk_click_' + 'url'] = onclickURL; }\n if(href) { msgCTkv['wzrk_click_' + 'c2a'] = href; }\n const notifData = { msgId: ct__camapignId, msgCTkv, pivotId: '").concat(e.wzrk_pivot,"' };\n window.parent.clevertap.renderNotificationClicked(notifData);\n }\n });\n "),t.body.appendChild(i)};let x=!1;const S=e=>{let t=e.display.onClick;if(window.clevertap.hasOwnProperty("notificationCallback")&&void 0!==window.clevertap.notificationCallback&&"function"==typeof window.clevertap.notificationCallback){const i=window.clevertap.notificationCallback;if(!x){const o={};o.msgContent=e.msgContent,o.msgId=e.wzrk_id,e.wzrk_pivot&&(o.pivotId=e.wzrk_pivot),null!=e.display.kv&&(o.kv=e.display.kv),window.clevertap.raiseNotificationClicked=()=>{if(""!==t&&null!=t){const i=e.display.jsFunc;if(t+=u(),null!=i)return Qe.fireRequest(t),void p(i,e);1===e.display.window?window.open(t,"_blank"):window.location=t}},window.clevertap.raiseNotificationViewed=()=>{f(e)},i(o),x=!0}}else if(window.clevertap.popupCurrentWzrkId=e.wzrk_id,y(e),window.clevertap.hasOwnProperty("popupCallbacks")&&void 0!==window.clevertap.popupCallbacks&&"function"==typeof window.clevertap.popupCallbacks[e.wzrk_id]){const t=window.clevertap.popupCallbacks[e.wzrk_id],n={};n.msgContent=e.msgContent,n.msgId=e.wzrk_id,e.wzrk_pivot&&(n.pivotId=e.wzrk_pivot);var i=[];for(var o in e)if(o.startsWith(M)&&o!==T){const t={[o]:e[o]};i.push(t)}i.length>0&&(n.msgCTkv=i),null!=e.display.kv&&(n.kv=e.display.kv),window.clevertap.raisePopupNotificationClicked=t=>{if(!t||!t.msgId)return;const i={type:"event"};if(i.evtName=j,i.evtData={[T]:t.msgId},e.wzrk_pivot&&(i.evtData={...i.evtData,wzrk_pivot:t.pivotId}),t.msgCTkv)for(var o of t.msgCTkv)i.evtData={...i.evtData,...o};l.processEvent(i)},t(n)}};let I;const _=(e,t)=>{let i;if(null!=e&&e.clientY>0)return;if(i=null==t?I:t,le.dismissSpamControl&&0===i.display.wtarget_type&&null!=document.getElementById("intentPreview")&&null!=document.getElementById("intentOpacityDiv")){document.getElementById("intentPreview").remove(),document.getElementById("intentOpacityDiv").remove()}if(null!=document.getElementById("intentPreview")||null!=document.getElementById("wzrkImageOnlyDiv"))return;if(null==i.display.layout&&(/mobile/i.test(navigator.userAgent)||/mini/i.test(navigator.userAgent)||/iPad/i.test(navigator.userAgent)||"ontouchstart"in window||/tablet/i.test(navigator.userAgent)))return;if(!1===h(i))return;const o=i.wzrk_id.split("_")[0];le.campaignDivMap[o]="intentPreview";let n=!1;const s=document.createElement("div");s.id="intentOpacityDiv";const r=i.display.opacity||.7,a="rgba(0,0,0,".concat(r,")");s.setAttribute("style","position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ".concat(a,";")),document.body.appendChild(s);const l=document.createElement("div");l.id="intentPreview",null==i.display.proto?(n=!0,l.setAttribute("style","display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;")):l.setAttribute("style",i.display.iFrameStyle),document.body.appendChild(l);const c=document.createElement("iframe"),d=!1===i.display.br?"0":"8";c.frameborder="0px",c.marginheight="0px",c.marginwidth="0px",c.scrolling="no",c.id="wiz-iframe-intent";const u=i.display.onClick;let p,f="";if(""!==u&&null!=u&&(f="cursor:pointer;"),1===i.msgContent.type)p=i.msgContent.html,p=p.replace(/##campaignId##/g,o),p=p.replace(/##campaignId_batchId##/g,i.wzrk_id);else{const e='";let t,n,s,r;"dark"===i.display.theme?(t="#2d2d2e",n="#eaeaea",s="#353535",r="#ffffff"):(t="#ffffff",n="#000000",s="#a5a6a6",r="#ffffff");const a=i.msgContent.title,l=i.msgContent.description;let c="";null!=i.msgContent.ctaText&&""!==i.msgContent.ctaText&&(c="");let h="";null!=i.msgContent.imageUrl&&""!==i.msgContent.imageUrl&&(h="
+a+
");p=e+("
×
"+a+"
")+("
"+l+"
"+h+c+"
")}c.setAttribute("style","z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;"),l.appendChild(c);const v=(c.contentWindow?c.contentWindow:c.contentDocument.document?c.contentDocument.document:c.contentDocument).document,b=new Event("CT_campaign_rendered");document.dispatchEvent(b),v.open(),v.write(p),i.display["custom-editor"]&&k(i,v),v.close();const m=document.getElementById("wiz-iframe-intent").contentDocument.getElementById("contentDiv");g(u,i,m,0,n)};if(!document.body)return void(d<6&&(d++,setTimeout(Yt,1e3,e,{device:r,session:a,request:l,logger:c})));const O=e=>{Object.keys(e).map((t=>{var i,o;e[t].display.divId?(i=e[t].display.divId,o=document.getElementById(i)):(i=e[t].display.divSelector,o=document.querySelector(i)),null!==o&&(2===e[t].msgContent.type?v(e[t]):m(e[t]),delete e[t])}))};if(null!=e.inapp_notifs){const t={};for(let i=0;i{window.addEventListener("load",(()=>{let t=0;if(t<20){const i=setInterval((()=>{O(e),0!==Object.keys(e).length&&20!==t||(clearInterval(i),e={}),t++}),500)}}))})(t))}const E=()=>{if(e.inbox_preview)Dt(e);else if(e.inbox_notifs){const t=[];for(let i=0;i1&&void 0!==arguments[1]&&arguments[1];const i=ae.readFromLSorCookie(q)||{};t?(le.inbox.inboxConfigForPreview=e,le.inbox.isPreview=!0,le.inbox&&le.inbox.init()):JSON.stringify(i)!==JSON.stringify(e)&&(ae.saveToLSorCookie(q,e),le.inbox&&le.inbox.init())}(e.webInboxSetting),Ut(c).then((()=>{E()})).catch((e=>{}))):E()),e.vars)return void le.variableStore.mergeVariables(e.vars);const A=(e,t)=>{const i=Xe(),o=i[t].global;if(null!=o&&t)for(const i in e)if(e.hasOwnProperty(i)&&(delete o[e[i]],ae.read(w))){const o=JSON.parse(decodeURIComponent(ae.read(w))),n=JSON.parse(decodeURIComponent(ae.read(b)));o[n]&&o[n][t]&&o[n][t][e[i]]&&(delete o[n][t][e[i]],ae.save(w,encodeURIComponent(JSON.stringify(o))))}et(i)};if(ae._isLocalStorageSupported())try{if(null!=e.evpr){const t=e.evpr.events,i=e.evpr.profile,o=e.evpr.expires_in,n=oe();ae.setMetaProp("lsTime",n),ae.setMetaProp("exTs",o),(e=>{if(null!=le.globalEventsMap||(le.globalEventsMap=ae.readFromLSorCookie(C),null!=le.globalEventsMap)){for(const t in e)if(e.hasOwnProperty(t)){const i=le.globalEventsMap[t],o=e[t];null!=le.globalEventsMap[t]?null!=o[0]&&o[0]>i[0]&&(le.globalEventsMap[t]=o):le.globalEventsMap[t]=o}}else le.globalEventsMap=e})(t),ae.saveToLSorCookie(C,le.globalEventsMap),null==le.globalProfileMap?rt(i,!0):rt(i,!1)}null!=e.arp&&(e=>{if(null!=e.skipResARP&&e.skipResARP)return console.debug("Update ARP Request rejected",e),null;const t=!0===e.isOUL;if(ae._isLocalStorageSupported())try{let i=ae.readFromLSorCookie(P);if(null==i||t){i={};for(const t in e)e.hasOwnProperty(t)&&(-1===e[t]?delete i[t]:i[t]=e[t]);ae.saveToLSorCookie(P,i)}}catch(e){console.error("Unable to parse ARP JSON: "+e)}})(e.arp),null!=e.inapp_stale&&e.inapp_stale.length>0&&A(e.inapp_stale,"wp"),null!=e.inbox_stale&&e.inbox_stale.length>0&&A(e.inbox_stale,"wi")}catch(e){c.error("Unable to persist evrp/arp: "+e)}};var Qt=t("isPersonalisationActive");class Xt{constructor(e){let{isPersonalisationActive:t}=e;Object.defineProperty(this,Qt,{writable:!0,value:void 0}),i(this,Qt)[Qt]=t}getTotalVisits(){if(!i(this,Qt)[Qt]())return;let e=ae.getMetaProp("sc");return null==e&&(e=1),e}getLastVisit(){if(!i(this,Qt)[Qt]())return;const e=ae.getMetaProp("ps");return null!=e?new Date(1e3*e):void 0}}const ei=1,ti=2,ii=3,oi=4;var ni=t("logLevel"),si=t("log"),ri=t("isLegacyDebug");class ai{constructor(e){Object.defineProperty(this,ri,{get:ci,set:void 0}),Object.defineProperty(this,si,{value:li}),Object.defineProperty(this,ni,{writable:!0,value:void 0}),this.wzrkError={},i(this,ni)[ni]=null==e?e:ti,this.wzrkError={}}get logLevel(){return i(this,ni)[ni]}set logLevel(e){i(this,ni)[ni]=e}error(e){i(this,ni)[ni]>=ei&&i(this,si)[si]("error",e)}info(e){i(this,ni)[ni]>=ti&&i(this,si)[si]("log",e)}debug(e){(i(this,ni)[ni]>=ii||i(this,ri)[ri])&&i(this,si)[si]("debug",e)}debugPE(e){i(this,ni)[ni]>=oi&&i(this,si)[si]("debug_pe",e)}reportError(e,t){this.wzrkError.c=e,this.wzrkError.d=t,this.error("".concat(Ce," ").concat(e,": ").concat(t))}}var li=function(e,t){if(window.console)try{const i=(new Date).getTime();console[e]("CleverTap [".concat(i,"]: ").concat(t))}catch(e){}},ci=function(){return"undefined"!=typeof sessionStorage&&""===sessionStorage.WZRK_D},di=t("logger"),hi=t("sessionId"),ui=t("isPersonalisationActive");class pi{constructor(e){let{logger:t,isPersonalisationActive:o}=e;Object.defineProperty(this,di,{writable:!0,value:void 0}),Object.defineProperty(this,hi,{writable:!0,value:void 0}),Object.defineProperty(this,ui,{writable:!0,value:void 0}),this.cookieName=void 0,this.scookieObj=void 0,this.sessionId=ae.getMetaProp("cs"),i(this,di)[di]=t,i(this,ui)[ui]=o}get sessionId(){return i(this,hi)[hi]}set sessionId(e){i(this,hi)[hi]=e}getSessionCookieObject(){let e=ae.readCookie(this.cookieName),t={};if(null!=e)if(e=e.replace(p,'"'),t=JSON.parse(e),J(t)){if(void 0!==t.t){const e=t.t;oe()-e>1260&&(t={})}}else t={};return this.scookieObj=t,t}setSessionCookieObject(e){const t=JSON.stringify(e);ae.createBroadCookie(this.cookieName,t,1200,We())}manageSession(e){if(void 0===this.sessionId||this.sessionId!==e){const t=ae.getMetaProp("cs");if(void 0===t)ae.setMetaProp("ps",e),ae.setMetaProp("cs",e),ae.setMetaProp("sc",1);else if(t!==e){ae.setMetaProp("ps",t),ae.setMetaProp("cs",e);let i=ae.getMetaProp("sc");void 0===i&&(i=0),ae.setMetaProp("sc",i+1)}this.sessionId=e}}getTimeElapsed(){if(!i(this,ui)[ui]())return;null!=this.scookieObj&&(this.scookieObj=this.getSessionCookieObject());const e=this.scookieObj.s;if(null!=e){const t=oe();return Math.floor(t-e)}}getPageCount(){if(i(this,ui)[ui]())return null!=this.scookieObj&&(this.scookieObj=this.getSessionCookieObject()),this.scookieObj.p}}let gi=0,fi=0;var vi=t("logger"),bi=t("account"),mi=t("device"),yi=t("session"),wi=t("isPersonalisationActive"),Ci=t("clearCookie"),ki=t("addToLocalEventMap");class xi{constructor(e){let{logger:t,account:o,device:n,session:s,isPersonalisationActive:r}=e;Object.defineProperty(this,ki,{value:Pi}),Object.defineProperty(this,vi,{writable:!0,value:void 0}),Object.defineProperty(this,bi,{writable:!0,value:void 0}),Object.defineProperty(this,mi,{writable:!0,value:void 0}),Object.defineProperty(this,yi,{writable:!0,value:void 0}),Object.defineProperty(this,wi,{writable:!0,value:void 0}),Object.defineProperty(this,Ci,{writable:!0,value:!1}),this.processingBackup=!1,i(this,vi)[vi]=t,i(this,bi)[bi]=o,i(this,mi)[mi]=n,i(this,yi)[yi]=s,i(this,wi)[wi]=r,Qe.logger=t,Qe.device=n,Qe.account=o}processBackupEvents(){const e=ae.readFromLSorCookie(S);if(null!=e){this.processingBackup=!0;for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];void 0===o.fired&&(i(this,vi)[vi].debug("Processing backup event : "+o.q),void 0!==o.q&&Qe.fireRequest(o.q),o.fired=!0)}ae.saveToLSorCookie(S,e),this.processingBackup=!1}}addSystemDataToObject(e,t){void 0===t&&(e=ee(e,i(this,vi)[vi])),$(i(this,vi)[vi].wzrkError)||(e.wzrk_error=i(this,vi)[vi].wzrkError,i(this,vi)[vi].wzrkError={}),e.id=i(this,bi)[bi].id,X(i(this,mi)[mi].gcookie)&&(e.g=i(this,mi)[mi].gcookie);const o=i(this,yi)[yi].getSessionCookieObject();e.s=o.s,e.pg=void 0===o.p?1:o.p;let n=document.location.protocol;return n=n.replace(":",""),e.af={lib:"web-sdk-v1.7.3",protocol:n,...le.flutterVersion},sessionStorage.hasOwnProperty("WZRK_D")&&(e.debug=!0),e}addFlags(e){if(i(this,Ci)[Ci]=ae.getAndClearMetaProp(g),void 0!==i(this,Ci)[Ci]&&i(this,Ci)[Ci]&&(e.rc=!0,i(this,vi)[vi].debug("reset cookie sent in request and cleared from meta for future requests.")),i(this,wi)[wi]()){const t=ae.getMetaProp("lsTime"),i=ae.getMetaProp("exTs");if(void 0===t||void 0===i)return void(e.dsync=!0);t+i{if(e.ok)return e.json();throw e})).then((e=>(i(this,vi)[vi].debug("Sync data successful",e),e))).catch((e=>{throw i(this,vi)[vi].debug("Error in syncing variables",e),e}))}}var Pi=function(e){if(ae._isLocalStorageSupported()){void 0===le.globalEventsMap&&(le.globalEventsMap=ae.readFromLSorCookie(C),void 0===le.globalEventsMap&&(le.globalEventsMap={}));const t=oe();let i=le.globalEventsMap[e];void 0!==i?(i[2]=t,i[0]++):(i=[],i.push(1),i.push(t),i.push(t)),le.globalEventsMap[e]=i,ae.saveToLSorCookie(C,le.globalEventsMap)}},Si=t("request"),Ii=t("account"),_i=t("oldValues"),Oi=t("logger"),Ei=t("processPrivacyArray");class Ai extends Array{constructor(e,t){let{request:o,account:n,logger:s}=e;super(),Object.defineProperty(this,Ei,{value:Li}),Object.defineProperty(this,Si,{writable:!0,value:void 0}),Object.defineProperty(this,Ii,{writable:!0,value:void 0}),Object.defineProperty(this,_i,{writable:!0,value:void 0}),Object.defineProperty(this,Oi,{writable:!0,value:void 0}),i(this,Oi)[Oi]=s,i(this,Si)[Si]=o,i(this,Ii)[Ii]=n,i(this,_i)[_i]=t}push(){for(var e=arguments.length,t=new Array(e),o=0;o0?le.privacyArray:t):le.privacyArray.push(...t),0}_processOldValues(){i(this,_i)[_i]&&i(this,Ei)[Ei](i(this,_i)[_i]),i(this,_i)[_i]=null}}var Li=function(e){if(Array.isArray(e)&&e.length>0){const o=e.reduce(((e,t)=>({...e,...t})),{});let n={};const s={};var t=!1;if(o.hasOwnProperty(_)&&"boolean"==typeof(t=o.optOut)&&(s.ct_optout=t,le.isOptInRequest=!t),o.hasOwnProperty(O)){const e=o.useIP,t="boolean"==typeof e&&e;ae.setMetaProp(O,t)}if(!$(s)){n.type="profile",n.profile=s,n=i(this,Si)[Si].addSystemDataToObject(n,void 0);const o=Ke(JSON.stringify(n),i(this,Oi)[Oi]);let r=i(this,Ii)[Ii].dataPostURL;r=Ve(r,"type",A),r=Ve(r,"d",o),r=Ve(r,_,t?"true":"false"),i(this,Si)[Si].saveAndFireRequest(r,le.blockRequest),e.splice(0,e.length)}}},Mi=t("oldValues"),Ti=t("logger"),Ri=t("request"),ji=t("account"),Di=t("wizAlertJSPath"),zi=t("fcmPublicKey"),Bi=t("setUpWebPush"),Ni=t("setUpWebPushNotifications"),Fi=t("setApplicationServerKey"),Ui=t("setUpSafariNotifications"),qi=t("setUpChromeFirefoxNotifications"),Vi=t("addWizAlertJS"),Wi=t("removeWizAlertJS"),Ki=t("handleNotificationRegistration");class Hi extends Array{constructor(e,t){let{logger:o,session:n,request:s,account:r}=e;super(),Object.defineProperty(this,Ki,{value:eo}),Object.defineProperty(this,Wi,{value:Xi}),Object.defineProperty(this,Vi,{value:Qi}),Object.defineProperty(this,qi,{value:Yi}),Object.defineProperty(this,Ui,{value:$i}),Object.defineProperty(this,Fi,{value:Zi}),Object.defineProperty(this,Ni,{value:Ji}),Object.defineProperty(this,Bi,{value:Gi}),Object.defineProperty(this,Mi,{writable:!0,value:void 0}),Object.defineProperty(this,Ti,{writable:!0,value:void 0}),Object.defineProperty(this,Ri,{writable:!0,value:void 0}),Object.defineProperty(this,ji,{writable:!0,value:void 0}),Object.defineProperty(this,Di,{writable:!0,value:void 0}),Object.defineProperty(this,zi,{writable:!0,value:void 0}),i(this,Di)[Di]="https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js",i(this,zi)[zi]=null,i(this,Mi)[Mi]=t,i(this,Ti)[Ti]=o,i(this,Ri)[Ri]=s,i(this,ji)[ji]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o0?i(this,Ki)[Ki](e):null==le.webPushEnabled&&e.length>0?(le.notifApi.notifEnabledFromApi=!0,le.notifApi.displayArgs=e.slice()):!1===le.webPushEnabled&&e.length>0&&i(this,Ti)[Ti].error("Make sure push notifications are fully enabled and integrated")},Ji=function(e,t,o,n){-1!==navigator.userAgent.indexOf("Chrome")||-1!==navigator.userAgent.indexOf("Firefox")?i(this,qi)[qi](e,t):-1!==navigator.userAgent.indexOf("Safari")&&i(this,Ui)[Ui](e,o,n)},Zi=function(e){i(this,zi)[zi]=e},$i=function(e,t,o){void 0===t&&i(this,Ti)[Ti].error("Ensure that APNS Web Push ID is supplied"),void 0===o&&i(this,Ti)[Ti].error("Ensure that APNS Web Push service path is supplied"),"safari"in window&&"pushNotification"in window.safari&&window.safari.pushNotification.requestPermission(o,t,{},(e=>{if("granted"===e.permission){const t=JSON.parse(JSON.stringify(e));t.endpoint=e.deviceToken,t.browser="Safari",ae.saveToLSorCookie(z,t),i(this,Ri)[Ri].registerToken(t),i(this,Ti)[Ti].info("Safari Web Push registered. Device Token: "+e.deviceToken)}else"denied"===e.permission&&i(this,Ti)[Ti].info("Error subscribing to Safari web push")}))},Yi=function(e,t){let o="";"serviceWorker"in navigator&&navigator.serviceWorker.register(t).then((e=>{if("undefined"!=typeof __wzrk_account_id)return new Promise((t=>setTimeout((()=>t(e)),5e3)));o=e.scope;return/^(\.?)(\/?)([^/]*).js$/.test(t)?navigator.serviceWorker.ready:-1!==navigator.userAgent.indexOf("Chrome")?new Promise((t=>setTimeout((()=>t(e)),5e3))):navigator.serviceWorker.getRegistrations()})).then((t=>{-1!==navigator.userAgent.indexOf("Firefox")&&Array.isArray(t)&&(t=t.filter((e=>e.scope===o))[0]);const n={userVisibleOnly:!0};null!=i(this,zi)[zi]&&(n.applicationServerKey=(e=>{let t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),i=window.atob(t),o=[];for(let e=0;e{i(this,Ti)[Ti].info("Service Worker registered. Endpoint: "+t.endpoint);const o=JSON.parse(JSON.stringify(t));-1!==navigator.userAgent.indexOf("Chrome")?(o.endpoint=o.endpoint.split("/").pop(),o.browser="Chrome"):-1!==navigator.userAgent.indexOf("Firefox")&&(o.endpoint=o.endpoint.split("/").pop(),o.browser="Firefox"),ae.saveToLSorCookie(z,o),i(this,Ri)[Ri].registerToken(o),void 0!==e&&"function"==typeof e&&e()})).catch((e=>{i(this,Ti)[Ti].error("Error subscribing: "+e),t.pushManager.getSubscription().then((e=>{null!==e&&e.unsubscribe().then((e=>{i(this,Ti)[Ti].info("Unsubscription successful")})).catch((e=>{i(this,Ti)[Ti].error("Error unsubscribing: "+e)}))}))}))})).catch((e=>{i(this,Ti)[Ti].error("error registering service worker: "+e)}))},Qi=function(){const e=document.createElement("script");return e.setAttribute("type","text/javascript"),e.setAttribute("id","wzrk-alert-js"),e.setAttribute("src",i(this,Di)[Di]),document.getElementsByTagName("body")[0].appendChild(e),e},Xi=function(){const e=document.getElementById("wzrk-alert-js");e.parentNode.removeChild(e)},eo=function(e){let t,o,n,s,r,a,l,c,d,h,u,p,g,f,v;if(1===e.length){if(J(e[0])){const i=e[0];t=i.titleText,o=i.bodyText,n=i.okButtonText,s=i.rejectButtonText,r=i.okButtonColor,a=i.skipDialog,l=i.askAgainTimeInSeconds,c=i.okCallback,d=i.rejectCallback,h=i.subscriptionCallback,u=i.serviceWorkerPath,p=i.httpsPopupPath,g=i.httpsIframePath,f=i.apnsWebPushId,v=i.apnsWebPushServiceUrl}}else t=e[0],o=e[1],n=e[2],s=e[3],r=e[4],a=e[5],l=e[6];if(null==a&&(a=!1),null==u&&(u="/clevertap_sw.js"),void 0===navigator.serviceWorker)return;const b=null!=p&&null!=g;if("https:"!==window.location.protocol&&"localhost"!==document.location.hostname&&!b)return void i(this,Ti)[Ti].error("Make sure you are https or localhost to register for notifications");if(-1!==navigator.userAgent.indexOf("Chrome")){const e=navigator.userAgent.match(/Chrome\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}else if(-1!==navigator.userAgent.indexOf("Firefox")){const e=navigator.userAgent.match(/Firefox\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}else{if(-1===navigator.userAgent.indexOf("Safari"))return;{const e=navigator.userAgent.match(/Safari\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}}if(!b){if(null==Notification)return;if("granted"===Notification.permission)return void i(this,Ni)[Ni](h,u,f,v);if("denied"===Notification.permission)return;if(a)return void i(this,Ni)[Ni](h,u,f,v)}if(!(t&&o&&n&&s))return void i(this,Ti)[Ti].error("Missing input parameters; please specify title, body, ok button and cancel button text");null!=r&&r.match(/^#[a-f\d]{6}$/i)||(r="#f28046");const m=(new Date).getTime()/1e3;if(null==ae.getMetaProp("notif_last_time"))ae.setMetaProp("notif_last_time",m);else{if(null==l&&(l=604800),m-ae.getMetaProp("notif_last_time"){if(null!=e.data){let a={};try{a=JSON.parse(e.data)}catch(e){return}null!=a.state&&"ct"===a.from&&"not"===a.state&&(i(this,Vi)[Vi]().onload=()=>{window.wzrkPermissionPopup.wizAlert({title:t,body:o,confirmButtonText:n,confirmButtonColor:r,rejectButtonText:s},(e=>{e?("function"==typeof c&&c(),window.open(p)):"function"==typeof d&&d(),i(this,Wi)[Wi]()}))})}}),!1)}else i(this,Vi)[Vi]().onload=()=>{window.wzrkPermissionPopup.wizAlert({title:t,body:o,confirmButtonText:n,confirmButtonColor:r,rejectButtonText:s},(e=>{e?("function"==typeof c&&c(),i(this,Ni)[Ni](h,u,f,v)):"function"==typeof d&&d(),i(this,Wi)[Wi]()}))}},to=t("variableStore");class io{constructor(e){let{variableStore:t}=e;Object.defineProperty(this,to,{writable:!0,value:void 0}),this.name=null,this.defaultValue=null,this.value=null,this.type=null,this.hadStarted=!1,this.valueChangedCallbacks=[],i(this,to)[to]=t}getValue(){return this.value}getdefaultValue(){return this.defaultValue}static define(e,t,i){if(!e||"string"!=typeof e)return console.error("Empty or invalid name parameter provided."),null;if(e.startsWith(".")||e.endsWith("."))return console.error("Variable name starts or ends with a `.` which is not allowed: "+e),null;const o=typeof t;if("string"!==o&&"number"!==o&&"boolean"!==o)return console.error("Only primitive types (string, number, boolean) are accepted as value"),null;const n=i.getVariable(e);if(n)return n;const s=new io({variableStore:i});try{s.name=e,s.defaultValue=t,s.value=t,s.type=o,i.registerVariable(s),s.update(t)}catch(e){console.error(e)}return s}update(e){const t=this.value;this.value=e,null===e&&null===t||null!==e&&e===t&&this.hadStarted||i(this,to)[to].hasVarsRequestCompleted()&&(this.hadStarted=!0,this.triggerValueChanged())}triggerValueChanged(){this.valueChangedCallbacks.forEach((e=>{e(this)}))}addValueChangedCallback(e){e?(this.valueChangedCallbacks.push(e),i(this,to)[to].hasVarsRequestCompleted()&&e(this)):console.log("Invalid callback parameter provided.")}removeValueChangedCallback(e){const t=this.valueChangedCallbacks.indexOf(e);-1!==t&&this.valueChangedCallbacks.splice(t,1)}clearStartFlag(){this.hadStarted=!1}}var oo=t("logger"),no=t("account"),so=t("request"),ro=t("event"),ao=t("variables"),lo=t("remoteVariables"),co=t("fetchCallback"),ho=t("variablesChangedCallbacks"),uo=t("oneTimeVariablesChangedCallbacks"),po=t("hasVarsRequestCompleted"),go=t("runVariablesChangedCallback");class fo{constructor(e){let{logger:t,request:o,account:n,event:s}=e;Object.defineProperty(this,go,{value:vo}),Object.defineProperty(this,oo,{writable:!0,value:void 0}),Object.defineProperty(this,no,{writable:!0,value:void 0}),Object.defineProperty(this,so,{writable:!0,value:void 0}),Object.defineProperty(this,ro,{writable:!0,value:void 0}),Object.defineProperty(this,ao,{writable:!0,value:void 0}),Object.defineProperty(this,lo,{writable:!0,value:void 0}),Object.defineProperty(this,co,{writable:!0,value:void 0}),Object.defineProperty(this,ho,{writable:!0,value:void 0}),Object.defineProperty(this,uo,{writable:!0,value:void 0}),Object.defineProperty(this,po,{writable:!0,value:!1}),i(this,oo)[oo]=t,i(this,no)[no]=n,i(this,so)[so]=o,i(this,ro)[ro]=s,i(this,ao)[ao]={},i(this,lo)[lo]={},i(this,ho)[ho]=[],i(this,uo)[uo]=[],le.variableStore=this}registerVariable(e){const{name:t}=e;i(this,ao)[ao][t]=e,console.log("registerVariable",i(this,ao)[ao])}getVariable(e){return i(this,ao)[ao][e]}hasVarsRequestCompleted(){return i(this,po)[po]}syncVariables(e,t){if(!i(this,no)[no].token){const e="Account token is missing.";return i(this,oo)[oo].error(e),Promise.reject(new Error(e))}const o={type:"varsPayload",vars:{}};for(const e in i(this,ao)[ao])o.vars[e]={defaultValue:i(this,ao)[ao][e].defaultValue,type:i(this,ao)[ao][e].type};if(0===Object.keys(o.vars).length){const e="No variables are defined.";return i(this,oo)[oo].error(e),Promise.reject(new Error(e))}let n={};n=i(this,so)[so].addSystemDataToObject(n,void 0),n.tk=i(this,no)[no].token,n.type="meta";const s=JSON.stringify([n,o]),r=i(this,no)[no].dataPostPEURL;return i(this,so)[so].post(r,s).then((t=>(e&&"function"==typeof e&&e(t),t))).catch((e=>{throw t&&"function"==typeof t&&t(e),400===e.status?i(this,oo)[oo].error("Invalid sync payload or clear the existing draft"):401===e.status?i(this,oo)[oo].error("This is not a test profile"):i(this,oo)[oo].error("Sync variable failed"),e}))}fetchVariables(e){i(this,ro)[ro].push(K,{t:4}),e&&"function"==typeof e&&(i(this,co)[co]=e)}mergeVariables(e){console.log("msg vars is ",e),i(this,po)[po]=!0,ae.saveToLSorCookie("WZRK_PE",e),i(this,lo)[lo]=e;for(const t in i(this,ao)[ao])e.hasOwnProperty(t)&&i(this,ao)[ao][t].update(e[t]);i(this,co)[co]&&i(this,co)[co](),i(this,go)[go]()}addVariablesChangedCallback(e){e&&"function"==typeof e?(i(this,ho)[ho].push(e),this.hasVarsRequestCompleted()&&e()):i(this,oo)[oo].error("callback is not a function")}addOneTimeVariablesChangedCallback(e){e&&"function"==typeof e&&(this.hasVarsRequestCompleted()?e():i(this,uo)[uo].push(e))}removeVariablesChangedCallback(e){const t=i(this,ho)[ho].indexOf(e);-1!==t&&i(this,ho)[ho].splice(t,1)}removeOneTimeVariablesChangedCallback(e){const t=i(this,uo)[uo].indexOf(e);-1!==t&&i(this,uo)[uo].splice(t,1)}}var vo=function(){for(var e of i(this,ho)[ho])e();for(var t of i(this,uo)[uo])t();i(this,uo)[uo].length=0},bo=t("logger"),mo=t("api"),yo=t("onloadcalled"),wo=t("device"),Co=t("session"),ko=t("account"),xo=t("request"),Po=t("variableStore"),So=t("isSpa"),Io=t("previousUrl"),_o=t("boundCheckPageChanged"),Oo=t("dismissSpamControl"),Eo=t("processOldValues"),Ao=t("debounce"),Lo=t("checkPageChanged"),Mo=t("pingRequest"),To=t("isPingContinuous"),Ro=t("overrideDSyncFlag");var jo=function(){this.onUserLogin._processOldValues(),this.privacy._processOldValues(),this.event._processOldValues(),this.profile._processOldValues(),this.notifications._processOldValues()},Do=function(e){let t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300;return function(){clearTimeout(t),t=setTimeout(e,i)}},zo=function(){i(this,Ao)[Ao]((()=>{i(this,Io)[Io]!==location.href&&this.pageChanged()}))()},Bo=function(){let e=i(this,ko)[ko].dataPostURL,t={};t=i(this,xo)[xo].addSystemDataToObject(t,void 0),e=Ve(e,"type","ping"),e=Ve(e,"d",Ke(JSON.stringify(t),i(this,bo)[bo])),i(this,xo)[xo].saveAndFireRequest(e,le.blockRequest)},No=function(){return void 0!==window.wzrk_d&&"continuous"===window.wzrk_d.ping},Fo=function(e){this._isPersonalisationActive()&&(e.dsync=!0)};const Uo=new class{get spa(){return i(this,So)[So]}set spa(e){const t=!0===e;i(this,So)[So]!==t&&1===i(this,yo)[yo]&&(t?document.addEventListener("click",i(this,_o)[_o]):document.removeEventListener("click",i(this,_o)[_o])),i(this,So)[So]=t}get dismissSpamControl(){return i(this,Oo)[Oo]}set dismissSpamControl(e){const t=!0===e;i(this,Oo)[Oo]=t,le.dismissSpamControl=t}constructor(){var e,t,o,n,s;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.defineProperty(this,Ro,{value:Fo}),Object.defineProperty(this,To,{value:No}),Object.defineProperty(this,Mo,{value:Bo}),Object.defineProperty(this,Lo,{value:zo}),Object.defineProperty(this,Ao,{value:Do}),Object.defineProperty(this,Eo,{value:jo}),Object.defineProperty(this,bo,{writable:!0,value:void 0}),Object.defineProperty(this,mo,{writable:!0,value:void 0}),Object.defineProperty(this,yo,{writable:!0,value:void 0}),Object.defineProperty(this,wo,{writable:!0,value:void 0}),Object.defineProperty(this,Co,{writable:!0,value:void 0}),Object.defineProperty(this,ko,{writable:!0,value:void 0}),Object.defineProperty(this,xo,{writable:!0,value:void 0}),Object.defineProperty(this,Po,{writable:!0,value:void 0}),Object.defineProperty(this,So,{writable:!0,value:void 0}),Object.defineProperty(this,Io,{writable:!0,value:void 0}),Object.defineProperty(this,_o,{writable:!0,value:i(this,Lo)[Lo].bind(this)}),Object.defineProperty(this,Oo,{writable:!0,value:void 0}),this.enablePersonalization=void 0,this.popupCallbacks={},this.popupCurrentWzrkId="",i(this,yo)[yo]=0,this._isPersonalisationActive=this._isPersonalisationActive.bind(this),this.raiseNotificationClicked=()=>{},i(this,bo)[bo]=new ai(ti),i(this,ko)[ko]=new d(null===(e=r.account)||void 0===e?void 0:e[0],r.region||(null===(t=r.account)||void 0===t?void 0:t[1]),r.targetDomain||(null===(o=r.account)||void 0===o?void 0:o[2]),r.token||(null===(n=r.account)||void 0===n?void 0:n[3])),i(this,wo)[wo]=new ye({logger:i(this,bo)[bo]}),i(this,Oo)[Oo]=r.dismissSpamControl||!1,i(this,Co)[Co]=new pi({logger:i(this,bo)[bo],isPersonalisationActive:this._isPersonalisationActive}),i(this,xo)[xo]=new xi({logger:i(this,bo)[bo],account:i(this,ko)[ko],device:i(this,wo)[wo],session:i(this,Co)[Co],isPersonalisationActive:this._isPersonalisationActive}),this.enablePersonalization=r.enablePersonalization||!1,this.event=new Fe({logger:i(this,bo)[bo],request:i(this,xo)[xo],isPersonalisationActive:this._isPersonalisationActive},r.event),this.profile=new gt({logger:i(this,bo)[bo],request:i(this,xo)[xo],account:i(this,ko)[ko],isPersonalisationActive:this._isPersonalisationActive},r.profile),this.onUserLogin=new It({request:i(this,xo)[xo],account:i(this,ko)[ko],session:i(this,Co)[Co],logger:i(this,bo)[bo],device:i(this,wo)[wo]},r.onUserLogin),this.privacy=new Ai({request:i(this,xo)[xo],account:i(this,ko)[ko],logger:i(this,bo)[bo]},r.privacy),this.notifications=new Hi({logger:i(this,bo)[bo],request:i(this,xo)[xo],account:i(this,ko)[ko]},r.notifications),i(this,Po)[Po]=new fo({logger:i(this,bo)[bo],request:i(this,xo)[xo],account:i(this,ko)[ko],event:this.event}),i(this,mo)[mo]=new be({logger:i(this,bo)[bo],request:i(this,xo)[xo],device:i(this,wo)[wo],session:i(this,Co)[Co]}),this.spa=r.spa,this.dismissSpamControl=r.dismissSpamControl,this.user=new Xt({isPersonalisationActive:this._isPersonalisationActive}),this.session={getTimeElapsed:()=>i(this,Co)[Co].getTimeElapsed(),getPageCount:()=>i(this,Co)[Co].getPageCount()},this.logout=()=>{i(this,bo)[bo].debug("logout called"),ae.setInstantDeleteFlagInK()},this.clear=()=>{this.onUserLogin.clear()},this.getCleverTapID=()=>i(this,wo)[wo].getGuid(),this.getAccountID=()=>i(this,ko)[ko].id,this.getSCDomain=()=>i(this,ko)[ko].finalTargetDomain,this.setLibrary=(e,t)=>{le.flutterVersion={[e]:t}},this.setSCSDKVersion=e=>{i(this,ko)[ko].scSDKVersion=e;const t={};t.af={scv:"sc-sdk-v"+i(this,ko)[ko].scSDKVersion};let o=i(this,ko)[ko].dataPostURL;o=Ve(o,"type","page"),o=Ve(o,"d",Ke(JSON.stringify(t),i(this,bo)[bo])),i(this,xo)[xo].saveAndFireRequest(o,le.blockRequest)},Kt()&&(qt(),Ut(i(this,bo)[bo])),this.getInboxMessageCount=()=>{const e=Nt();return Object.keys(e).length},this.getInboxMessageUnreadCount=()=>{if(le.inbox)return le.inbox.unviewedCounter;i(this,bo)[bo].debug("No unread messages")},this.getAllInboxMessages=()=>Nt(),this.getUnreadInboxMessages=()=>{if(le.inbox)return le.inbox.unviewedMessages;i(this,bo)[bo].debug("No unread messages")},this.getInboxMessageForId=e=>{const t=Nt();if((null!==e||""!==e)&&t.hasOwnProperty(e))return t[e];i(this,bo)[bo].error("No message available for message Id "+e)},this.deleteInboxMessage=e=>{const t=Nt();if(null===e&&""===e||!t.hasOwnProperty(e))i(this,bo)[bo].error("No message available for message Id "+e);else{const i=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);0===t[e].viewed&&(le.inbox.unviewedCounter--,delete le.inbox.unviewedMessages[e],document.getElementById("unviewedBadge").innerText=le.inbox.unviewedCounter,document.getElementById("unviewedBadge").style.display=le.inbox.unviewedCounter>0?"flex":"none"),i&&i.remove(),delete t[e],Ft(t)}},this.markReadInboxMessage=e=>{const t=le.inbox.unviewedMessages,o=Nt();if(null===e&&""===e||!t.hasOwnProperty(e))i(this,bo)[bo].error("No message available for message Id "+e);else{const t=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);if(null!==t&&(t.shadowRoot.getElementById("unreadMarker").style.display="none"),o[e].viewed=1,document.getElementById("unviewedBadge")){var n=parseInt(document.getElementById("unviewedBadge").innerText)-1;document.getElementById("unviewedBadge").innerText=n,document.getElementById("unviewedBadge").style.display=n>0?"flex":"none"}window.clevertap.renderNotificationViewed({msgId:o[e].wzrk_id,pivotId:o[e].pivotId}),le.inbox.unviewedCounter--,delete le.inbox.unviewedMessages[e],Ft(o)}},this.markReadInboxMessagesForIds=e=>{if(Array.isArray(e))for(var t=0;t{const e=le.inbox.unviewedMessages,t=Nt();if(Object.keys(e).length>0){Object.keys(e).forEach((e=>{const i=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);null!==i&&(i.shadowRoot.getElementById("unreadMarker").style.display="none"),t[e].viewed=1,window.clevertap.renderNotificationViewed({msgId:t[e].wzrk_id,pivotId:t[e].wzrk_pivot})})),document.getElementById("unviewedBadge").innerText=0,document.getElementById("unviewedBadge").style.display="none",Ft(t),le.inbox.unviewedCounter=0,le.inbox.unviewedMessages={}}else i(this,bo)[bo].debug("All messages are already read")},this.toggleInbox=e=>{var t;return null===(t=le.inbox)||void 0===t?void 0:t.toggleInbox(e)},this.renderNotificationViewed=e=>{a(R,e)},this.renderNotificationClicked=e=>{a(j,e)};const a=(e,t)=>{if(!t||!t.msgId)return;const o={type:"event"};if(o.evtName=e,o.evtData={[T]:t.msgId},t.pivotId&&(o.evtData={...o.evtData,wzrk_pivot:t.pivotId}),t.wzrk_slideNo&&(o.evtData={...o.evtData,wzrk_slideNo:t.wzrk_slideNo}),t.kv&&null!==t.kv&&void 0!==t.kv)for(const e in t.kv)e.startsWith(M)&&(o.evtData={...o.evtData,[e]:t.kv[e]});if(t.msgCTkv&&null!==t.msgCTkv&&void 0!==t.msgCTkv)for(const e in t.msgCTkv)e.startsWith(M)&&(o.evtData={...o.evtData,[e]:t.msgCTkv[e]});i(this,xo)[xo].processEvent(o)};this.setLogLevel=e=>{i(this,bo)[bo].logLevel=Number(e),3===e?sessionStorage.WZRK_D="":delete sessionStorage.WZRK_D},this.handleIncrementValue=(e,t)=>{this.profile._handleIncrementDecrementValue(e,t,B)},this.handleDecrementValue=(e,t)=>{this.profile._handleIncrementDecrementValue(e,t,"$decr")},this.setMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueSet(e,t,"$set"):console.error("setMultiValuesForKey should be called with a value of type array")},this.addMultiValueForKey=(e,t)=>{"string"==typeof t||"number"==typeof t?this.profile._handleMultiValueAdd(e,t,N):console.error("addMultiValueForKey should be called with a value of type string or number.")},this.addMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueAdd(e,t,N):console.error("addMultiValuesForKey should be called with a value of type array.")},this.removeMultiValueForKey=(e,t)=>{"string"==typeof t||"number"==typeof t?this.profile._handleMultiValueRemove(e,t,F):console.error("removeMultiValueForKey should be called with a value of type string or number.")},this.removeMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueRemove(e,t,F):console.error("removeMultiValuesForKey should be called with a value of type array.")},this.removeValueForKey=e=>{this.profile._handleMultiValueDelete(e,U)};const l=(e,t,o)=>{((e,t,i,o,n)=>{const s=qe(location.href),r=s.e,a=s.p,l=s.page_type;if(void 0!==r){const s={};s.id=o.id,s.unsubGroups=le.unsubGroups,le.updatedCategoryLong&&(s.cUsY=le.updatedCategoryLong);let c=o.emailURL;i&&(c=Ve(c,"fetchGroups",i)),t&&(c=Ve(c,"encoded",t)),c=Ve(c,"e",r),c=Ve(c,"d",Ke(JSON.stringify(s),n)),a&&(c=Ve(c,"p",a)),"-1"!==e&&(c=Ve(c,"sub",e)),l&&(le.globalUnsubscribe=l===I,c=Ve(c,"page_type",l)),Qe.fireRequest(c)}})(e,t,o,i(this,ko)[ko],i(this,bo)[bo])};function c(e){var t=e.coords.latitude,i=e.coords.longitude;le.location={Latitude:t,Longitude:i},this.sendLocationData({Latitude:t,Longitude:i})}function h(e){switch(e.code){case e.PERMISSION_DENIED:console.log("User denied the request for Geolocation.");break;case e.POSITION_UNAVAILABLE:console.log("Location information is unavailable.");break;case e.TIMEOUT:console.log("The request to get user location timed out.");break;case e.UNKNOWN_ERROR:console.log("An unknown error occurred.")}}this.getLocation=function(e,t){if(e&&"number"!=typeof e||t&&"number"!=typeof t)console.log("Latitude and Longitude must be of number type");else if(e&&t){if(e<=-90||e>90)return void console.log("A vaid latitude must range between -90 and 90");if(t<=-180||t>180)return void console.log("A valid longitude must range between -180 and 180");le.location={Latitude:e,Longitude:t},this.sendLocationData({Latitude:e,Longitude:t})}else navigator.geolocation?navigator.geolocation.getCurrentPosition(c.bind(this),h):console.log("Geolocation is not supported by this browser.")};const u=i(this,mo)[mo];u.logout=this.logout,u.clear=this.clear,u.closeIframe=(e,t)=>{at(e,0,i(this,Co)[Co].sessionId)},u.enableWebPush=(e,t)=>{this.notifications._enableWebPush(e,t)},u.tr=e=>{Yt(e,{device:i(this,wo)[wo],session:i(this,Co)[Co],request:i(this,xo)[xo],logger:i(this,bo)[bo]})},u.setEnum=e=>{((e,t)=>{if(G(e)||Q(e))return"$E_"+e;t.error(Ae)})(e,i(this,bo)[bo])},u.is_onloadcalled=()=>1===i(this,yo)[yo],u.subEmail=e=>{l("1",e)},u.getEmail=(e,t)=>{l("-1",e,t)},u.unSubEmail=e=>{l("0",e)},u.unsubEmailGroups=e=>{le.unsubGroups=[];const t=document.getElementsByClassName("ct-unsub-group-input-item");for(let e=0;e{le.unsubGroups=e},u.getSubscriptionGroups=()=>le.unsubGroups,u.changeSubscriptionGroups=(e,t)=>{u.setSubscriptionGroups(t),l("2",e)},u.isGlobalUnsubscribe=()=>le.globalUnsubscribe,u.setIsGlobalUnsubscribe=e=>{le.globalUnsubscribe=e},u.setUpdatedCategoryLong=e=>{e.cUsY&&(le.updatedCategoryLong=e.cUsY)},window.$CLTP_WR=window.$WZRK_WR=u,(null===(s=r.account)||void 0===s?void 0:s[0].id)&&this.init()}init(e,t,o,n){if(1===i(this,yo)[yo])return;if(ae.removeCookie("WZRK_P",window.location.hostname),!i(this,ko)[ko].id){if(!e)return void i(this,bo)[bo].error(ke);i(this,ko)[ko].id=e}i(this,Co)[Co].cookieName="WZRK_S_"+i(this,ko)[ko].id,t&&(i(this,ko)[ko].region=t),o&&(i(this,ko)[ko].targetDomain=o),n&&(i(this,ko)[ko].token=n);const s=location.href,r=qe(s.toLowerCase());if(void 0!==r.e&&"0"==r.wzrk_ex)return;le.isPrivacyArrPushed=!0,le.privacyArray.length>0&&this.privacy.push(le.privacyArray),i(this,Eo)[Eo](),this.pageChanged();const a=setInterval((()=>{i(this,wo)[wo].gcookie&&(clearInterval(a),i(this,xo)[xo].processBackupEvents())}),3e3);i(this,So)[So]?document.addEventListener("click",i(this,_o)[_o]):document.removeEventListener("click",i(this,_o)[_o]),i(this,yo)[yo]=1}pageChanged(){const e=window.location.search;if("?ctBuilder"===e)return console.log("open in visual builder mode"),void document.addEventListener("DOMContentLoaded",Zt);if("?ctBuilderPreview"===e)return void console.log("open in visual builder mode");const t=window.location.href,o=qe(t.toLowerCase()),n=i(this,Co)[Co].getSessionCookieObject();let s=void 0===n.p?0:n.p;n.p=++s,i(this,Co)[Co].setSessionCookieObject(n);let r={},a=(e=>{if(""===e)return"";var t=document.createElement("a");return t.href=e,t.hostname})(document.referrer);if(window.location.hostname!==a){const e=120;""!==a&&(a=a.length>e?a.substring(0,e):a,r.referrer=a);let t=o.utm_source||o.wzrk_source;void 0!==t&&(t=t.length>e?t.substring(0,e):t,r.us=t);let i=o.utm_medium||o.wzrk_medium;void 0!==i&&(i=i.length>e?i.substring(0,e):i,r.um=i);let n=o.utm_campaign||o.wzrk_campaign;if(void 0!==n&&(n=n.length>e?n.substring(0,e):n,r.uc=n),void 0!==o.wzrk_medium){const e=o.wzrk_medium;e.match(/^email$|^social$|^search$/)&&(r.wm=e)}}r=i(this,xo)[xo].addSystemDataToObject(r,void 0),r.cpg=t,r.WZRK_CAMP=it();let l=i(this,ko)[ko].dataPostURL;i(this,xo)[xo].addFlags(r),1===parseInt(r.pg)&&i(this,Ro)[Ro](r),l=Ve(l,"type","page"),l=Ve(l,"d",Ke(JSON.stringify(r),i(this,bo)[bo])),i(this,xo)[xo].saveAndFireRequest(l,le.blockRequest),1===parseInt(r.pg)&&this.event.push(K,{t:4}),i(this,Io)[Io]=t,setTimeout((()=>{s<=3&&i(this,Mo)[Mo](),i(this,To)[To]()&&setInterval((()=>{i(this,Mo)[Mo]()}),3e5)}),12e4)}_isPersonalisationActive(){return ae._isLocalStorageSupported()&&this.enablePersonalization}set popupCallback(e){this.popupCallbacks[this.popupCurrentWzrkId]=e}sendLocationData(e){let t={af:{}};const o={};if(t.type="profile",null==o.tz&&(o.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),t.profile=o,e){Object.keys(e).forEach((i=>{t.af[i]=e[i]}))}le.location&&(t.af={...t.af,...le.location}),t=i(this,xo)[xo].addSystemDataToObject(t,!0),i(this,xo)[xo].addFlags(t);const n=Ke(JSON.stringify(t),i(this,bo)[bo]);let s=i(this,ko)[ko].dataPostURL;s=Ve(s,"type",A),s=Ve(s,"d",n),i(this,xo)[xo].saveAndFireRequest(s,le.blockRequest)}setOffline(e){"boolean"==typeof e?(le.offline=e,e||i(this,xo)[xo].processBackupEvents()):console.error("setOffline should be called with a value of type boolean")}defineVariable(e,t){return io.define(e,t,i(this,Po)[Po])}syncVariables(e,t){if(4===i(this,bo)[bo].logLevel)return i(this,Po)[Po].syncVariables(e,t);{const e="App log level is not set to 4";return i(this,bo)[bo].error(e),Promise.reject(new Error(e))}}fetchVariables(e){i(this,Po)[Po].fetchVariables(e)}addVariablesChangedCallback(e){i(this,Po)[Po].addVariablesChangedCallback(e)}addOneTimeVariablesChangedCallback(e){i(this,Po)[Po].addOneTimeVariablesChangedCallback(e)}}(window.clevertap);return window.clevertap=window.wizrocket=Uo,Uo})); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).clevertap=t()}(this,(function(){"use strict";var e=0;function t(t){return"__private_"+e+++"_"+t}function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}const o="clevertap-prod.com",n="https:";var s=t("accountId"),r=t("region"),a=t("targetDomain"),l=t("dcSdkversion"),c=t("token");class d{constructor(){let{id:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";Object.defineProperty(this,s,{writable:!0,value:void 0}),Object.defineProperty(this,r,{writable:!0,value:""}),Object.defineProperty(this,a,{writable:!0,value:o}),Object.defineProperty(this,l,{writable:!0,value:""}),Object.defineProperty(this,c,{writable:!0,value:""}),this.id=e,t&&(this.region=t),i&&(this.targetDomain=i),n&&(this.token=n)}get id(){return i(this,s)[s]}set id(e){i(this,s)[s]=e}get region(){return i(this,r)[r]}set region(e){i(this,r)[r]=e}get dcSDKVersion(){return i(this,l)[l]}set dcSDKVersion(e){i(this,l)[l]=e}get targetDomain(){return i(this,a)[a]}set targetDomain(e){i(this,a)[a]=e}get token(){return i(this,c)[c]}set token(e){i(this,c)[c]=e}get finalTargetDomain(){return this.region?"".concat(this.region,".").concat(this.targetDomain):this.targetDomain===o?"".concat("eu1",".").concat(this.targetDomain):this.targetDomain}get dataPostPEURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/defineVars")}get dataPostURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/a?t=96")}get recorderURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/r?r=1")}get emailURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/e?r=1")}}const h=new RegExp("^\\s+|\\.|:|\\$|'|\"|\\\\|\\s+$","g"),u=new RegExp("^\\s+|'|\"|\\\\|\\s+$","g"),p=new RegExp("'","g"),g="clear",f="Charged ID",v="WZRK_CHARGED_ID",b="WZRK_G",m="WZRK_K",y="WZRK_CAMP",w="WZRK_CAMP_G",C="WZRK_EV",k="WZRK_META",x="WZRK_PR",P="WZRK_ARP",S="WZRK_L",I="global",O="optOut",_="useIP",E="WZRK_X",A="push",L=31536e3,M="wzrk_",T="wzrk_id",R="Notification Viewed",j="Notification Clicked",D="WZRK_FPU",z="WZRK_PSD",B="$incr",N="$add",F="$remove",U="$delete",q="WZRK_INBOX_CONFIG",V="WZRK_INBOX",W=1e3,K="wzrk_fetch",G=["Stayed","UTM Visited","App Launched","Notification Sent",R,j],H=e=>"string"==typeof e||e instanceof String,J=e=>"[object Object]"===Object.prototype.toString.call(e),Z=e=>"object"==typeof e&&e instanceof Date,$=e=>{for(const t in e)if(e.hasOwnProperty(t))return!1;return!0},Y=e=>!isNaN(parseFloat(e))&&isFinite(e),Q=e=>/^-?[\d.]+(?:e-?\d+)?$/.test(e)&&"number"==typeof e,X=e=>null!=e&&"undefined"!==e,ee=(e,t)=>{if("object"!=typeof e){let i;return H(e)?(i=te(e,u),i.length>1024&&(i=i.substring(0,1024),t.reportError(521,i+"... length exceeded 1024 chars. Trimmed."))):i=e,i}for(const i in e)if(e.hasOwnProperty(i)){const o=ee(e[i],t);let n;n=te(i,h),n.length>1024&&(n=n.substring(0,1024),t.reportError(520,n+"... length exceeded 1024 chars. Trimmed.")),delete e[i],e[n]=o}return e},te=(e,t)=>e.replace(t,""),ie=()=>{const e=new Date;return e.getFullYear()+""+e.getMonth()+e.getDay()},oe=()=>Math.floor((new Date).getTime()/1e3),ne=e=>"$D_"+Math.round(e.getTime()/1e3),se=e=>{if(re(e))return"$D_"+e},re=e=>{const t=/^(\d{4})(\d{2})(\d{2})$/.exec(e);if(null==t)return!1;const i=t[3],o=t[2]-1,n=t[1],s=new Date(n,o,i);return s.getDate()==i&&s.getMonth()==o&&s.getFullYear()==n};class ae{static save(e,t){return!(!e||!t)&&(this._isLocalStorageSupported()?(localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),!0):void 0)}static read(e){if(!e)return!1;let t=null;if(this._isLocalStorageSupported()&&(t=localStorage.getItem(e)),null!=t)try{t=JSON.parse(t)}catch(e){}return t}static remove(e){return!!e&&(this._isLocalStorageSupported()?(localStorage.removeItem(e),!0):void 0)}static removeCookie(e,t){let i=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";t&&(i=i+" domain="+t+"; path=/"),document.cookie=i}static createCookie(e,t,i,o){let n="",s="";if(i){const e=new Date;e.setTime(e.getTime()+1e3*i),n="; expires="+e.toGMTString()}o&&(s="; domain="+o),t=encodeURIComponent(t),document.cookie=e+"="+t+n+s+"; path=/"}static readCookie(e){const t=e+"=",i=document.cookie.split(";");for(let e=0;e=0;o--){if(a=0===o?r[o]+a:"."+r[o]+a,this.readCookie(e)){var n="test_"+e+o;if(this.createCookie(n,t,10,a),!this.readCookie(n))continue;this.removeCookie(n,a)}this.createCookie(e,t,i,a);if(this.readCookie(e)==t){s=a,le.broadDomain=s;break}}}else this.createCookie(e,t,i,s)}else this.createCookie(e,t,i,o)}static getMetaProp(e){const t=this.readFromLSorCookie(k);if(null!=t)return t[e]}static setMetaProp(e,t){if(this._isLocalStorageSupported()){let i=this.readFromLSorCookie(k);null==i&&(i={}),void 0===t?delete i[e]:i[e]=t,this.saveToLSorCookie(k,i)}}static getAndClearMetaProp(e){const t=this.getMetaProp(e);return this.setMetaProp(e,void 0),t}static setInstantDeleteFlagInK(){let e=this.readFromLSorCookie(m);null==e&&(e={}),e.flag=!0,this.saveToLSorCookie(m,e)}static backupEvent(e,t,i){let o=this.readFromLSorCookie(S);void 0===o&&(o={}),o[t]={q:e},this.saveToLSorCookie(S,o),i.debug("stored in ".concat(S," reqNo : ").concat(t," -> ").concat(e))}static removeBackup(e,t){const i=this.readFromLSorCookie(S);null!=i&&void 0!==i[e]&&(t.debug("del event: ".concat(e," data-> ").concat(i[e].q)),delete i[e],this.saveToLSorCookie(S,i))}}const le={globalCache:{gcookie:null,REQ_N:0,RESP_N:0},LRU_CACHE:null,globalProfileMap:void 0,globalEventsMap:void 0,blockRequest:!1,isOptInRequest:!1,broadDomain:null,webPushEnabled:null,campaignDivMap:{},currentSessionId:null,wiz_counter:0,notifApi:{notifEnabledFromApi:!1},unsubGroups:[],updatedCategoryLong:null,inbox:null,isPrivacyArrPushed:!1,privacyArray:[],offline:!1,location:null,dismissSpamControl:!1,globalUnsubscribe:!0,flutterVersion:null,variableStore:{}};var ce=t("keyOrder"),de=t("deleteFromObject");class he{constructor(e){Object.defineProperty(this,de,{value:ue}),Object.defineProperty(this,ce,{writable:!0,value:void 0}),this.max=e;let t=ae.readFromLSorCookie(E);if(t){const e={};i(this,ce)[ce]=[],t=t.cache;for(const o in t)t.hasOwnProperty(o)&&(e[t[o][0]]=t[o][1],i(this,ce)[ce].push(t[o][0]));this.cache=e}else this.cache={},i(this,ce)[ce]=[]}get(e){const t=this.cache[e];return t&&(this.cache=i(this,de)[de](e,this.cache),this.cache[e]=t,i(this,ce)[ce].push(e)),this.saveCacheToLS(this.cache),t}set(e,t){const o=this.cache[e],n=i(this,ce)[ce];null!=o?this.cache=i(this,de)[de](e,this.cache):n.length===this.max&&(this.cache=i(this,de)[de](n[0],this.cache)),this.cache[e]=t,i(this,ce)[ce][i(this,ce)[ce]-1]!==e&&i(this,ce)[ce].push(e),this.saveCacheToLS(this.cache)}saveCacheToLS(e){const t=[],o=i(this,ce)[ce];for(const i in o)if(o.hasOwnProperty(i)){const n=[];n.push(o[i]),n.push(e[o[i]]),t.push(n)}ae.saveToLSorCookie(E,{cache:t})}getKey(e){if(null===e)return null;const t=i(this,ce)[ce];for(const i in t)if(t.hasOwnProperty(i)&&this.cache[t[i]]===e)return t[i];return null}getSecondLastKey(){const e=i(this,ce)[ce];return null!=e&&e.length>1?e[e.length-2]:-1}getLastKey(){const e=i(this,ce)[ce].length;if(e)return i(this,ce)[ce][e-1]}}var ue=function(e,t){const o=JSON.parse(JSON.stringify(i(this,ce)[ce])),n={};let s;for(const i in o)o.hasOwnProperty(i)&&(o[i]!==e?n[o[i]]=t[o[i]]:s=i);return o.splice(s,1),i(this,ce)[ce]=JSON.parse(JSON.stringify(o)),n},pe=t("logger"),ge=t("request"),fe=t("device"),ve=t("session");class be{constructor(e){let{logger:t,request:o,device:n,session:s}=e;Object.defineProperty(this,pe,{writable:!0,value:void 0}),Object.defineProperty(this,ge,{writable:!0,value:void 0}),Object.defineProperty(this,fe,{writable:!0,value:void 0}),Object.defineProperty(this,ve,{writable:!0,value:void 0}),i(this,pe)[pe]=t,i(this,ge)[ge]=o,i(this,fe)[fe]=n,i(this,ve)[ve]=s}s(e,t,o,n,s){let r=!1,a=!1;if(window.isOULInProgress&&(o||"undefined"!==n&&n===window.oulReqN)&&(window.isOULInProgress=!1,r=!0),void 0===n&&(n=0),ae.removeBackup(n,i(this,pe)[pe]),n>le.globalCache.REQ_N)return;if(X(i(this,fe)[fe].gcookie)||e&&(a=!0),!X(i(this,fe)[fe].gcookie)||o||"boolean"==typeof s){const n=i(this,ve)[ve].getSessionCookieObject();if(window.isOULInProgress||n.s&&t{if(J(e)){for(var t in e)if(e.hasOwnProperty(t)){if(J(e[t])||Array.isArray(e[t]))return!1;Z(e[t])&&(e[t]=ne(e[t]))}return!0}return!1},Re=(e,t)=>{if(J(e)){for(var i in e)if(e.hasOwnProperty(i))if("Items"===i){if(!Array.isArray(e[i]))return!1;for(var o in e[i].length>50&&t.reportError(522,"Charged Items exceed 50 limit. Actual count: "+e[i].length),e[i])if(e[i].hasOwnProperty(o)&&(!J(e[i][o])||!Te(e[i][o])))return!1}else{if(J(e[i])||Array.isArray(e[i]))return!1;Z(e[i])&&(e[i]=ne(e[i]))}if(H(e[f])||Q(e[f])){const i=e[f]+"";if(void 0===Me&&(Me=ae.readFromLSorCookie(v)),void 0!==Me&&Me.trim()===i.trim())return t.error("Duplicate charged Id - Dropped"+e),!1;Me=i,ae.saveToLSorCookie(v,i)}return!0}return!1};var je=t("logger"),De=t("oldValues"),ze=t("request"),Be=t("isPersonalisationActive"),Ne=t("processEventArray");class Fe extends Array{constructor(e,t){let{logger:o,request:n,isPersonalisationActive:s}=e;super(),Object.defineProperty(this,Ne,{value:Ue}),Object.defineProperty(this,je,{writable:!0,value:void 0}),Object.defineProperty(this,De,{writable:!0,value:void 0}),Object.defineProperty(this,ze,{writable:!0,value:void 0}),Object.defineProperty(this,Be,{writable:!0,value:void 0}),i(this,je)[je]=o,i(this,De)[De]=t,i(this,ze)[ze]=n,i(this,Be)[Be]=s}push(){for(var e=arguments.length,t=new Array(e),o=0;o0;){var t=e.shift();if(!H(t)){i(this,je)[je].error(xe);continue}if(t.length>1024&&(t=t.substring(0,1024),i(this,je)[je].reportError(510,t+"... length exceeded 1024 chars. Trimmed.")),G.includes(t)){i(this,je)[je].reportError(513,t+" is a restricted system event. It cannot be used as an event name.");continue}const o={type:"event"};if(o.evtName=te(t,h),0!==e.length){const n=e.shift();if(J(n)){if("Charged"===t){if(!Re(n,i(this,je)[je])){i(this,je)[je].reportError(511,"Charged event structure invalid. Not sent.");continue}}else if(!Te(n)){i(this,je)[je].reportError(512,t+" event structure invalid. Not sent.");continue}o.evtData=n}else e.unshift(n)}i(this,ze)[ze].processEvent(o)}};const qe=e=>{const t={},i=e.indexOf("?");if(i>1){const o=e.substring(i+1);let n;const s=/\+/g,r=/([^&=]+)=?([^&]*)/g,a=function(e){let t=e.replace(s," ");try{t=decodeURIComponent(t)}catch(e){}return t};for(n=r.exec(o);n;)t[a(n[1])]=a(n[2]),n=r.exec(o)}return t},Ve=(e,t,i)=>e+"&"+t+"="+encodeURIComponent(i),We=()=>window.location.hostname,Ke=(e,t)=>(t&&"function"==typeof t.debug&&t.debug("dobj:"+e),He(e)),Ge=(()=>{let e="",t=0;for(t=0;t<=25;t++)e+=String.fromCharCode(t+65);for(t=0;t<=25;t++)e+=String.fromCharCode(t+97);for(t=0;t<10;t++)e+=t;return e+"+/="})(),He=e=>{if(null==e)return"";var t,i,o,n,s,r,a,l="",c=0;for(e=(e=>{if(null==e)return"";let t,i,o,n={},s={},r="",a="",l="",c=2,d=3,h=2,u="",p=0,g=0,f=String.fromCharCode;for(o=0;o>=1}else{for(i=1,t=0;t>=1}c--,0==c&&(c=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;c--,0==c&&(c=Math.pow(2,h),h++),n[a]=d++,l=String(r)}if(""!==l){if(Object.prototype.hasOwnProperty.call(s,l)){if(l.charCodeAt(0)<256){for(t=0;t>=1}else{for(i=1,t=0;t>=1}c--,0==c&&(c=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;c--,0==c&&(c=Math.pow(2,h),h++)}for(i=2,t=0;t>=1;for(;;){if(p<<=1,15==g){u+=f(p);break}g++}return u})(e);c<2*e.length;)c%2==0?(t=e.charCodeAt(c/2)>>8,i=255&e.charCodeAt(c/2),o=c/2+1>8:NaN):(t=255&e.charCodeAt((c-1)/2),(c+1)/2>8,o=255&e.charCodeAt((c+1)/2)):i=o=NaN),c+=3,n=t>>2,s=(3&t)<<4|i>>4,r=(15&i)<<2|o>>6,a=63&o,isNaN(i)?r=a=64:isNaN(o)&&(a=64),l=l+Ge.charAt(n)+Ge.charAt(s)+Ge.charAt(r)+Ge.charAt(a);return l};var Je=t("fireRequest"),Ze=t("dropRequestDueToOptOut"),$e=t("addUseIPToRequest"),Ye=t("addARPToRequest");class Qe{constructor(){this.networkRetryCount=0,this.minDelayFrequency=0}static fireRequest(e,t,o,n){i(this,Je)[Je](e,1,t,o,n)}getDelayFrequency(){if(this.logger.debug("Network retry #"+this.networkRetryCount),this.networkRetryCount<10)return this.logger.debug(this.account.id,"Failure count is "+this.networkRetryCount+". Setting delay frequency to 1s"),this.minDelayFrequency=W,this.minDelayFrequency;if(null==this.account.region)return this.logger.debug(this.account.id,"Setting delay frequency to 1s"),W;{const e=1e3*(Math.floor(10*Math.random())+1);return this.minDelayFrequency+=e,this.minDelayFrequency<6e5?(this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency):(this.minDelayFrequency=W,this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency)}}}Qe.logger=void 0,Qe.device=void 0,Qe.account=void 0,Object.defineProperty(Qe,Je,{value:function(e,t,o,n,s){var r,a;if(i(this,Ze)[Ze]())return void this.logger.debug("req dropped due to optout cookie: "+this.device.gcookie);if(X(this.device.gcookie)||(le.blockRequest=!0),s&&s===K)!X(this.device.gcookie)&&le.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(this.networkRetryCount)),i(this,Je)[Je](e,void 0,o,n)}),this.getDelayFrequency());else if(!X(this.device.gcookie)&&le.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(t)),i(this,Je)[Je](e,t+1,o,n)}),50);if(n?window.isOULInProgress=!0:(X(this.device.gcookie)&&(e=Ve(e,"gc",this.device.gcookie)),e=i(this,Ye)[Ye](e,o)),e=Ve(e,"tries",t),e=i(this,$e)[$e](e),e=Ve(e,"r",(new Date).getTime()),(null===(r=window.clevertap)||void 0===r?void 0:r.hasOwnProperty("plugin"))||(null===(a=window.wizrocket)||void 0===a?void 0:a.hasOwnProperty("plugin"))){const t=window.clevertap.plugin||window.wizrocket.plugin;e=Ve(e,"ct_pl",t)}-1!==e.indexOf("chrome-extension:")&&(e=e.replace("chrome-extension:","https:"));for(var l=document.getElementsByClassName("ct-jp-cb");l[0]&&l[0].parentNode;)l[0].parentNode.removeChild(l[0]);const c=document.createElement("script");c.setAttribute("type","text/javascript"),c.setAttribute("src",e),c.setAttribute("class","ct-jp-cb"),c.setAttribute("rel","nofollow"),c.async=!0,document.getElementsByTagName("head")[0].appendChild(c),this.logger.debug("req snt -> url: "+e)}}),Object.defineProperty(Qe,Ze,{value:function(){return!le.isOptInRequest&&X(this.device.gcookie)&&H(this.device.gcookie)?":OO"===this.device.gcookie.slice(-3):(le.isOptInRequest=!1,!1)}}),Object.defineProperty(Qe,$e,{value:function(e){var t=ae.getMetaProp(_);return"boolean"!=typeof t&&(t=!1),Ve(e,_,t?"true":"false")}}),Object.defineProperty(Qe,Ye,{value:function(e,t){if(!0===t){const t={skipResARP:!0};return Ve(e,"arp",Ke(JSON.stringify(t),this.logger))}return ae._isLocalStorageSupported()&&void 0!==localStorage.getItem(P)&&null!==localStorage.getItem(P)?Ve(e,"arp",Ke(JSON.stringify(ae.readFromLSorCookie(P)),this.logger)):e}});const Xe=()=>{let e={};if(ae._isLocalStorageSupported()){let t=ae.read(y);null!=t?(t=JSON.parse(decodeURIComponent(t).replace(p,'"')),t.hasOwnProperty("global")?e.wp=t:e=t):e={}}return e},et=e=>{if(ae._isLocalStorageSupported()){const t={...Xe(),...e},i=JSON.stringify(t);ae.save(y,encodeURIComponent(i)),tt()}},tt=()=>{if(ae._isLocalStorageSupported()){let i=ae.read(b);if(X(i))try{i=JSON.parse(decodeURIComponent(ae.read(b)));const o=ae.read(w)?JSON.parse(decodeURIComponent(ae.read(w))):{};if(i&&ae._isLocalStorageSupported()){var e={},t=Xe();Object.keys(t).forEach((n=>{const s=i in o&&Object.keys(o[i]).length&&o[i][n]?o[i][n]:{},r=t[n].global,a=ie(),l=t[n][a];if(void 0!==r){const e=Object.keys(r);for(const t in e){let i=[];if(e.hasOwnProperty(t)){let o=0,n=0;const a=e[t];if("tc"===a)continue;void 0!==l&&void 0!==l[a]&&(o=l[a]),void 0!==r&&void 0!==r[a]&&(n=r[a]),i=[a,o,n],s[a]=i}}}e={...e,[n]:s}})),o[i]=e,ae.save(w,encodeURIComponent(JSON.stringify(o)))}}catch(e){console.error("Invalid clevertap Id "+e)}}},it=()=>{const e=JSON.parse(decodeURIComponent(ae.read(b)));let t={};if(ae._isLocalStorageSupported()){let i={};t=Xe();const o=ae.read(w),n=o?decodeURIComponent(o):null,s=n?JSON.parse(n):null,r=e&&null!=o&&s&&s[e]&&s[e].wp?Object.values(s[e].wp):[],a=e&&null!=o&&s&&s[e]&&s[e].wi?Object.values(s[e].wi):[],l=ie();let c=0,d=0;return t.wp&&t.wp[l]&&"undefined"!==t.wp[l].tc&&(c=t.wp[l].tc),t.wi&&t.wi[l]&&"undefined"!==t.wi[l].tc&&(d=t.wi[l].tc),i={wmp:c,wimp:d,tlc:r,witlc:a},i}},ot=(e,t)=>{let{logger:i}=t,o=!1;if(J(e))for(const t in e)if(e.hasOwnProperty(t)){o=!0;let n=e[t];if(null==n){delete e[t];continue}"Gender"!==t||n.match(/^M$|^F$/)||(o=!1,i.error(Pe)),"Employed"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Se)),"Married"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Ie)),"Education"!==t||n.match(/^School$|^College$|^Graduate$/)||(o=!1,i.error(Oe)),"Age"===t&&null!=n&&(Y(n)?e.Age=+n:(o=!1,i.error(_e))),"DOB"===t?(/^\$D_/.test(n)&&11===(n+"").length||Z(n)||(o=!1,i.error(Ee)),Z(n)&&(e[t]=ne(n))):Z(n)&&(e[t]=ne(n)),"Phone"!==t||$(n)||(n.length>8&&"+"===n.charAt(0)?(n=n.substring(1,n.length),Y(n)?e.Phone=+n:(o=!1,i.error(Le+". Removed."))):(o=!1,i.error(Le+". Removed."))),o||delete e[t]}return o},nt=e=>{const t={};t.Name=e.name,null!=e.id&&(t.FBID=e.id+""),"male"===e.gender?t.Gender="M":"female"===e.gender?t.Gender="F":t.Gender="O";null!=e.relationship_status&&(t.Married="N","Married"===e.relationship_status&&(t.Married="Y"));const i=function(e){if(null!=e){let t="",i="";for(let o=0;o0?"Y":"N",null!=e.email&&(t.Email=e.email),null!=e.birthday){const i=e.birthday.split("/");t.DOB=se(i[2]+i[0]+i[1])}return t},st=(e,t)=>{let{logger:i}=t;const o={};if(null!=e.displayName&&(o.Name=e.displayName),null!=e.id&&(o.GPID=e.id+""),null!=e.gender&&("male"===e.gender?o.Gender="M":"female"===e.gender?o.Gender="F":"other"===e.gender&&(o.Gender="O")),null!=e.image&&!1===e.image.isDefault&&(o.Photo=e.image.url.split("?sz")[0]),null!=e.emails)for(let t=0;t{if(ae._isLocalStorageSupported()){if(null==le.globalProfileMap&&(le.globalProfileMap=ae.readFromLSorCookie(x),null==le.globalProfileMap&&(le.globalProfileMap={})),null!=e._custom){const t=e._custom;for(const i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);delete e._custom}for(const i in e)if(e.hasOwnProperty(i)){if(le.globalProfileMap.hasOwnProperty(i)&&!t)continue;le.globalProfileMap[i]=e[i]}null!=le.globalProfileMap._custom&&delete le.globalProfileMap._custom,ae.saveToLSorCookie(x,le.globalProfileMap)}},at=(e,t,i)=>{if(null!=e&&"-1"!==e&&ae._isLocalStorageSupported()){const t=Xe();let o=t.wp[i];null==o&&(o={},t[i]=o),o[e]="dnd",et(t)}if(null!=le.campaignDivMap){const t=le.campaignDivMap[e];null!=t&&(document.getElementById(t).style.display="none","intentPreview"===t&&null!=document.getElementById("intentOpacityDiv")&&(document.getElementById("intentOpacityDiv").style.display="none"))}};var lt=t("logger"),ct=t("request"),dt=t("account"),ht=t("oldValues"),ut=t("isPersonalisationActive"),pt=t("processProfileArray");class gt extends Array{constructor(e,t){let{logger:o,request:n,account:s,isPersonalisationActive:r}=e;super(),Object.defineProperty(this,pt,{value:ft}),Object.defineProperty(this,lt,{writable:!0,value:void 0}),Object.defineProperty(this,ct,{writable:!0,value:void 0}),Object.defineProperty(this,dt,{writable:!0,value:void 0}),Object.defineProperty(this,ht,{writable:!0,value:void 0}),Object.defineProperty(this,ut,{writable:!0,value:void 0}),i(this,lt)[lt]=o,i(this,ct)[ct]=n,i(this,dt)[dt]=s,i(this,ht)[ht]=t,i(this,ut)[ut]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o0)for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];let n,s={};if(null!=o.Site){if(n=o.Site,$(n)||!ot(n,{logger:i(this,lt)[lt]}))return}else if(null!=o.Facebook){const e=o.Facebook;$(e)||e.error||(n=nt(e))}else if(null!=o["Google Plus"]){const e=o["Google Plus"];$(e)||e.error||(n=st(e,{logger:i(this,lt)[lt]}))}if(null!=n&&!$(n)){s.type="profile",null==n.tz&&(n.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),s.profile=n,rt(n,!0),s=i(this,ct)[ct].addSystemDataToObject(s,void 0),i(this,ct)[ct].addFlags(s);const e=Ke(JSON.stringify(s),i(this,lt)[lt]);let t=i(this,dt)[dt].dataPostURL;t=Ve(t,"type",A),t=Ve(t,"d",e),i(this,ct)[ct].saveAndFireRequest(t,le.blockRequest)}}},vt=t("request"),bt=t("logger"),mt=t("account"),yt=t("session"),wt=t("oldValues"),Ct=t("device"),kt=t("processOUL"),xt=t("handleCookieFromCache"),Pt=t("deleteUser"),St=t("processLoginArray");class It extends Array{constructor(e,t){let{request:o,account:n,session:s,logger:r,device:a}=e;super(),Object.defineProperty(this,St,{value:At}),Object.defineProperty(this,Pt,{value:Et}),Object.defineProperty(this,xt,{value:_t}),Object.defineProperty(this,kt,{value:Ot}),Object.defineProperty(this,vt,{writable:!0,value:void 0}),Object.defineProperty(this,bt,{writable:!0,value:void 0}),Object.defineProperty(this,mt,{writable:!0,value:void 0}),Object.defineProperty(this,yt,{writable:!0,value:void 0}),Object.defineProperty(this,wt,{writable:!0,value:void 0}),Object.defineProperty(this,Ct,{writable:!0,value:void 0}),i(this,vt)[vt]=o,i(this,mt)[mt]=n,i(this,yt)[yt]=s,i(this,bt)[bt]=r,i(this,wt)[wt]=t,i(this,Ct)[Ct]=a}clear(){i(this,bt)[bt].debug("clear called. Reset flag has been set."),i(this,Pt)[Pt](),ae.setMetaProp(g,!0)}push(){for(var e=arguments.length,t=new Array(e),o=0;o{let o=ae.readFromLSorCookie(m);const n=ae.readFromLSorCookie(b);let s;if(null==o)o={},s=e;else{s=o.id;let r=!1,a=!1;if(null==s&&(s=e[0],r=!0),null==le.LRU_CACHE&&ae._isLocalStorageSupported()&&(le.LRU_CACHE=new he(100)),r)null!=n&&(le.LRU_CACHE.set(s,n),le.blockRequest=!1);else for(const t in e)if(e.hasOwnProperty(t)){const i=e[t];if(le.LRU_CACHE.cache[i]){s=i,a=!0;break}}if(a){s!==le.LRU_CACHE.getLastKey()?i(this,xt)[xt]():(t=!1,ae.saveToLSorCookie(D,t));const e=le.LRU_CACHE.get(s);le.LRU_CACHE.set(s,e),ae.saveToLSorCookie(b,e),i(this,Ct)[Ct].gcookie=e;const o=le.LRU_CACHE.getSecondLastKey();if(ae.readFromLSorCookie(D)&&-1!==o){const e=le.LRU_CACHE.cache[o];i(this,vt)[vt].unregisterTokenForGuid(e)}}else r?null!=n&&(i(this,Ct)[Ct].gcookie=n,ae.saveToLSorCookie(b,n),t=!1):this.clear(),ae.saveToLSorCookie(D,!1),s=e[0]}o.id=s,ae.saveToLSorCookie(m,o)};if(Array.isArray(e)&&e.length>0)for(const n in e)if(e.hasOwnProperty(n)){const s=e[n];let r,a={};if(null!=s.Site){if(r=s.Site,$(r)||!ot(r,{logger:i(this,bt)[bt]}))return}else if(null!=s.Facebook){const e=s.Facebook;$(e)||e.error||(r=nt(e))}else if(null!=s["Google Plus"]){const e=s["Google Plus"];$(e)&&!e.error&&(r=st(e,{logger:i(this,bt)[bt]}))}if(null!=r&&!$(r)){a.type="profile",null==r.tz&&(r.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),a.profile=r;const e=[];ae._isLocalStorageSupported()&&(r.Identity&&e.push(r.Identity),r.Email&&e.push(r.Email),r.GPID&&e.push("GP:"+r.GPID),r.FBID&&e.push("FB:"+r.FBID),e.length>0&&o(e)),rt(r,!0),a=i(this,vt)[vt].addSystemDataToObject(a,void 0),i(this,vt)[vt].addFlags(a),t&&(a.isOUL=!0);const n=Ke(JSON.stringify(a),i(this,bt)[bt]);let s=i(this,mt)[mt].dataPostURL;s=Ve(s,"type",A),s=Ve(s,"d",n),i(this,vt)[vt].saveAndFireRequest(s,le.blockRequest,t)}}},_t=function(){le.blockRequest=!1,console.debug("Block request is false"),ae._isLocalStorageSupported()&&(delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),ae.removeCookie(y,We()),ae.removeCookie(i(this,yt)[yt].cookieName,le.broadDomain),ae.removeCookie(P,le.broadDomain),i(this,yt)[yt].setSessionCookieObject("")},Et=function(){le.blockRequest=!0,i(this,bt)[bt].debug("Block request is true"),le.globalCache={gcookie:null,REQ_N:0,RESP_N:0},ae._isLocalStorageSupported()&&(delete localStorage.WZRK_G,delete localStorage.WZRK_K,delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),ae.removeCookie(b,le.broadDomain),ae.removeCookie(y,We()),ae.removeCookie(m,We()),ae.removeCookie(i(this,yt)[yt].cookieName,le.broadDomain),ae.removeCookie(P,le.broadDomain),i(this,Ct)[Ct].gcookie=null,i(this,yt)[yt].setSessionCookieObject("")},At=function(e){if(Array.isArray(e)&&e.length>0){const t=e.pop();if(null!=t&&J(t)&&(null!=t.Site&&Object.keys(t.Site).length>0||null!=t.Facebook&&Object.keys(t.Facebook).length>0||null!=t["Google Plus"]&&Object.keys(t["Google Plus"]).length>0)){ae.setInstantDeleteFlagInK();try{i(this,kt)[kt]([t])}catch(e){i(this,bt)[bt].debug(e)}}else i(this,bt)[bt].error("Profile object is in incorrect format")}};class Lt extends HTMLElement{constructor(){super(),this._details=null,this.shadow=null,this.shadow=this.attachShadow({mode:"open"})}get details(){return this._details||""}set details(e){null===this._details&&(this._details=e,this.renderBanner())}renderBanner(){this.shadow.innerHTML=this.getBannerContent(),!1!==this.trackClick&&this.addEventListener("click",(()=>{const e=this.details.onClick;e&&(this.details.window?window.open(e,"_blank"):window.parent.location.href=e),window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId})}getBannerContent(){return'\n \n \n ")}}class Mt extends HTMLElement{constructor(){super(),this._target=null,this._carousel=null,this.shadow=null,this.slides=0,this.previouslySelectedItem=-1,this.selectedItem=1,this.autoSlide=null,this.stopAutoSlideTimeout=null,this.shadow=this.attachShadow({mode:"open"}),void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Lt)}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderCarousel())}get details(){return this.target.display.details}get display(){return this.target.display}renderCarousel(){this.slides=this.details.length,this.shadow.innerHTML=this.getStyles();const e=this.getCarouselContent();this.display.showNavBtns&&e.insertAdjacentHTML("beforeend",this.display.navBtnsHtml),this.display.showNavArrows&&(e.insertAdjacentHTML("beforeend",this.display.leftNavArrowHtml),e.insertAdjacentHTML("beforeend",this.display.rightNavArrowHtml)),this._carousel=e,this.shadow.appendChild(e),this.setupClick(),this.updateSelectedItem(),this.startAutoSlide(),this.setupOnHover(),window.clevertap.renderNotificationViewed({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot})}setupClick(){this._carousel.addEventListener("click",(e=>{const t=e.target.id;if(t.startsWith("carousel__button")){const e=+t.split("-")[1];e!==this.selectedItem&&(this.previouslySelectedItem=this.selectedItem,this.selectedItem=e,this.updateSelectedItem(),this.startAutoSlide())}else if(t.startsWith("carousel__arrow"))t.endsWith("right")?this.goToNext():this.goToPrev(),this.startAutoSlide();else if(t.indexOf("-")>-1){const e=+t.split("-")[1],i=e-1;window.parent.clevertap&&window.clevertap.renderNotificationClicked({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot,wzrk_slideNo:e});const o=this.details[i].onClick;""!==o&&(this.details[i].window?window.open(o,"_blank"):window.location.href=o)}}))}setupOnHover(){this._carousel.addEventListener("mouseenter",(e=>{this.stopAutoSlideTimeout=setTimeout((()=>{this.autoSlide=clearInterval(this.autoSlide)}),500)})),this._carousel.addEventListener("mouseleave",(e=>{clearTimeout(this.stopAutoSlideTimeout),void 0===this.autoSlide&&this.startAutoSlide()}))}getCarouselContent(){const e=document.createElement("div");return e.setAttribute("class","carousel"),this.details.forEach(((t,i)=>{const o=document.createElement("ct-web-personalisation-banner");o.classList.add("carousel__item"),o.trackClick=!1,o.setAttribute("id","carousel__item-".concat(i+1)),o.details=t,e.appendChild(o)})),e}getStyles(){var e,t;return"\n \n ")}updateSelectedItem(){if(-1!==this.previouslySelectedItem){const e=this.shadow.getElementById("carousel__item-".concat(this.previouslySelectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.previouslySelectedItem));e.classList.remove("carousel__item--selected"),t&&t.classList.remove("carousel__button--selected")}const e=this.shadow.getElementById("carousel__item-".concat(this.selectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.selectedItem));e.classList.add("carousel__item--selected"),t&&t.classList.add("carousel__button--selected")}startAutoSlide(){clearInterval(this.autoSlide),this.autoSlide=setInterval((()=>{this.goToNext()}),this.display.sliderTime?1e3*this.display.sliderTime:3e3)}goToNext(){this.goTo(this.selectedItem,(this.selectedItem+1)%this.slides)}goToPrev(){this.goTo(this.selectedItem,this.selectedItem-1)}goTo(e,t){this.previouslySelectedItem=e,this.selectedItem=t,0===t&&(this.selectedItem=this.slides),this.updateSelectedItem()}}class Tt extends HTMLElement{constructor(){super(),this._target=null,this._session=null,this.shadow=null,this.popup=null,this.container=null,this.resizeObserver=null,this.shadow=this.attachShadow({mode:"open"})}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderImageOnlyPopup())}get session(){return this._session||""}set session(e){this._session=e}get msgId(){return this.target.wzrk_id}get pivotId(){return this.target.wzrk_pivot}get onClickUrl(){return this.target.display.onClickUrl}renderImageOnlyPopup(){const e=this.target.wzrk_id.split("_")[0],t=this.session.sessionId;this.shadow.innerHTML=this.getImageOnlyPopupContent(),this.popup=this.shadowRoot.getElementById("imageOnlyPopup"),this.container=this.shadowRoot.getElementById("container"),this.closeIcon=this.shadowRoot.getElementById("close"),this.popup.addEventListener("load",this.updateImageAndContainerWidth()),this.resizeObserver=new ResizeObserver((()=>this.handleResize(this.popup,this.container))),this.resizeObserver.observe(this.popup),this.closeIcon.addEventListener("click",(()=>{if(this.resizeObserver.unobserve(this.popup),document.getElementById("wzrkImageOnlyDiv").style.display="none",this.remove(),null!=e&&"-1"!==e&&ae._isLocalStorageSupported()){const i=Xe();let o=i.wp[t];null==o&&(o={},i[t]=o),o[e]="dnd",et(i)}})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId}),this.onClickUrl&&this.popup.addEventListener("click",(()=>{this.target.display.window?window.open(this.onClickUrl,"_blank"):window.parent.location.href=this.onClickUrl,window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})}))}handleResize(e,t){const i=this.getRenderedImageWidth(e);t.style.setProperty("width","".concat(i,"px"))}getImageOnlyPopupContent(){return"\n ".concat(this.target.msgContent.css,"\n ").concat(this.target.msgContent.html,"\n ")}updateImageAndContainerWidth(){return()=>{const e=this.getRenderedImageWidth(this.popup);this.popup.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("height","auto"),this.container.style.setProperty("position","fixed"),this.popup.style.setProperty("visibility","visible"),this.closeIcon.style.setProperty("visibility","visible"),document.getElementById("wzrkImageOnlyDiv").style.visibility="visible"}}getRenderedImageWidth(e){const t=e.naturalWidth/e.naturalHeight;return e.height*t}}class Rt extends HTMLElement{constructor(e,t){super(),this.wrapper=null,this.snackBar=null,this.shadow=this.attachShadow({mode:"open"}),this.config=e,this.message=t,this.renderMessage(t)}get pivotId(){return this.message.wzrk_pivot}get campaignId(){return this.message.wzrk_id}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}renderMessage(e){switch(this.wrapper=this.createEl("div","messageWrapper"),e.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":{const t=this.prepareBasicMessage(e.msg[0]);this.wrapper.appendChild(t)}}const t=this.createEl("div","timeStamp");if(t.innerHTML="".concat(Wt(e.id.split("_")[1]),""),!e.viewed){const e=this.createEl("span","unreadMarker");t.appendChild(e)}this.wrapper.appendChild(t),this.shadow.appendChild(this.wrapper)}prepareBasicMessage(e){const t=this.createEl("div","message");if(e.imageUrl){const i=this.addImage(e.imageUrl,"mainImg");t.appendChild(i)}const i=this.createEl("div","iconTitleDescWrapper");if(e.iconUrl){const t=this.addImage(e.iconUrl,"iconImg");i.appendChild(t)}const o=this.createEl("div","titleDescWrapper");if(e.title){const t=this.createEl("div","title");t.innerText=e.title,o.appendChild(t)}if(e.description){const t=this.createEl("div","description");t.innerText=e.description,o.appendChild(t)}if((e.title||e.description)&&i.appendChild(o),(e.iconUrl||e.title||e.description)&&t.appendChild(i),e.buttons&&e.buttons.length){const i=this.addButtons(e.buttons);t.appendChild(i)}return t}addButtons(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.createEl("div","buttonsContainer");let i=!1;return e.forEach(((e,o)=>{const n=this.createEl("button","button-".concat(o),"button");n.innerText=e.text,o>0&&(n.style.cssText+="margin-left: 2px;"),"copy"===e.action&&(i=!0),t.appendChild(n)})),i&&this.addSnackbar(t),t}addSnackbar(e){this.snackBar=this.createEl("div","snackbar-".concat(this.campaignId),"snackbar"),this.snackBar.innerHTML=Ht;const t=this.createEl("span","snackbar-msg-".concat(this.campaignId),"snackbar-msg");t.innerText="Copied to clipboard",this.snackBar.appendChild(t),e.appendChild(this.snackBar)}addImage(e,t){const i=this.createEl("div","".concat(t,"Container")),o=this.createEl("img",t);return o.setAttribute("src",e),o.setAttribute("loading","lazy"),i.appendChild(o),i}raiseClickedEvent(e,t){switch(this.message.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":this.raiseClickedForBasicTemplates(e,t)}}raiseClickedForBasicTemplates(e,t){const i=this.message.msg[0],o={msgId:this.campaignId,pivotId:this.pivotId};if("BUTTON"===e.tagName){const t=e.id.split("-")[1],n=i.buttons[t];o.kv={wzrk_c2a:n.text},"url"===n.action?n.openUrlInNewTab?window.open(n.url,"_blank"):window.location=n.url:"copy"===n.action&&(window.focus(),navigator.clipboard.writeText(n.clipboardText),this.snackBar.style.setProperty("display","flex","important"),setTimeout((()=>{this.snackBar.style.setProperty("display","none","important")}),2e3))}else"CT-INBOX-MESSAGE"===e.tagName&&i.onClickUrl&&(i.openUrlInNewTab?window.open(i.onClickUrl,"_blank"):window.location=i.onClickUrl);t?console.log("Notifiction clicked event will be raised at run time with payload ::",o):window.clevertap.renderNotificationClicked(o)}}class jt extends HTMLElement{constructor(e){super(),this.isInboxOpen=!1,this.isInboxFromFlutter=!1,this.selectedCategory=null,this.unviewedMessages={},this.unviewedCounter=0,this.isPreview=!1,this.inboxConfigForPreview={},this.inboxSelector=null,this.inbox=null,this.emptyInboxMsg=null,this.inboxCard=null,this.unviewedBadge=null,this.observer=null,this.selectedCategoryRef=null,this.addClickListenerOnDocument=(()=>e=>{if(e.composedPath().includes(this.inbox)){const t=e.path||e.composedPath&&e.composedPath();if(t.length){const e=t[0].id;if("closeInbox"===e)this.toggleInbox();else if(e.startsWith("category-"))this.prevCategoryRef=this.selectedCategoryRef,this.selectedCategoryRef=t[0],this.updateActiveCategory(t[0].innerText);else{const e=t.filter((e=>{var t;return(null===(t=e.id)||void 0===t?void 0:t.startsWith("button-"))||"CT-INBOX-MESSAGE"===e.tagName}));if(e.length){e[e.length-1].raiseClickedEvent(e[0],this.isPreview)}}}}else(this.inboxSelector.contains(e.target)||this.isInboxOpen)&&(this.isInboxFromFlutter?this.isInboxFromFlutter=!1:this.toggleInbox(e))})(),this.setBadgeStyle=e=>{null!==this.unviewedBadge&&(this.unviewedBadge.innerText=e>9?"9+":e,this.unviewedBadge.style.display=e>0?"flex":"none")},this.logger=e,this.shadow=this.attachShadow({mode:"open"})}get incomingMessages(){return[]}set incomingMessages(e){void 0===e&&(e=[]),e.length>0&&this.inbox&&this.updateInboxMessages(e)}get incomingMessagesForPreview(){return[]}set incomingMessagesForPreview(e){void 0===e&&(e=[]);const t={};e.length>0&&this.inbox&&(this.isPreview=!0,this.unviewedCounter=0,e.forEach((e=>{const i="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=i,t[i]=e,this.unviewedMessages[i]=e,this.unviewedCounter++})),this.buildUIForMessages(t),this.updateUnviewedBadgeCounter())}connectedCallback(){this.init()}init(){this.config=this.isPreview?this.inboxConfigForPreview:ae.readFromLSorCookie(q)||{},0!==Object.keys(this.config).length&&(this.inboxSelector=document.getElementById(this.config.inboxSelector),null!==this.inboxSelector&&(this.config.styles.notificationsBadge?this.addUnviewedBadge():this.unviewedBadge&&this.unviewedBadge.remove(),this.createinbox(),document.removeEventListener("click",this.addClickListenerOnDocument),document.addEventListener("click",this.addClickListenerOnDocument),this.config.categories.length&&this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadow.innerHTML=this.getInboxStyles(),this.shadow.appendChild(this.inbox)))}addMsgsToInboxFromLS(){const e=this.deleteExpiredAndGetUnexpiredMsgs(!1),t=e?Object.keys(e):[];0!==t.length&&(t.forEach((t=>{e[t].viewed||(this.unviewedMessages[t]=e[t],this.unviewedCounter++)})),this.buildUIForMessages(e),this.updateUnviewedBadgeCounter())}deleteExpiredAndGetUnexpiredMsgs(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Nt();const i=Math.floor(Date.now()/1e3);for(const o in t)if(t[o].wzrk_ttl&&t[o].wzrk_ttl>0&&t[o].wzrk_ttl0&&(t=Object.values(t).sort(((e,t)=>t.date-e.date)).reduce(((e,t)=>(e[t.id]=t,e)),{})),Ft(t),t}updateInboxMessages(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.deleteExpiredAndGetUnexpiredMsgs(),i=Date.now(),o={};e.forEach(((e,n)=>{const s="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=s,e.date=i-n,e.viewed=0,t[s]=e,o[s]=e,this.unviewedMessages[s]=e,this.unviewedCounter++})),Ft(t),this.buildUIForMessages(o),this.updateUnviewedBadgeCounter()}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}addUnviewedBadge(){this.unviewedBadge||(this.unviewedBadge=this.createEl("div","unviewedBadge"),this.unviewedBadge.style.cssText="display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ".concat(this.config.styles.notificationsBadge.backgroundColor,"; font-size: 12px; color: ").concat(this.config.styles.notificationsBadge.textColor,"; font-weight: bold; align-items: center; justify-content: center;"),document.body.appendChild(this.unviewedBadge)),this.updateUnviewedBadgePosition(),window.addEventListener("resize",(()=>{this.updateUnviewedBadgePosition()}))}updateUnviewedBadgePosition(){const{top:e,right:t}=this.inboxSelector.getBoundingClientRect();this.unviewedBadge.style.top="".concat(e-8,"px"),this.unviewedBadge.style.left="".concat(t-8,"px")}createinbox(){this.inbox=this.createEl("div","inbox");const e=this.createEl("div","header"),t=this.createEl("div","headerTitle");t.innerText=this.config.title;const i=this.createEl("div","closeInbox");if(i.innerHTML="×",e.appendChild(t),e.appendChild(i),this.inbox.appendChild(e),this.config.categories.length){const e=this.createCategories();this.inbox.appendChild(e)}this.inboxCard=this.createEl("div","inboxCard"),this.inbox.appendChild(this.inboxCard),this.emptyInboxMsg=this.createEl("div","emptyInboxMsg"),this.emptyInboxMsg.innerText="All messages will be displayed here.",this.inboxCard.appendChild(this.emptyInboxMsg);const o={root:this.inboxCard,rootMargin:"0px",threshold:.5};this.observer=new IntersectionObserver(((e,t)=>{this.handleMessageViewed(e)}),o),this.addMsgsToInboxFromLS()}createCategories(){const e=this.createEl("div","categoriesContainer"),t=this.createEl("div","leftArrow");t.innerHTML=Gt,t.children[0].style="transform: rotate(180deg)",t.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(-70,0)})),e.appendChild(t);const i=this.createEl("div","categoriesWrapper");["All",...this.config.categories].forEach(((e,t)=>{const o=this.createEl("div","category-".concat(t),"category");o.innerText=e,0===t&&(this.selectedCategoryRef=o),i.appendChild(o)})),e.appendChild(i);const o=this.createEl("div","rightArrow");o.innerHTML=Gt,o.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(70,0)})),e.appendChild(o);const n={root:e,threshold:.9},s=i.children[0],r=i.children[this.config.categories.length];new IntersectionObserver((e=>{this.categoryObserverCb(t,e[0].intersectionRatio>=.9)}),n).observe(s);return new IntersectionObserver((e=>{this.categoryObserverCb(o,e[0].intersectionRatio>=.9)}),n).observe(r),e}categoryObserverCb(e,t){e&&(e.style.display=t?"none":"flex")}updateActiveCategory(e){this.selectedCategory=e,this.inboxCard.scrollTop=0;let t=0;this.prevCategoryRef&&this.prevCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef.setAttribute("selected","true"),this.inboxCard.childNodes.forEach((e=>{"emptyInboxMsg"!==e.getAttribute("id")&&(e.style.display="All"===this.selectedCategory||e.getAttribute("category")===this.selectedCategory?"block":"none","block"===e.style.display&&t++)})),0===t?(this.emptyInboxMsg.innerText="".concat(e," messages will be displayed here."),this.emptyInboxMsg.style.display="block"):this.emptyInboxMsg.style.display="none"}buildUIForMessages(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!this.isPreview&&this.updateTSForRenderedMsgs(),this.inboxCard.scrollTop=0;const i=null!==(e=this.config.maxMsgsInInbox)&&void 0!==e?e:15,o=this.inboxCard.firstChild,n=Object.values(t).sort(((e,t)=>t.date-e.date)).map((e=>e.id));for(const e of n){const i=new Rt(this.config,t[e]);i.setAttribute("id",t[e].id),i.setAttribute("pivot",t[e].wzrk_pivot),i.setAttribute("part","ct-inbox-message"),this.config.categories.length>0?(i.setAttribute("category",t[e].tags[0]||""),i.style.display="All"===this.selectedCategory||t[e].category===this.selectedCategory?"block":"none"):i.style.display="block",this.inboxCard.insertBefore(i,o),this.observer.observe(i)}let s=this.inboxCard.querySelectorAll("ct-inbox-message").length;for(;s>i;){const e=this.inboxCard.querySelectorAll("ct-inbox-message");e.length>0&&e[e.length-1].remove(),s--}const r=this.inboxCard.querySelectorAll('ct-inbox-message[style*="display: block"]').length;this.emptyInboxMsg.style.display=r?"none":"block"}handleMessageViewed(e){const t=!this.isPreview;this.isInboxOpen&&e.forEach((e=>{e.isIntersecting&&this.unviewedMessages.hasOwnProperty(e.target.id)&&0===e.target.message.viewed&&(e.target.message.viewed=1,t?(window.clevertap.renderNotificationViewed({msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.updateMessageInLS(e.target.id,{...e.target.message,viewed:1}),setTimeout((()=>{e.target.shadowRoot.getElementById("unreadMarker").style.display="none"}),1e3)):console.log("Notifiction viewed event will be raised at run time with payload ::",{msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.unviewedCounter--,this.updateUnviewedBadgeCounter(),delete this.unviewedMessages[e.target.id])}))}updateMessageInLS(e,t){if(!this.isPreview){const i=Nt();i[e]=t,Ft(i)}}toggleInbox(e){this.isInboxOpen=!this.isInboxOpen,this.isInboxFromFlutter=!!(null==e?void 0:e.rect),this.isInboxOpen?(this.inboxCard.scrollTop=0,!this.isPreview&&this.deleteExpiredAndGetUnexpiredMsgs(),this.inbox.style.display="block",this.inbox.style.zIndex="2147483647",this.config.categories.length&&(this.selectedCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef=this.shadowRoot.getElementById("category-0"),this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadowRoot.getElementById("categoriesWrapper").scrollLeft-=this.shadowRoot.getElementById("categoriesWrapper").scrollWidth),this.setInboxPosition(e)):this.inbox.style.display="none"}setInboxPosition(e){const t=window.outerWidth,i=getComputedStyle(le.inbox),o=i.getPropertyValue("--inbox-top"),n=i.getPropertyValue("--inbox-bottom"),s=i.getPropertyValue("--inbox-left"),r=i.getPropertyValue("--inbox-right");if(t>481&&!(o||n||s||r)){const t=Vt(e,this.inbox.clientHeight,this.inbox.clientWidth),i=t.xPos,o=t.yPos;this.inbox.style.top=o+"px",this.inbox.style.left=i+"px"}}updateUnviewedBadgeCounter(){if(this.isPreview)return void this.setBadgeStyle(this.unviewedCounter);let e=0;this.inboxCard.querySelectorAll("ct-inbox-message").forEach((t=>{const i=Nt();i[t.id]&&0===i[t.id].viewed&&e++})),this.setBadgeStyle(e)}updateTSForRenderedMsgs(){this.inboxCard.querySelectorAll("ct-inbox-message").forEach((e=>{const t=e.id.split("_")[1];e.shadow.getElementById("timeStamp").firstChild.innerText=Wt(t)}))}getInboxStyles(){const e=this.config.categories.length?64:16,t={panelBackgroundColor:this.config.styles.panelBackgroundColor,panelBorderColor:this.config.styles.panelBorderColor,headerBackgroundColor:this.config.styles.header.backgroundColor,headerTitleColor:this.config.styles.header.titleColor,closeIconColor:this.config.styles.closeIconColor,categoriesTabColor:this.config.styles.categories.tabColor,categoriesTitleColor:this.config.styles.categories.titleColor,selectedCategoryTabColor:this.config.styles.categories.selectedTab.tabColor,selectedCategoryTitleColor:this.config.styles.categories.selectedTab.titleColor,headerCategoryHeight:36+e};this.config.styles.categories.borderColor&&(t.categoriesBorderColor=this.config.styles.categories.borderColor),this.config.styles.categories.selectedTab.borderColor&&(t.selectedCategoryBorderColor=this.config.styles.categories.selectedTab.borderColor);const i=(e=>{let{panelBackgroundColor:t,panelBorderColor:i,headerBackgroundColor:o,headerTitleColor:n,closeIconColor:s,categoriesTabColor:r,categoriesTitleColor:a,categoriesBorderColor:l,selectedCategoryTabColor:c,selectedCategoryTitleColor:d,selectedCategoryBorderColor:h,headerCategoryHeight:u}=e;return'\n \n ")})(t),o=this.config.styles.cards;return i+(e=>{let{backgroundColor:t,borderColor:i,titleColor:o,descriptionColor:n,buttonColor:s,buttonTextColor:r,unreadMarkerColor:a}=e;return'\n \n ")})({backgroundColor:o.backgroundColor,borderColor:o.borderColor,titleColor:o.titleColor,descriptionColor:o.descriptionColor,buttonColor:o.buttonColor,buttonTextColor:o.buttonTextColor,unreadMarkerColor:o.unreadMarkerColor})}}const Dt=e=>{e.inbox_preview?le.inbox.incomingMessagesForPreview=e.inbox_notifs:le.inbox.incomingMessages=e},zt=e=>{qt(),le.inbox=new jt({logger:e}),document.body.appendChild(le.inbox)},Bt=e=>{const t=ae.readFromLSorCookie(V)||{};if(Object.keys(t).length>0&&Object.keys(t)[0].includes("_")){const i={};return i[e]=t,ae.saveToLSorCookie(V,i),i}return t},Nt=()=>{const e=JSON.parse(decodeURIComponent(ae.read(b)));if(!X(e))return{};const t=Bt(e);return t.hasOwnProperty(e)?t[e]:{}},Ft=e=>{const t=JSON.parse(decodeURIComponent(ae.read(b)));if(!X(t))return;const i={...Bt(t),[t]:e};ae.saveToLSorCookie(V,i)},Ut=e=>new Promise(((t,i)=>{if("complete"===document.readyState)zt(e),t();else{const i=ae.readFromLSorCookie(q)||{},o=()=>{null===le.inbox&&zt(e),t()};window.addEventListener("load",(()=>{if(document.getElementById(i.inboxSelector))o();else{let n=0;if(n<20){const s=setInterval((()=>{document.getElementById(i.inboxSelector)?(o(),clearInterval(s),t()):n>=20&&(clearInterval(s),e.debug("Failed to add inbox")),n++}),500)}}}))}})),qt=()=>{void 0===customElements.get("ct-web-inbox")&&(customElements.define("ct-web-inbox",jt),customElements.define("ct-inbox-message",Rt))},Vt=(e,t,i)=>{const o=document.scrollingElement.scrollLeft,n=document.scrollingElement.scrollTop,s=window.innerWidth+o,r=window.innerHeight+n,a=e.rect||e.target.getBoundingClientRect(),l=a.x+o,c=a.y+n,d=a.left+o,h=a.right+o,u=a.top+n,p=a.bottom,g=a.height,f=a.width;let v,b,m=!1;const y=16;if(p+t<=r){const e=r-(p+t);b=e>=y?p+y:p+e}else if(u-t>=n){const e=u-t;b=e>=y?u-t-y:u-t-e}else m=!0,b=c+g/2-t/2,br&&(b=r-t);if(m){const e=h+i;if(e<=s){v=h+(e+y<=s?y:s-e)}else{const e=d-i;v=e-(e-y>=o?y:e-o)}}else v=l+f/2-i/2,vs&&(v=h-i>=o?h-i:s-i);return{xPos:v,yPos:b}},Wt=e=>{const t=Date.now();let i=Math.floor((t-e)/6e4);return i<5?"Just now":i<60?"".concat(i," minute").concat(i>1?"s":""," ago"):(i=Math.floor(i/60),i<24?"".concat(i," hour").concat(i>1?"s":""," ago"):(i=Math.floor(i/24),"".concat(i," day").concat(i>1?"s":""," ago")))},Kt=()=>Object.keys(ae.readFromLSorCookie(q)||{}).length>0,Gt='\n\n\n',Ht='\n\n\n',Jt=(e,t)=>{document.addEventListener("DOMContentLoaded",(()=>function(e,t){document.body.innerHTML="",Zt=document.createElement("div"),Zt.id="overlayDiv",Zt.style.position="relative",Zt.style.display="flex",document.body.appendChild(Zt);(function(e,t,i){return new Promise(((o,n)=>{var s=document.createElement("script");s.type="module",s.src=e,s.onload=function(){"function"==typeof window.Overlay?(window.Overlay("#overlayDiv",t,i),o()):n(new Error("ContentLayout not found in overlay.js"))},s.onerror=function(e){n(e)},document.head.appendChild(s)}))})("https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js",e,t).then((()=>{console.log("Overlay script loaded successfully.")})).catch((e=>{console.error("Error loading overlay script:",e)})),d=document.createElement("link"),d.rel="stylesheet",d.type="text/css",d.href="https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css",document.head.appendChild(d),o={kitId:"eqj6nom",scriptTimeout:3e3,async:!0},n=document,s=n.documentElement,r=setTimeout((function(){s.className=s.className.replace(/\bwf-loading\b/g,"")+" wf-inactive"}),o.scriptTimeout),a=n.createElement("script"),l=!1,c=n.getElementsByTagName("script")[0],s.className+=" wf-loading",a.src="https://use.typekit.net/"+o.kitId+".js",a.async=!0,a.onload=a.onreadystatechange=function(){if(i=this.readyState,!(l||i&&"complete"!==i&&"loaded"!==i)){l=!0,clearTimeout(r);try{Typekit.load(o)}catch(e){}}},c.parentNode.insertBefore(a,c);var i,o,n,s,r,a,l,c;var d}(e,t)))};let Zt;const $t=(e,t)=>{const i=e.display.details[0],o=Object.keys(i)[0],n=i[o];if(o===window.location.href)for(const i in n){const o=document.querySelector(i);if(o)n[i].html&&(o.outerHTML=n[i].html),t||window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot});else{let o=0;const s=setInterval((()=>{const r=document.querySelector(i);r?(n[i].html&&(r.outerHTML=n[i].html),t||window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot}),clearInterval(s)):(o++,o>=20&&(console.log("No element present on DOM with selector '".concat(i,"'.")),clearInterval(s)))}),500)}}},Yt=(e,t)=>{let{device:i,session:o,request:n,logger:s}=t;const r=i,a=o,l=n,c=s;let d=0;const h=t=>{const i=t.wzrk_id.split("_")[0],o=ie(),n=(e,t,i)=>{let o=0,n=0;null!=e[t]&&(o=e[t]),o++,null!=e.tc&&(n=e.tc),i<0&&n++,e.tc=n,e[t]=o};if(ae._isLocalStorageSupported()){delete sessionStorage.WZRK_CAMP;var s={};const e=Xe();s=3===t.display.wtarget_type&&e.hasOwnProperty("wi")?e.wi:0!==t.display.wtarget_type&&1!==t.display.wtarget_type||!e.hasOwnProperty("wp")?{}:e.wp,e.hasOwnProperty("global")&&(s.wp=e),null==t.display.wmc&&(t.display.wmc=1),null==t.display.wimc&&(t.display.wimc=1);var d=-1;let n=-1,r=-1,l=-1,c=-1,g=-1,f=-1;null!=t.display.efc&&(d=parseInt(t.display.efc,10)),null!=t.display.mdc&&(n=parseInt(t.display.mdc,10)),null!=t.display.tdc&&(r=parseInt(t.display.tdc,10)),null!=t.display.tlc&&(l=parseInt(t.display.tlc,10)),null!=t.display.wmp&&(c=parseInt(t.display.wmp,10)),null!=t.display.wmc&&(g=parseInt(t.display.wmc,10)),null!=t.display.wimc&&(f=parseInt(t.display.wimc,10));var h=s[a.sessionId];if(h){const e=h[i],o=h.tc;if("dnd"===e&&!le.dismissSpamControl)return!1;if(3===t.display.wtarget_type){if(f>0&&o>=f&&d<0)return!1}else if(g>0&&o>=g&&d<0)return!1;if(n>0&&e>=n)return!1}else h={},s[a.sessionId]=h;var u=s[o];if(null!=u){const e=u[i],t=u.tc;if(c>0&&t>=c&&d<0)return!1;if(r>0&&e>=r)return!1}else u={},s[o]=u;var p=s.global;if(null!=p){const e=p[i];if(l>0&&e>=l)return!1}else p={},s.global=p}if(null!=t.display.delay&&t.display.delay>0){const i=t.display.delay;return t.display.delay=0,setTimeout(Yt,1e3*i,e,{device:r,session:a,request:l,logger:c}),!1}n(h,i,d),n(u,i,d),n(p,i,d);let g="wp";3===t.display.wtarget_type&&(g="wi");const f={};f[a.sessionId]=h,f[o]=u,f.global=p,et({[g]:f})},u=()=>{const e=r.getGuid(),t=a.getSessionCookieObject();return"&t=wc&d="+encodeURIComponent(He(e+"|"+t.p+"|"+t.s))},p=(e,t)=>{const i=window.parent[e];"function"==typeof i&&(null!=t.display.kv?i(t.display.kv):i())},g=(e,t,i,o,n)=>{f(t),((e,t,i,o,n)=>{if(""!==e&&null!=e){let o,s;n?o=i:null!==i&&(s=i.getElementsByClassName("jsCT_CTA"),null!=s&&1===s.length&&(o=s[0]));const r=t.display.jsFunc,l=t.display.preview;null==l&&(e+=u()),null!=o&&(o.onclick=()=>{if(null!=r)return null==l&&Qe.fireRequest(e),p(r,t),void at("-1",0,a.sessionId);1===t.display.window?window.open(e,"_blank"):window.location=e})}})(e,t,i,0,n)},f=e=>{const t={type:"event"};t.evtName=R,t.evtData={[T]:e.wzrk_id},e.wzrk_pivot&&(t.evtData={...t.evtData,wzrk_pivot:e.wzrk_pivot}),l.processEvent(t)},v=e=>{var t;void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Lt);const i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,o=document.createElement("ct-web-personalisation-banner");o.msgId=e.wzrk_id,o.pivotId=e.wzrk_pivot,o.divHeight=e.display.divHeight,o.details=e.display.details[0];const n=e.display.divId?document.getElementById(i):document.querySelector(i);n.innerHTML="",n.appendChild(o)},m=e=>{var t;void 0===customElements.get("ct-web-personalisation-carousel")&&customElements.define("ct-web-personalisation-carousel",Mt);const i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,o=document.createElement("ct-web-personalisation-carousel");o.target=e;const n=e.display.divId?document.getElementById(i):document.querySelector(i);n.innerHTML="",n.appendChild(o)},y=e=>{const t=e.wzrk_id.split("_")[0],i=e.display;if(2===i.wtarget_type&&1===e.msgContent.type){const t={};t.msgId=e.wzrk_id,e.wzrk_pivot&&(t.pivotId=e.wzrk_pivot),null!=e.msgContent.kv&&(t.kv=e.msgContent.kv);const i=new CustomEvent("CT_web_native_display",{detail:t});return void document.dispatchEvent(i)}if(1===i.layout)return O(void 0,e);if(3===i.layout){const t="wzrkImageOnlyDiv";if(!1===h(e))return;if(le.dismissSpamControl&&null!=document.getElementById(t)){document.getElementById(t).remove()}if(null!=document.getElementById(t)||null!=document.getElementById("intentPreview"))return;const i=document.createElement("div");return i.id=t,document.body.appendChild(i),void 0===customElements.get("ct-web-popup-imageonly")&&customElements.define("ct-web-popup-imageonly",Tt),(e=>{const t=document.createElement("ct-web-popup-imageonly");t.session=a,t.target=e;const i=document.getElementById("wzrkImageOnlyDiv");i.innerHTML="",i.style.visibility="hidden",i.appendChild(t)})(e)}if(!1===h(e))return;const o="wizParDiv"+i.layout;if(le.dismissSpamControl&&null!=document.getElementById(o)){document.getElementById(o).remove()}if(null!=document.getElementById(o))return;le.campaignDivMap[t]=o;const n=2===i.layout,s=document.createElement("div");s.id=o;const r=window.innerHeight,l=window.innerWidth;let c=!1;if(n)s.setAttribute("style",i.iFrameStyle);else{var d=10;let e=5*l/100,t=d+5*r/100,o=30*l/100+20,n="width:30%;";(/mobile/i.test(navigator.userAgent)||/mini/i.test(navigator.userAgent))&&!1===/iPad/i.test(navigator.userAgent)?(o=85*l/100+20,e=5*l/100,t=5*r/100,n="width:80%;"):("ontouchstart"in window||/tablet/i.test(navigator.userAgent))&&(o=50*l/100+20,e=5*l/100,t=5*r/100,n="width:50%;"),null==i.proto?(c=!0,s.setAttribute("style","display:block;overflow:hidden; bottom:"+t+"px !important;width:"+o+"px !important;right:"+e+"px !important;position:fixed;z-index:2147483647;")):s.setAttribute("style",n+i.iFrameStyle)}document.body.appendChild(s);const u=document.createElement("iframe"),p=!1===i.br?"0":"8";u.frameborder="0px",u.marginheight="0px",u.marginwidth="0px",u.scrolling="no",u.id="wiz-iframe";const f=e.display.onClick;let v,b="";if(""!==f&&null!=f&&(b="cursor:pointer;"),1===e.msgContent.type)v=e.msgContent.html,v=v.replace(/##campaignId##/g,t),v=v.replace(/##campaignId_batchId##/g,e.wzrk_id);else{const i='";let n,s,r,a,l;"dark"===e.display.theme?(n="#2d2d2e",s="#eaeaea",r="#353535",a="#353535",l="#ffffff"):(n="#ffffff",s="#000000",a="#f4f4f4",r="#a5a6a6",l="#ffffff");const c=e.msgContent.title,d=e.msgContent.description;let h="";null!=e.msgContent.imageUrl&&""!==e.msgContent.imageUrl&&(h="");v=i+("
×
"+h+"
"+c+"
")+("
"+d+"
")}u.setAttribute("style","z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;"),s.appendChild(u);const m=(u.contentWindow?u.contentWindow:u.contentDocument.document?u.contentDocument.document:u.contentDocument).document,y=new Event("CT_campaign_rendered");document.dispatchEvent(y),m.open(),m.write(v),i["custom-editor"]&&k(e,m),m.close();const w=()=>{d=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv").scrollHeight,!0===i["custom-editor"]||n||(d+=25),document.getElementById("wiz-iframe").contentDocument.body.style.margin="0px",document.getElementById("wiz-iframe").style.height=d+"px"},C=navigator.userAgent.toLowerCase();if(-1!==C.indexOf("safari"))if(C.indexOf("chrome")>-1)u.onload=()=>{w();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)};else{let t=u.contentDocument||u.contentWindow;t.document&&(t=t.document),w();const i=setInterval((()=>{if("complete"===t.readyState){clearInterval(i),w();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)}}),10)}else u.onload=()=>{w();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)}},k=(e,t)=>{const i=t.createElement("script");i.innerHTML="\n const ct__camapignId = '".concat(e.wzrk_id,"';\n const ct__formatVal = (v) => {\n return v && v.trim().substring(0, 20);\n }\n const ct__parentOrigin = window.parent.origin;\n document.body.addEventListener('click', (event) => {\n const elem = event.target.closest?.('a[wzrk_c2a], button[wzrk_c2a]');\n if (elem) {\n const {innerText, id, name, value, href} = elem;\n const clickAttr = elem.getAttribute('onclick') || elem.getAttribute('click');\n const onclickURL = clickAttr?.match(/(window.open)[(](\"|')(.*)(\"|',)/)?.[3] || clickAttr?.match(/(location.href *= *)(\"|')(.*)(\"|')/)?.[3];\n const props = {innerText, id, name, value};\n let msgCTkv = Object.keys(props).reduce((acc, c) => {\n const formattedVal = ct__formatVal(props[c]);\n formattedVal && (acc['wzrk_click_' + c] = formattedVal);\n return acc;\n }, {});\n if(onclickURL) { msgCTkv['wzrk_click_' + 'url'] = onclickURL; }\n if(href) { msgCTkv['wzrk_click_' + 'c2a'] = href; }\n const notifData = { msgId: ct__camapignId, msgCTkv, pivotId: '").concat(e.wzrk_pivot,"' };\n window.parent.clevertap.renderNotificationClicked(notifData);\n }\n });\n "),t.body.appendChild(i)};let x=!1;const S=e=>{let t=e.display.onClick;if(window.clevertap.hasOwnProperty("notificationCallback")&&void 0!==window.clevertap.notificationCallback&&"function"==typeof window.clevertap.notificationCallback){const i=window.clevertap.notificationCallback;if(!x){const o={};o.msgContent=e.msgContent,o.msgId=e.wzrk_id,e.wzrk_pivot&&(o.pivotId=e.wzrk_pivot),null!=e.display.kv&&(o.kv=e.display.kv),window.clevertap.raiseNotificationClicked=()=>{if(""!==t&&null!=t){const i=e.display.jsFunc;if(t+=u(),null!=i)return Qe.fireRequest(t),void p(i,e);1===e.display.window?window.open(t,"_blank"):window.location=t}},window.clevertap.raiseNotificationViewed=()=>{f(e)},i(o),x=!0}}else if(window.clevertap.popupCurrentWzrkId=e.wzrk_id,y(e),window.clevertap.hasOwnProperty("popupCallbacks")&&void 0!==window.clevertap.popupCallbacks&&"function"==typeof window.clevertap.popupCallbacks[e.wzrk_id]){const t=window.clevertap.popupCallbacks[e.wzrk_id],n={};n.msgContent=e.msgContent,n.msgId=e.wzrk_id,e.wzrk_pivot&&(n.pivotId=e.wzrk_pivot);var i=[];for(var o in e)if(o.startsWith(M)&&o!==T){const t={[o]:e[o]};i.push(t)}i.length>0&&(n.msgCTkv=i),null!=e.display.kv&&(n.kv=e.display.kv),window.clevertap.raisePopupNotificationClicked=t=>{if(!t||!t.msgId)return;const i={type:"event"};if(i.evtName=j,i.evtData={[T]:t.msgId},e.wzrk_pivot&&(i.evtData={...i.evtData,wzrk_pivot:t.pivotId}),t.msgCTkv)for(var o of t.msgCTkv)i.evtData={...i.evtData,...o};l.processEvent(i)},t(n)}};let I;const O=(e,t)=>{let i;if(null!=e&&e.clientY>0)return;if(i=null==t?I:t,le.dismissSpamControl&&0===i.display.wtarget_type&&null!=document.getElementById("intentPreview")&&null!=document.getElementById("intentOpacityDiv")){document.getElementById("intentPreview").remove(),document.getElementById("intentOpacityDiv").remove()}if(null!=document.getElementById("intentPreview")||null!=document.getElementById("wzrkImageOnlyDiv"))return;if(null==i.display.layout&&(/mobile/i.test(navigator.userAgent)||/mini/i.test(navigator.userAgent)||/iPad/i.test(navigator.userAgent)||"ontouchstart"in window||/tablet/i.test(navigator.userAgent)))return;if(!1===h(i))return;const o=i.wzrk_id.split("_")[0];le.campaignDivMap[o]="intentPreview";let n=!1;const s=document.createElement("div");s.id="intentOpacityDiv";const r=i.display.opacity||.7,a="rgba(0,0,0,".concat(r,")");s.setAttribute("style","position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ".concat(a,";")),document.body.appendChild(s);const l=document.createElement("div");l.id="intentPreview",null==i.display.proto?(n=!0,l.setAttribute("style","display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;")):l.setAttribute("style",i.display.iFrameStyle),document.body.appendChild(l);const c=document.createElement("iframe"),d=!1===i.display.br?"0":"8";c.frameborder="0px",c.marginheight="0px",c.marginwidth="0px",c.scrolling="no",c.id="wiz-iframe-intent";const u=i.display.onClick;let p,f="";if(""!==u&&null!=u&&(f="cursor:pointer;"),1===i.msgContent.type)p=i.msgContent.html,p=p.replace(/##campaignId##/g,o),p=p.replace(/##campaignId_batchId##/g,i.wzrk_id);else{const e='";let t,n,s,r;"dark"===i.display.theme?(t="#2d2d2e",n="#eaeaea",s="#353535",r="#ffffff"):(t="#ffffff",n="#000000",s="#a5a6a6",r="#ffffff");const a=i.msgContent.title,l=i.msgContent.description;let c="";null!=i.msgContent.ctaText&&""!==i.msgContent.ctaText&&(c="");let h="";null!=i.msgContent.imageUrl&&""!==i.msgContent.imageUrl&&(h="
+a+
");p=e+("
×
"+a+"
")+("
"+l+"
"+h+c+"
")}c.setAttribute("style","z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;"),l.appendChild(c);const v=(c.contentWindow?c.contentWindow:c.contentDocument.document?c.contentDocument.document:c.contentDocument).document,b=new Event("CT_campaign_rendered");document.dispatchEvent(b),v.open(),v.write(p),i.display["custom-editor"]&&k(i,v),v.close();const m=document.getElementById("wiz-iframe-intent").contentDocument.getElementById("contentDiv");g(u,i,m,0,n)};if(!document.body)return void(d<6&&(d++,setTimeout(Yt,1e3,e,{device:r,session:a,request:l,logger:c})));const _=e=>{Object.keys(e).map((t=>{var i,o;e[t].display.divId?(i=e[t].display.divId,o=document.getElementById(i)):(i=e[t].display.divSelector,o=document.querySelector(i)),null!==o&&(2===e[t].msgContent.type?v(e[t]):m(e[t]),delete e[t])}))};if(null!=e.inapp_notifs){const t={};for(let i=0;i{window.addEventListener("load",(()=>{let t=0;if(t<20){const i=setInterval((()=>{_(e),0!==Object.keys(e).length&&20!==t||(clearInterval(i),e={}),t++}),500)}}))})(t))}const E=()=>{if(e.inbox_preview)Dt(e);else if(e.inbox_notifs){const t=[];for(let i=0;i1&&void 0!==arguments[1]&&arguments[1];const i=ae.readFromLSorCookie(q)||{};t?(le.inbox.inboxConfigForPreview=e,le.inbox.isPreview=!0,le.inbox&&le.inbox.init()):JSON.stringify(i)!==JSON.stringify(e)&&(ae.saveToLSorCookie(q,e),le.inbox&&le.inbox.init())}(e.webInboxSetting),Ut(c).then((()=>{E()})).catch((e=>{}))):E()),e.vars)return void le.variableStore.mergeVariables(e.vars);const A=(e,t)=>{const i=Xe(),o=i[t].global;if(null!=o&&t)for(const i in e)if(e.hasOwnProperty(i)&&(delete o[e[i]],ae.read(w))){const o=JSON.parse(decodeURIComponent(ae.read(w))),n=JSON.parse(decodeURIComponent(ae.read(b)));o[n]&&o[n][t]&&o[n][t][e[i]]&&(delete o[n][t][e[i]],ae.save(w,encodeURIComponent(JSON.stringify(o))))}et(i)};if(ae._isLocalStorageSupported())try{if(null!=e.evpr){const t=e.evpr.events,i=e.evpr.profile,o=e.evpr.expires_in,n=oe();ae.setMetaProp("lsTime",n),ae.setMetaProp("exTs",o),(e=>{if(null!=le.globalEventsMap||(le.globalEventsMap=ae.readFromLSorCookie(C),null!=le.globalEventsMap)){for(const t in e)if(e.hasOwnProperty(t)){const i=le.globalEventsMap[t],o=e[t];null!=le.globalEventsMap[t]?null!=o[0]&&o[0]>i[0]&&(le.globalEventsMap[t]=o):le.globalEventsMap[t]=o}}else le.globalEventsMap=e})(t),ae.saveToLSorCookie(C,le.globalEventsMap),null==le.globalProfileMap?rt(i,!0):rt(i,!1)}null!=e.arp&&(e=>{if(null!=e.skipResARP&&e.skipResARP)return console.debug("Update ARP Request rejected",e),null;const t=!0===e.isOUL;if(ae._isLocalStorageSupported())try{let i=ae.readFromLSorCookie(P);if(null==i||t){i={};for(const t in e)e.hasOwnProperty(t)&&(-1===e[t]?delete i[t]:i[t]=e[t]);ae.saveToLSorCookie(P,i)}}catch(e){console.error("Unable to parse ARP JSON: "+e)}})(e.arp),null!=e.inapp_stale&&e.inapp_stale.length>0&&A(e.inapp_stale,"wp"),null!=e.inbox_stale&&e.inbox_stale.length>0&&A(e.inbox_stale,"wi")}catch(e){c.error("Unable to persist evrp/arp: "+e)}};var Qt=t("isPersonalisationActive");class Xt{constructor(e){let{isPersonalisationActive:t}=e;Object.defineProperty(this,Qt,{writable:!0,value:void 0}),i(this,Qt)[Qt]=t}getTotalVisits(){if(!i(this,Qt)[Qt]())return;let e=ae.getMetaProp("sc");return null==e&&(e=1),e}getLastVisit(){if(!i(this,Qt)[Qt]())return;const e=ae.getMetaProp("ps");return null!=e?new Date(1e3*e):void 0}}const ei=1,ti=2,ii=3,oi=4;var ni=t("logLevel"),si=t("log"),ri=t("isLegacyDebug");class ai{constructor(e){Object.defineProperty(this,ri,{get:ci,set:void 0}),Object.defineProperty(this,si,{value:li}),Object.defineProperty(this,ni,{writable:!0,value:void 0}),this.wzrkError={},i(this,ni)[ni]=null==e?e:ti,this.wzrkError={}}get logLevel(){return i(this,ni)[ni]}set logLevel(e){i(this,ni)[ni]=e}error(e){i(this,ni)[ni]>=ei&&i(this,si)[si]("error",e)}info(e){i(this,ni)[ni]>=ti&&i(this,si)[si]("log",e)}debug(e){(i(this,ni)[ni]>=ii||i(this,ri)[ri])&&i(this,si)[si]("debug",e)}debugPE(e){i(this,ni)[ni]>=oi&&i(this,si)[si]("debug_pe",e)}reportError(e,t){this.wzrkError.c=e,this.wzrkError.d=t,this.error("".concat(Ce," ").concat(e,": ").concat(t))}}var li=function(e,t){if(window.console)try{const i=(new Date).getTime();console[e]("CleverTap [".concat(i,"]: ").concat(t))}catch(e){}},ci=function(){return"undefined"!=typeof sessionStorage&&""===sessionStorage.WZRK_D},di=t("logger"),hi=t("sessionId"),ui=t("isPersonalisationActive");class pi{constructor(e){let{logger:t,isPersonalisationActive:o}=e;Object.defineProperty(this,di,{writable:!0,value:void 0}),Object.defineProperty(this,hi,{writable:!0,value:void 0}),Object.defineProperty(this,ui,{writable:!0,value:void 0}),this.cookieName=void 0,this.scookieObj=void 0,this.sessionId=ae.getMetaProp("cs"),i(this,di)[di]=t,i(this,ui)[ui]=o}get sessionId(){return i(this,hi)[hi]}set sessionId(e){i(this,hi)[hi]=e}getSessionCookieObject(){let e=ae.readCookie(this.cookieName),t={};if(null!=e)if(e=e.replace(p,'"'),t=JSON.parse(e),J(t)){if(void 0!==t.t){const e=t.t;oe()-e>1260&&(t={})}}else t={};return this.scookieObj=t,t}setSessionCookieObject(e){const t=JSON.stringify(e);ae.createBroadCookie(this.cookieName,t,1200,We())}manageSession(e){if(void 0===this.sessionId||this.sessionId!==e){const t=ae.getMetaProp("cs");if(void 0===t)ae.setMetaProp("ps",e),ae.setMetaProp("cs",e),ae.setMetaProp("sc",1);else if(t!==e){ae.setMetaProp("ps",t),ae.setMetaProp("cs",e);let i=ae.getMetaProp("sc");void 0===i&&(i=0),ae.setMetaProp("sc",i+1)}this.sessionId=e}}getTimeElapsed(){if(!i(this,ui)[ui]())return;null!=this.scookieObj&&(this.scookieObj=this.getSessionCookieObject());const e=this.scookieObj.s;if(null!=e){const t=oe();return Math.floor(t-e)}}getPageCount(){if(i(this,ui)[ui]())return null!=this.scookieObj&&(this.scookieObj=this.getSessionCookieObject()),this.scookieObj.p}}let gi=0,fi=0;var vi=t("logger"),bi=t("account"),mi=t("device"),yi=t("session"),wi=t("isPersonalisationActive"),Ci=t("clearCookie"),ki=t("addToLocalEventMap");class xi{constructor(e){let{logger:t,account:o,device:n,session:s,isPersonalisationActive:r}=e;Object.defineProperty(this,ki,{value:Pi}),Object.defineProperty(this,vi,{writable:!0,value:void 0}),Object.defineProperty(this,bi,{writable:!0,value:void 0}),Object.defineProperty(this,mi,{writable:!0,value:void 0}),Object.defineProperty(this,yi,{writable:!0,value:void 0}),Object.defineProperty(this,wi,{writable:!0,value:void 0}),Object.defineProperty(this,Ci,{writable:!0,value:!1}),this.processingBackup=!1,i(this,vi)[vi]=t,i(this,bi)[bi]=o,i(this,mi)[mi]=n,i(this,yi)[yi]=s,i(this,wi)[wi]=r,Qe.logger=t,Qe.device=n,Qe.account=o}processBackupEvents(){const e=ae.readFromLSorCookie(S);if(null!=e){this.processingBackup=!0;for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];void 0===o.fired&&(i(this,vi)[vi].debug("Processing backup event : "+o.q),void 0!==o.q&&Qe.fireRequest(o.q),o.fired=!0)}ae.saveToLSorCookie(S,e),this.processingBackup=!1}}addSystemDataToObject(e,t){void 0===t&&(e=ee(e,i(this,vi)[vi])),$(i(this,vi)[vi].wzrkError)||(e.wzrk_error=i(this,vi)[vi].wzrkError,i(this,vi)[vi].wzrkError={}),e.id=i(this,bi)[bi].id,X(i(this,mi)[mi].gcookie)&&(e.g=i(this,mi)[mi].gcookie);const o=i(this,yi)[yi].getSessionCookieObject();e.s=o.s,e.pg=void 0===o.p?1:o.p;let n=document.location.protocol;return n=n.replace(":",""),e.af={lib:"web-sdk-v1.7.3",protocol:n,...le.flutterVersion},sessionStorage.hasOwnProperty("WZRK_D")&&(e.debug=!0),e}addFlags(e){if(i(this,Ci)[Ci]=ae.getAndClearMetaProp(g),void 0!==i(this,Ci)[Ci]&&i(this,Ci)[Ci]&&(e.rc=!0,i(this,vi)[vi].debug("reset cookie sent in request and cleared from meta for future requests.")),i(this,wi)[wi]()){const t=ae.getMetaProp("lsTime"),i=ae.getMetaProp("exTs");if(void 0===t||void 0===i)return void(e.dsync=!0);t+i{if(e.ok)return e.json();throw e})).then((e=>(i(this,vi)[vi].debug("Sync data successful",e),e))).catch((e=>{throw i(this,vi)[vi].debug("Error in syncing variables",e),e}))}}var Pi=function(e){if(ae._isLocalStorageSupported()){void 0===le.globalEventsMap&&(le.globalEventsMap=ae.readFromLSorCookie(C),void 0===le.globalEventsMap&&(le.globalEventsMap={}));const t=oe();let i=le.globalEventsMap[e];void 0!==i?(i[2]=t,i[0]++):(i=[],i.push(1),i.push(t),i.push(t)),le.globalEventsMap[e]=i,ae.saveToLSorCookie(C,le.globalEventsMap)}},Si=t("request"),Ii=t("account"),Oi=t("oldValues"),_i=t("logger"),Ei=t("processPrivacyArray");class Ai extends Array{constructor(e,t){let{request:o,account:n,logger:s}=e;super(),Object.defineProperty(this,Ei,{value:Li}),Object.defineProperty(this,Si,{writable:!0,value:void 0}),Object.defineProperty(this,Ii,{writable:!0,value:void 0}),Object.defineProperty(this,Oi,{writable:!0,value:void 0}),Object.defineProperty(this,_i,{writable:!0,value:void 0}),i(this,_i)[_i]=s,i(this,Si)[Si]=o,i(this,Ii)[Ii]=n,i(this,Oi)[Oi]=t}push(){for(var e=arguments.length,t=new Array(e),o=0;o0?le.privacyArray:t):le.privacyArray.push(...t),0}_processOldValues(){i(this,Oi)[Oi]&&i(this,Ei)[Ei](i(this,Oi)[Oi]),i(this,Oi)[Oi]=null}}var Li=function(e){if(Array.isArray(e)&&e.length>0){const o=e.reduce(((e,t)=>({...e,...t})),{});let n={};const s={};var t=!1;if(o.hasOwnProperty(O)&&"boolean"==typeof(t=o.optOut)&&(s.ct_optout=t,le.isOptInRequest=!t),o.hasOwnProperty(_)){const e=o.useIP,t="boolean"==typeof e&&e;ae.setMetaProp(_,t)}if(!$(s)){n.type="profile",n.profile=s,n=i(this,Si)[Si].addSystemDataToObject(n,void 0);const o=Ke(JSON.stringify(n),i(this,_i)[_i]);let r=i(this,Ii)[Ii].dataPostURL;r=Ve(r,"type",A),r=Ve(r,"d",o),r=Ve(r,O,t?"true":"false"),i(this,Si)[Si].saveAndFireRequest(r,le.blockRequest),e.splice(0,e.length)}}},Mi=t("oldValues"),Ti=t("logger"),Ri=t("request"),ji=t("account"),Di=t("wizAlertJSPath"),zi=t("fcmPublicKey"),Bi=t("setUpWebPush"),Ni=t("setUpWebPushNotifications"),Fi=t("setApplicationServerKey"),Ui=t("setUpSafariNotifications"),qi=t("setUpChromeFirefoxNotifications"),Vi=t("addWizAlertJS"),Wi=t("removeWizAlertJS"),Ki=t("handleNotificationRegistration");class Gi extends Array{constructor(e,t){let{logger:o,session:n,request:s,account:r}=e;super(),Object.defineProperty(this,Ki,{value:eo}),Object.defineProperty(this,Wi,{value:Xi}),Object.defineProperty(this,Vi,{value:Qi}),Object.defineProperty(this,qi,{value:Yi}),Object.defineProperty(this,Ui,{value:$i}),Object.defineProperty(this,Fi,{value:Zi}),Object.defineProperty(this,Ni,{value:Ji}),Object.defineProperty(this,Bi,{value:Hi}),Object.defineProperty(this,Mi,{writable:!0,value:void 0}),Object.defineProperty(this,Ti,{writable:!0,value:void 0}),Object.defineProperty(this,Ri,{writable:!0,value:void 0}),Object.defineProperty(this,ji,{writable:!0,value:void 0}),Object.defineProperty(this,Di,{writable:!0,value:void 0}),Object.defineProperty(this,zi,{writable:!0,value:void 0}),i(this,Di)[Di]="https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js",i(this,zi)[zi]=null,i(this,Mi)[Mi]=t,i(this,Ti)[Ti]=o,i(this,Ri)[Ri]=s,i(this,ji)[ji]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o0?i(this,Ki)[Ki](e):null==le.webPushEnabled&&e.length>0?(le.notifApi.notifEnabledFromApi=!0,le.notifApi.displayArgs=e.slice()):!1===le.webPushEnabled&&e.length>0&&i(this,Ti)[Ti].error("Make sure push notifications are fully enabled and integrated")},Ji=function(e,t,o,n){-1!==navigator.userAgent.indexOf("Chrome")||-1!==navigator.userAgent.indexOf("Firefox")?i(this,qi)[qi](e,t):-1!==navigator.userAgent.indexOf("Safari")&&i(this,Ui)[Ui](e,o,n)},Zi=function(e){i(this,zi)[zi]=e},$i=function(e,t,o){void 0===t&&i(this,Ti)[Ti].error("Ensure that APNS Web Push ID is supplied"),void 0===o&&i(this,Ti)[Ti].error("Ensure that APNS Web Push service path is supplied"),"safari"in window&&"pushNotification"in window.safari&&window.safari.pushNotification.requestPermission(o,t,{},(e=>{if("granted"===e.permission){const t=JSON.parse(JSON.stringify(e));t.endpoint=e.deviceToken,t.browser="Safari",ae.saveToLSorCookie(z,t),i(this,Ri)[Ri].registerToken(t),i(this,Ti)[Ti].info("Safari Web Push registered. Device Token: "+e.deviceToken)}else"denied"===e.permission&&i(this,Ti)[Ti].info("Error subscribing to Safari web push")}))},Yi=function(e,t){let o="";"serviceWorker"in navigator&&navigator.serviceWorker.register(t).then((e=>{if("undefined"!=typeof __wzrk_account_id)return new Promise((t=>setTimeout((()=>t(e)),5e3)));o=e.scope;return/^(\.?)(\/?)([^/]*).js$/.test(t)?navigator.serviceWorker.ready:-1!==navigator.userAgent.indexOf("Chrome")?new Promise((t=>setTimeout((()=>t(e)),5e3))):navigator.serviceWorker.getRegistrations()})).then((t=>{-1!==navigator.userAgent.indexOf("Firefox")&&Array.isArray(t)&&(t=t.filter((e=>e.scope===o))[0]);const n={userVisibleOnly:!0};null!=i(this,zi)[zi]&&(n.applicationServerKey=(e=>{let t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),i=window.atob(t),o=[];for(let e=0;e{i(this,Ti)[Ti].info("Service Worker registered. Endpoint: "+t.endpoint);const o=JSON.parse(JSON.stringify(t));-1!==navigator.userAgent.indexOf("Chrome")?(o.endpoint=o.endpoint.split("/").pop(),o.browser="Chrome"):-1!==navigator.userAgent.indexOf("Firefox")&&(o.endpoint=o.endpoint.split("/").pop(),o.browser="Firefox"),ae.saveToLSorCookie(z,o),i(this,Ri)[Ri].registerToken(o),void 0!==e&&"function"==typeof e&&e()})).catch((e=>{i(this,Ti)[Ti].error("Error subscribing: "+e),t.pushManager.getSubscription().then((e=>{null!==e&&e.unsubscribe().then((e=>{i(this,Ti)[Ti].info("Unsubscription successful")})).catch((e=>{i(this,Ti)[Ti].error("Error unsubscribing: "+e)}))}))}))})).catch((e=>{i(this,Ti)[Ti].error("error registering service worker: "+e)}))},Qi=function(){const e=document.createElement("script");return e.setAttribute("type","text/javascript"),e.setAttribute("id","wzrk-alert-js"),e.setAttribute("src",i(this,Di)[Di]),document.getElementsByTagName("body")[0].appendChild(e),e},Xi=function(){const e=document.getElementById("wzrk-alert-js");e.parentNode.removeChild(e)},eo=function(e){let t,o,n,s,r,a,l,c,d,h,u,p,g,f,v;if(1===e.length){if(J(e[0])){const i=e[0];t=i.titleText,o=i.bodyText,n=i.okButtonText,s=i.rejectButtonText,r=i.okButtonColor,a=i.skipDialog,l=i.askAgainTimeInSeconds,c=i.okCallback,d=i.rejectCallback,h=i.subscriptionCallback,u=i.serviceWorkerPath,p=i.httpsPopupPath,g=i.httpsIframePath,f=i.apnsWebPushId,v=i.apnsWebPushServiceUrl}}else t=e[0],o=e[1],n=e[2],s=e[3],r=e[4],a=e[5],l=e[6];if(null==a&&(a=!1),null==u&&(u="/clevertap_sw.js"),void 0===navigator.serviceWorker)return;const b=null!=p&&null!=g;if("https:"!==window.location.protocol&&"localhost"!==document.location.hostname&&!b)return void i(this,Ti)[Ti].error("Make sure you are https or localhost to register for notifications");if(-1!==navigator.userAgent.indexOf("Chrome")){const e=navigator.userAgent.match(/Chrome\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}else if(-1!==navigator.userAgent.indexOf("Firefox")){const e=navigator.userAgent.match(/Firefox\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}else{if(-1===navigator.userAgent.indexOf("Safari"))return;{const e=navigator.userAgent.match(/Safari\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}}if(!b){if(null==Notification)return;if("granted"===Notification.permission)return void i(this,Ni)[Ni](h,u,f,v);if("denied"===Notification.permission)return;if(a)return void i(this,Ni)[Ni](h,u,f,v)}if(!(t&&o&&n&&s))return void i(this,Ti)[Ti].error("Missing input parameters; please specify title, body, ok button and cancel button text");null!=r&&r.match(/^#[a-f\d]{6}$/i)||(r="#f28046");const m=(new Date).getTime()/1e3;if(null==ae.getMetaProp("notif_last_time"))ae.setMetaProp("notif_last_time",m);else{if(null==l&&(l=604800),m-ae.getMetaProp("notif_last_time"){if(null!=e.data){let a={};try{a=JSON.parse(e.data)}catch(e){return}null!=a.state&&"ct"===a.from&&"not"===a.state&&(i(this,Vi)[Vi]().onload=()=>{window.wzrkPermissionPopup.wizAlert({title:t,body:o,confirmButtonText:n,confirmButtonColor:r,rejectButtonText:s},(e=>{e?("function"==typeof c&&c(),window.open(p)):"function"==typeof d&&d(),i(this,Wi)[Wi]()}))})}}),!1)}else i(this,Vi)[Vi]().onload=()=>{window.wzrkPermissionPopup.wizAlert({title:t,body:o,confirmButtonText:n,confirmButtonColor:r,rejectButtonText:s},(e=>{e?("function"==typeof c&&c(),i(this,Ni)[Ni](h,u,f,v)):"function"==typeof d&&d(),i(this,Wi)[Wi]()}))}},to=t("variableStore");class io{constructor(e){let{variableStore:t}=e;Object.defineProperty(this,to,{writable:!0,value:void 0}),this.name=null,this.defaultValue=null,this.value=null,this.type=null,this.hadStarted=!1,this.valueChangedCallbacks=[],i(this,to)[to]=t}getValue(){return this.value}getdefaultValue(){return this.defaultValue}static define(e,t,i){if(!e||"string"!=typeof e)return console.error("Empty or invalid name parameter provided."),null;if(e.startsWith(".")||e.endsWith("."))return console.error("Variable name starts or ends with a `.` which is not allowed: "+e),null;const o=typeof t;if("string"!==o&&"number"!==o&&"boolean"!==o)return console.error("Only primitive types (string, number, boolean) are accepted as value"),null;const n=i.getVariable(e);if(n)return n;const s=new io({variableStore:i});try{s.name=e,s.defaultValue=t,s.value=t,s.type=o,i.registerVariable(s),s.update(t)}catch(e){console.error(e)}return s}update(e){const t=this.value;this.value=e,null===e&&null===t||null!==e&&e===t&&this.hadStarted||i(this,to)[to].hasVarsRequestCompleted()&&(this.hadStarted=!0,this.triggerValueChanged())}triggerValueChanged(){this.valueChangedCallbacks.forEach((e=>{e(this)}))}addValueChangedCallback(e){e?(this.valueChangedCallbacks.push(e),i(this,to)[to].hasVarsRequestCompleted()&&e(this)):console.log("Invalid callback parameter provided.")}removeValueChangedCallback(e){const t=this.valueChangedCallbacks.indexOf(e);-1!==t&&this.valueChangedCallbacks.splice(t,1)}clearStartFlag(){this.hadStarted=!1}}var oo=t("logger"),no=t("account"),so=t("request"),ro=t("event"),ao=t("variables"),lo=t("remoteVariables"),co=t("fetchCallback"),ho=t("variablesChangedCallbacks"),uo=t("oneTimeVariablesChangedCallbacks"),po=t("hasVarsRequestCompleted"),go=t("runVariablesChangedCallback");class fo{constructor(e){let{logger:t,request:o,account:n,event:s}=e;Object.defineProperty(this,go,{value:vo}),Object.defineProperty(this,oo,{writable:!0,value:void 0}),Object.defineProperty(this,no,{writable:!0,value:void 0}),Object.defineProperty(this,so,{writable:!0,value:void 0}),Object.defineProperty(this,ro,{writable:!0,value:void 0}),Object.defineProperty(this,ao,{writable:!0,value:void 0}),Object.defineProperty(this,lo,{writable:!0,value:void 0}),Object.defineProperty(this,co,{writable:!0,value:void 0}),Object.defineProperty(this,ho,{writable:!0,value:void 0}),Object.defineProperty(this,uo,{writable:!0,value:void 0}),Object.defineProperty(this,po,{writable:!0,value:!1}),i(this,oo)[oo]=t,i(this,no)[no]=n,i(this,so)[so]=o,i(this,ro)[ro]=s,i(this,ao)[ao]={},i(this,lo)[lo]={},i(this,ho)[ho]=[],i(this,uo)[uo]=[],le.variableStore=this}registerVariable(e){const{name:t}=e;i(this,ao)[ao][t]=e,console.log("registerVariable",i(this,ao)[ao])}getVariable(e){return i(this,ao)[ao][e]}hasVarsRequestCompleted(){return i(this,po)[po]}syncVariables(e,t){if(!i(this,no)[no].token){const e="Account token is missing.";return i(this,oo)[oo].error(e),Promise.reject(new Error(e))}const o={type:"varsPayload",vars:{}};for(const e in i(this,ao)[ao])o.vars[e]={defaultValue:i(this,ao)[ao][e].defaultValue,type:i(this,ao)[ao][e].type};if(0===Object.keys(o.vars).length){const e="No variables are defined.";return i(this,oo)[oo].error(e),Promise.reject(new Error(e))}let n={};n=i(this,so)[so].addSystemDataToObject(n,void 0),n.tk=i(this,no)[no].token,n.type="meta";const s=JSON.stringify([n,o]),r=i(this,no)[no].dataPostPEURL;return i(this,so)[so].post(r,s).then((t=>(e&&"function"==typeof e&&e(t),t))).catch((e=>{throw t&&"function"==typeof t&&t(e),400===e.status?i(this,oo)[oo].error("Invalid sync payload or clear the existing draft"):401===e.status?i(this,oo)[oo].error("This is not a test profile"):i(this,oo)[oo].error("Sync variable failed"),e}))}fetchVariables(e){i(this,ro)[ro].push(K,{t:4}),e&&"function"==typeof e&&(i(this,co)[co]=e)}mergeVariables(e){console.log("msg vars is ",e),i(this,po)[po]=!0,ae.saveToLSorCookie("WZRK_PE",e),i(this,lo)[lo]=e;for(const t in i(this,ao)[ao])e.hasOwnProperty(t)&&i(this,ao)[ao][t].update(e[t]);i(this,co)[co]&&i(this,co)[co](),i(this,go)[go]()}addVariablesChangedCallback(e){e&&"function"==typeof e?(i(this,ho)[ho].push(e),this.hasVarsRequestCompleted()&&e()):i(this,oo)[oo].error("callback is not a function")}addOneTimeVariablesChangedCallback(e){e&&"function"==typeof e&&(this.hasVarsRequestCompleted()?e():i(this,uo)[uo].push(e))}removeVariablesChangedCallback(e){const t=i(this,ho)[ho].indexOf(e);-1!==t&&i(this,ho)[ho].splice(t,1)}removeOneTimeVariablesChangedCallback(e){const t=i(this,uo)[uo].indexOf(e);-1!==t&&i(this,uo)[uo].splice(t,1)}}var vo=function(){for(var e of i(this,ho)[ho])e();for(var t of i(this,uo)[uo])t();i(this,uo)[uo].length=0},bo=t("logger"),mo=t("api"),yo=t("onloadcalled"),wo=t("device"),Co=t("session"),ko=t("account"),xo=t("request"),Po=t("variableStore"),So=t("isSpa"),Io=t("previousUrl"),Oo=t("boundCheckPageChanged"),_o=t("dismissSpamControl"),Eo=t("processOldValues"),Ao=t("debounce"),Lo=t("checkPageChanged"),Mo=t("handleMessageEvent"),To=t("pingRequest"),Ro=t("isPingContinuous"),jo=t("overrideDSyncFlag");var Do=function(){this.onUserLogin._processOldValues(),this.privacy._processOldValues(),this.event._processOldValues(),this.profile._processOldValues(),this.notifications._processOldValues()},zo=function(e){let t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300;return function(){clearTimeout(t),t=setTimeout(e,i)}},Bo=function(){i(this,Ao)[Ao]((()=>{i(this,Io)[Io]!==location.href&&this.pageChanged()}))()},No=function(e){var t;e.data&&e.data.message&&("Dashboard"===e.data.message&&e.data.url?Jt(e.data.url,null!==(t=e.data.variant)&&void 0!==t?t:null):"Overlay"===e.data.message&&$t(e.data,!0))},Fo=function(){let e=i(this,ko)[ko].dataPostURL,t={};t=i(this,xo)[xo].addSystemDataToObject(t,void 0),e=Ve(e,"type","ping"),e=Ve(e,"d",Ke(JSON.stringify(t),i(this,bo)[bo])),i(this,xo)[xo].saveAndFireRequest(e,le.blockRequest)},Uo=function(){return void 0!==window.wzrk_d&&"continuous"===window.wzrk_d.ping},qo=function(e){this._isPersonalisationActive()&&(e.dsync=!0)};const Vo=new class{get spa(){return i(this,So)[So]}set spa(e){const t=!0===e;i(this,So)[So]!==t&&1===i(this,yo)[yo]&&(t?document.addEventListener("click",i(this,Oo)[Oo]):document.removeEventListener("click",i(this,Oo)[Oo])),i(this,So)[So]=t}get dismissSpamControl(){return i(this,_o)[_o]}set dismissSpamControl(e){const t=!0===e;i(this,_o)[_o]=t,le.dismissSpamControl=t}constructor(){var e,t,o,n,s;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.defineProperty(this,jo,{value:qo}),Object.defineProperty(this,Ro,{value:Uo}),Object.defineProperty(this,To,{value:Fo}),Object.defineProperty(this,Mo,{value:No}),Object.defineProperty(this,Lo,{value:Bo}),Object.defineProperty(this,Ao,{value:zo}),Object.defineProperty(this,Eo,{value:Do}),Object.defineProperty(this,bo,{writable:!0,value:void 0}),Object.defineProperty(this,mo,{writable:!0,value:void 0}),Object.defineProperty(this,yo,{writable:!0,value:void 0}),Object.defineProperty(this,wo,{writable:!0,value:void 0}),Object.defineProperty(this,Co,{writable:!0,value:void 0}),Object.defineProperty(this,ko,{writable:!0,value:void 0}),Object.defineProperty(this,xo,{writable:!0,value:void 0}),Object.defineProperty(this,Po,{writable:!0,value:void 0}),Object.defineProperty(this,So,{writable:!0,value:void 0}),Object.defineProperty(this,Io,{writable:!0,value:void 0}),Object.defineProperty(this,Oo,{writable:!0,value:i(this,Lo)[Lo].bind(this)}),Object.defineProperty(this,_o,{writable:!0,value:void 0}),this.enablePersonalization=void 0,this.popupCallbacks={},this.popupCurrentWzrkId="",i(this,yo)[yo]=0,this._isPersonalisationActive=this._isPersonalisationActive.bind(this),this.raiseNotificationClicked=()=>{},i(this,bo)[bo]=new ai(ti),i(this,ko)[ko]=new d(null===(e=r.account)||void 0===e?void 0:e[0],r.region||(null===(t=r.account)||void 0===t?void 0:t[1]),r.targetDomain||(null===(o=r.account)||void 0===o?void 0:o[2]),r.token||(null===(n=r.account)||void 0===n?void 0:n[3])),i(this,wo)[wo]=new ye({logger:i(this,bo)[bo]}),i(this,_o)[_o]=r.dismissSpamControl||!1,i(this,Co)[Co]=new pi({logger:i(this,bo)[bo],isPersonalisationActive:this._isPersonalisationActive}),i(this,xo)[xo]=new xi({logger:i(this,bo)[bo],account:i(this,ko)[ko],device:i(this,wo)[wo],session:i(this,Co)[Co],isPersonalisationActive:this._isPersonalisationActive}),this.enablePersonalization=r.enablePersonalization||!1,this.event=new Fe({logger:i(this,bo)[bo],request:i(this,xo)[xo],isPersonalisationActive:this._isPersonalisationActive},r.event),this.profile=new gt({logger:i(this,bo)[bo],request:i(this,xo)[xo],account:i(this,ko)[ko],isPersonalisationActive:this._isPersonalisationActive},r.profile),this.onUserLogin=new It({request:i(this,xo)[xo],account:i(this,ko)[ko],session:i(this,Co)[Co],logger:i(this,bo)[bo],device:i(this,wo)[wo]},r.onUserLogin),this.privacy=new Ai({request:i(this,xo)[xo],account:i(this,ko)[ko],logger:i(this,bo)[bo]},r.privacy),this.notifications=new Gi({logger:i(this,bo)[bo],request:i(this,xo)[xo],account:i(this,ko)[ko]},r.notifications),i(this,Po)[Po]=new fo({logger:i(this,bo)[bo],request:i(this,xo)[xo],account:i(this,ko)[ko],event:this.event}),i(this,mo)[mo]=new be({logger:i(this,bo)[bo],request:i(this,xo)[xo],device:i(this,wo)[wo],session:i(this,Co)[Co]}),this.spa=r.spa,this.dismissSpamControl=r.dismissSpamControl,this.user=new Xt({isPersonalisationActive:this._isPersonalisationActive}),this.session={getTimeElapsed:()=>i(this,Co)[Co].getTimeElapsed(),getPageCount:()=>i(this,Co)[Co].getPageCount()},this.logout=()=>{i(this,bo)[bo].debug("logout called"),ae.setInstantDeleteFlagInK()},this.clear=()=>{this.onUserLogin.clear()},this.getCleverTapID=()=>i(this,wo)[wo].getGuid(),this.getAccountID=()=>i(this,ko)[ko].id,this.getSCDomain=()=>i(this,ko)[ko].finalTargetDomain,this.setLibrary=(e,t)=>{le.flutterVersion={[e]:t}},this.setSCSDKVersion=e=>{i(this,ko)[ko].scSDKVersion=e;const t={};t.af={scv:"sc-sdk-v"+i(this,ko)[ko].scSDKVersion};let o=i(this,ko)[ko].dataPostURL;o=Ve(o,"type","page"),o=Ve(o,"d",Ke(JSON.stringify(t),i(this,bo)[bo])),i(this,xo)[xo].saveAndFireRequest(o,le.blockRequest)},Kt()&&(qt(),Ut(i(this,bo)[bo])),this.getInboxMessageCount=()=>{const e=Nt();return Object.keys(e).length},this.getInboxMessageUnreadCount=()=>{if(le.inbox)return le.inbox.unviewedCounter;i(this,bo)[bo].debug("No unread messages")},this.getAllInboxMessages=()=>Nt(),this.getUnreadInboxMessages=()=>{if(le.inbox)return le.inbox.unviewedMessages;i(this,bo)[bo].debug("No unread messages")},this.getInboxMessageForId=e=>{const t=Nt();if((null!==e||""!==e)&&t.hasOwnProperty(e))return t[e];i(this,bo)[bo].error("No message available for message Id "+e)},this.deleteInboxMessage=e=>{const t=Nt();if(null===e&&""===e||!t.hasOwnProperty(e))i(this,bo)[bo].error("No message available for message Id "+e);else{const i=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);0===t[e].viewed&&(le.inbox.unviewedCounter--,delete le.inbox.unviewedMessages[e],document.getElementById("unviewedBadge").innerText=le.inbox.unviewedCounter,document.getElementById("unviewedBadge").style.display=le.inbox.unviewedCounter>0?"flex":"none"),i&&i.remove(),delete t[e],Ft(t)}},this.markReadInboxMessage=e=>{const t=le.inbox.unviewedMessages,o=Nt();if(null===e&&""===e||!t.hasOwnProperty(e))i(this,bo)[bo].error("No message available for message Id "+e);else{const t=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);if(null!==t&&(t.shadowRoot.getElementById("unreadMarker").style.display="none"),o[e].viewed=1,document.getElementById("unviewedBadge")){var n=parseInt(document.getElementById("unviewedBadge").innerText)-1;document.getElementById("unviewedBadge").innerText=n,document.getElementById("unviewedBadge").style.display=n>0?"flex":"none"}window.clevertap.renderNotificationViewed({msgId:o[e].wzrk_id,pivotId:o[e].pivotId}),le.inbox.unviewedCounter--,delete le.inbox.unviewedMessages[e],Ft(o)}},this.markReadInboxMessagesForIds=e=>{if(Array.isArray(e))for(var t=0;t{const e=le.inbox.unviewedMessages,t=Nt();if(Object.keys(e).length>0){Object.keys(e).forEach((e=>{const i=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);null!==i&&(i.shadowRoot.getElementById("unreadMarker").style.display="none"),t[e].viewed=1,window.clevertap.renderNotificationViewed({msgId:t[e].wzrk_id,pivotId:t[e].wzrk_pivot})})),document.getElementById("unviewedBadge").innerText=0,document.getElementById("unviewedBadge").style.display="none",Ft(t),le.inbox.unviewedCounter=0,le.inbox.unviewedMessages={}}else i(this,bo)[bo].debug("All messages are already read")},this.toggleInbox=e=>{var t;return null===(t=le.inbox)||void 0===t?void 0:t.toggleInbox(e)},this.renderNotificationViewed=e=>{a(R,e)},this.renderNotificationClicked=e=>{a(j,e)};const a=(e,t)=>{if(!t||!t.msgId)return;const o={type:"event"};if(o.evtName=e,o.evtData={[T]:t.msgId},t.pivotId&&(o.evtData={...o.evtData,wzrk_pivot:t.pivotId}),t.wzrk_slideNo&&(o.evtData={...o.evtData,wzrk_slideNo:t.wzrk_slideNo}),t.kv&&null!==t.kv&&void 0!==t.kv)for(const e in t.kv)e.startsWith(M)&&(o.evtData={...o.evtData,[e]:t.kv[e]});if(t.msgCTkv&&null!==t.msgCTkv&&void 0!==t.msgCTkv)for(const e in t.msgCTkv)e.startsWith(M)&&(o.evtData={...o.evtData,[e]:t.msgCTkv[e]});i(this,xo)[xo].processEvent(o)};this.setLogLevel=e=>{i(this,bo)[bo].logLevel=Number(e),3===e?sessionStorage.WZRK_D="":delete sessionStorage.WZRK_D},this.handleIncrementValue=(e,t)=>{this.profile._handleIncrementDecrementValue(e,t,B)},this.handleDecrementValue=(e,t)=>{this.profile._handleIncrementDecrementValue(e,t,"$decr")},this.setMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueSet(e,t,"$set"):console.error("setMultiValuesForKey should be called with a value of type array")},this.addMultiValueForKey=(e,t)=>{"string"==typeof t||"number"==typeof t?this.profile._handleMultiValueAdd(e,t,N):console.error("addMultiValueForKey should be called with a value of type string or number.")},this.addMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueAdd(e,t,N):console.error("addMultiValuesForKey should be called with a value of type array.")},this.removeMultiValueForKey=(e,t)=>{"string"==typeof t||"number"==typeof t?this.profile._handleMultiValueRemove(e,t,F):console.error("removeMultiValueForKey should be called with a value of type string or number.")},this.removeMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueRemove(e,t,F):console.error("removeMultiValuesForKey should be called with a value of type array.")},this.removeValueForKey=e=>{this.profile._handleMultiValueDelete(e,U)};const l=(e,t,o)=>{((e,t,i,o,n)=>{const s=qe(location.href),r=s.e,a=s.p,l=s.page_type;if(void 0!==r){const s={};s.id=o.id,s.unsubGroups=le.unsubGroups,le.updatedCategoryLong&&(s.cUsY=le.updatedCategoryLong);let c=o.emailURL;i&&(c=Ve(c,"fetchGroups",i)),t&&(c=Ve(c,"encoded",t)),c=Ve(c,"e",r),c=Ve(c,"d",Ke(JSON.stringify(s),n)),a&&(c=Ve(c,"p",a)),"-1"!==e&&(c=Ve(c,"sub",e)),l&&(le.globalUnsubscribe=l===I,c=Ve(c,"page_type",l)),Qe.fireRequest(c)}})(e,t,o,i(this,ko)[ko],i(this,bo)[bo])};function c(e){var t=e.coords.latitude,i=e.coords.longitude;le.location={Latitude:t,Longitude:i},this.sendLocationData({Latitude:t,Longitude:i})}function h(e){switch(e.code){case e.PERMISSION_DENIED:console.log("User denied the request for Geolocation.");break;case e.POSITION_UNAVAILABLE:console.log("Location information is unavailable.");break;case e.TIMEOUT:console.log("The request to get user location timed out.");break;case e.UNKNOWN_ERROR:console.log("An unknown error occurred.")}}this.getLocation=function(e,t){if(e&&"number"!=typeof e||t&&"number"!=typeof t)console.log("Latitude and Longitude must be of number type");else if(e&&t){if(e<=-90||e>90)return void console.log("A vaid latitude must range between -90 and 90");if(t<=-180||t>180)return void console.log("A valid longitude must range between -180 and 180");le.location={Latitude:e,Longitude:t},this.sendLocationData({Latitude:e,Longitude:t})}else navigator.geolocation?navigator.geolocation.getCurrentPosition(c.bind(this),h):console.log("Geolocation is not supported by this browser.")};const u=i(this,mo)[mo];u.logout=this.logout,u.clear=this.clear,u.closeIframe=(e,t)=>{at(e,0,i(this,Co)[Co].sessionId)},u.enableWebPush=(e,t)=>{this.notifications._enableWebPush(e,t)},u.tr=e=>{Yt(e,{device:i(this,wo)[wo],session:i(this,Co)[Co],request:i(this,xo)[xo],logger:i(this,bo)[bo]})},u.setEnum=e=>{((e,t)=>{if(H(e)||Q(e))return"$E_"+e;t.error(Ae)})(e,i(this,bo)[bo])},u.is_onloadcalled=()=>1===i(this,yo)[yo],u.subEmail=e=>{l("1",e)},u.getEmail=(e,t)=>{l("-1",e,t)},u.unSubEmail=e=>{l("0",e)},u.unsubEmailGroups=e=>{le.unsubGroups=[];const t=document.getElementsByClassName("ct-unsub-group-input-item");for(let e=0;e{le.unsubGroups=e},u.getSubscriptionGroups=()=>le.unsubGroups,u.changeSubscriptionGroups=(e,t)=>{u.setSubscriptionGroups(t),l("2",e)},u.isGlobalUnsubscribe=()=>le.globalUnsubscribe,u.setIsGlobalUnsubscribe=e=>{le.globalUnsubscribe=e},u.setUpdatedCategoryLong=e=>{e.cUsY&&(le.updatedCategoryLong=e.cUsY)},window.$CLTP_WR=window.$WZRK_WR=u,(null===(s=r.account)||void 0===s?void 0:s[0].id)&&this.init()}init(e,t,o,n){if(1===i(this,yo)[yo])return;if(ae.removeCookie("WZRK_P",window.location.hostname),!i(this,ko)[ko].id){if(!e)return void i(this,bo)[bo].error(ke);i(this,ko)[ko].id=e}i(this,Co)[Co].cookieName="WZRK_S_"+i(this,ko)[ko].id,t&&(i(this,ko)[ko].region=t),o&&(i(this,ko)[ko].targetDomain=o),n&&(i(this,ko)[ko].token=n);const s=location.href,r=qe(s.toLowerCase());if(void 0!==r.e&&"0"==r.wzrk_ex)return;le.isPrivacyArrPushed=!0,le.privacyArray.length>0&&this.privacy.push(le.privacyArray),i(this,Eo)[Eo](),this.pageChanged();const a=setInterval((()=>{i(this,wo)[wo].gcookie&&(clearInterval(a),i(this,xo)[xo].processBackupEvents())}),3e3);i(this,So)[So]?document.addEventListener("click",i(this,Oo)[Oo]):document.removeEventListener("click",i(this,Oo)[Oo]),i(this,yo)[yo]=1}pageChanged(){const e=window.location.search;if("?ctBuilder"===e)return console.log("open in visual builder mode"),window.addEventListener("message",i(this,Mo)[Mo],!1),void window.postMessage("builder");if("?ctBuilderPreview"===e)return window.addEventListener("message",i(this,Mo)[Mo],!1),void window.postMessage("preview");const t=window.location.href,o=qe(t.toLowerCase()),n=i(this,Co)[Co].getSessionCookieObject();let s=void 0===n.p?0:n.p;n.p=++s,i(this,Co)[Co].setSessionCookieObject(n);let r={},a=(e=>{if(""===e)return"";var t=document.createElement("a");return t.href=e,t.hostname})(document.referrer);if(window.location.hostname!==a){const e=120;""!==a&&(a=a.length>e?a.substring(0,e):a,r.referrer=a);let t=o.utm_source||o.wzrk_source;void 0!==t&&(t=t.length>e?t.substring(0,e):t,r.us=t);let i=o.utm_medium||o.wzrk_medium;void 0!==i&&(i=i.length>e?i.substring(0,e):i,r.um=i);let n=o.utm_campaign||o.wzrk_campaign;if(void 0!==n&&(n=n.length>e?n.substring(0,e):n,r.uc=n),void 0!==o.wzrk_medium){const e=o.wzrk_medium;e.match(/^email$|^social$|^search$/)&&(r.wm=e)}}r=i(this,xo)[xo].addSystemDataToObject(r,void 0),r.cpg=t,r.WZRK_CAMP=it();let l=i(this,ko)[ko].dataPostURL;i(this,xo)[xo].addFlags(r),1===parseInt(r.pg)&&i(this,jo)[jo](r),l=Ve(l,"type","page"),l=Ve(l,"d",Ke(JSON.stringify(r),i(this,bo)[bo])),i(this,xo)[xo].saveAndFireRequest(l,le.blockRequest),1===parseInt(r.pg)&&this.event.push(K,{t:4}),i(this,Io)[Io]=t,setTimeout((()=>{s<=3&&i(this,To)[To](),i(this,Ro)[Ro]()&&setInterval((()=>{i(this,To)[To]()}),3e5)}),12e4)}_isPersonalisationActive(){return ae._isLocalStorageSupported()&&this.enablePersonalization}set popupCallback(e){this.popupCallbacks[this.popupCurrentWzrkId]=e}sendLocationData(e){let t={af:{}};const o={};if(t.type="profile",null==o.tz&&(o.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),t.profile=o,e){Object.keys(e).forEach((i=>{t.af[i]=e[i]}))}le.location&&(t.af={...t.af,...le.location}),t=i(this,xo)[xo].addSystemDataToObject(t,!0),i(this,xo)[xo].addFlags(t);const n=Ke(JSON.stringify(t),i(this,bo)[bo]);let s=i(this,ko)[ko].dataPostURL;s=Ve(s,"type",A),s=Ve(s,"d",n),i(this,xo)[xo].saveAndFireRequest(s,le.blockRequest)}setOffline(e){"boolean"==typeof e?(le.offline=e,e||i(this,xo)[xo].processBackupEvents()):console.error("setOffline should be called with a value of type boolean")}defineVariable(e,t){return io.define(e,t,i(this,Po)[Po])}syncVariables(e,t){if(4===i(this,bo)[bo].logLevel)return i(this,Po)[Po].syncVariables(e,t);{const e="App log level is not set to 4";return i(this,bo)[bo].error(e),Promise.reject(new Error(e))}}fetchVariables(e){i(this,Po)[Po].fetchVariables(e)}addVariablesChangedCallback(e){i(this,Po)[Po].addVariablesChangedCallback(e)}addOneTimeVariablesChangedCallback(e){i(this,Po)[Po].addOneTimeVariablesChangedCallback(e)}}(window.clevertap);return window.clevertap=window.wizrocket=Vo,Vo})); diff --git a/src/clevertap.js b/src/clevertap.js index 6bb6cb58..743f1a87 100644 --- a/src/clevertap.js +++ b/src/clevertap.js @@ -663,20 +663,27 @@ export default class CleverTap { debouncedPageChanged() } + #handleMessageEvent (event) { + if (event.data && event.data.message) { + if (event.data.message === 'Dashboard' && event.data.url) { + initialiseCTBuilder(event.data.url, event.data.variant ?? null) + } else if (event.data.message === 'Overlay') { + renderVisualBuilder(event.data, true) + } + } + } + pageChanged () { const search = window.location.search if (search === '?ctBuilder') { // open in visual builder mode console.log('open in visual builder mode') - initialiseCTBuilder() + window.addEventListener('message', this.#handleMessageEvent, false) + window.postMessage('builder') return } if (search === '?ctBuilderPreview') { - window.addEventListener('message', (event) => { - if (event.data && event.data.message && event.data.message === 'Overlay') { - renderVisualBuilder(event.data, true) - } - }, false) + window.addEventListener('message', this.#handleMessageEvent, false) window.postMessage('preview') return } diff --git a/src/modules/visualBuilder/pageBuilder.js b/src/modules/visualBuilder/pageBuilder.js index 3249701b..14f17863 100644 --- a/src/modules/visualBuilder/pageBuilder.js +++ b/src/modules/visualBuilder/pageBuilder.js @@ -1,18 +1,18 @@ -export const initialiseCTBuilder = () => { - document.addEventListener('DOMContentLoaded', onContentLoad) +export const initialiseCTBuilder = (url, variant) => { + document.addEventListener('DOMContentLoaded', () => onContentLoad(url, variant)) } let container -function onContentLoad () { +function onContentLoad (url, variant) { document.body.innerHTML = '' container = document.createElement('div') - container.id = 'app2' + container.id = 'overlayDiv' container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form container.style.display = 'flex' document.body.appendChild(container) const overlayPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js' - loadOverlayScript(overlayPath) + loadOverlayScript(overlayPath, url, variant) .then(() => { console.log('Overlay script loaded successfully.') }) @@ -31,14 +31,14 @@ function loadCSS () { document.head.appendChild(link) } -function loadOverlayScript (overlayPath) { +function loadOverlayScript (overlayPath, url, variant) { return new Promise((resolve, reject) => { var script = document.createElement('script') script.type = 'module' script.src = overlayPath script.onload = function () { if (typeof window.Overlay === 'function') { - window.Overlay('#app2', 'http://localhost:8080/randomPage') + window.Overlay('#overlayDiv', url, variant) resolve() } else { reject(new Error('ContentLayout not found in overlay.js')) From 31b8627b796890f94fce242f0d004a7b33c2da00 Mon Sep 17 00:00:00 2001 From: KambleSonam Date: Fri, 10 May 2024 10:53:23 +0530 Subject: [PATCH 04/19] postMessage update --- clevertap.js | 4 ++-- clevertap.js.map | 2 +- clevertap.min.js | 2 +- src/clevertap.js | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/clevertap.js b/clevertap.js index d991bbdd..379e3cfe 100644 --- a/clevertap.js +++ b/clevertap.js @@ -8162,13 +8162,13 @@ // open in visual builder mode console.log('open in visual builder mode'); window.addEventListener('message', _classPrivateFieldLooseBase(this, _handleMessageEvent)[_handleMessageEvent], false); - window.postMessage('builder'); + window.postMessage('builder', '*'); return; } if (search === '?ctBuilderPreview') { window.addEventListener('message', _classPrivateFieldLooseBase(this, _handleMessageEvent)[_handleMessageEvent], false); - window.postMessage('preview'); + window.postMessage('preview', '*'); return; } diff --git a/clevertap.js.map b/clevertap.js.map index c2c7bd5f..ee2bfe24 100644 --- a/clevertap.js.map +++ b/clevertap.js.map @@ -1 +1 @@ -{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/modules/visualBuilder/pageBuilder.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/notification.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {}\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n // Initialize array\n var array = []\n\n // Check if globalProfileMap is null, initialize if needed\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n // Check if the value to be set is either string or number\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = $ct.globalProfileMap[propKey]\n array.push(typeof propVal === 'number' ? propVal : propVal.toLowerCase())\n } else {\n $ct.globalProfileMap[propKey] = propVal\n }\n } else {\n // Check if propVal is an array\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = Array.isArray($ct.globalProfileMap[propKey]) ? $ct.globalProfileMap[propKey] : [$ct.globalProfileMap[propKey]]\n }\n\n // Check for case-sensitive inputs and filter the same ones\n for (var i = 0; i < propVal.length; i++) {\n if (typeof propVal[i] === 'number' && !array.includes(propVal[i])) {\n array.push(propVal[i])\n } else if (typeof propVal[i] === 'string' && !array.includes(propVal[i].toLowerCase())) {\n array.push(propVal[i].toLowerCase())\n } else if ((typeof propVal[i] === 'number' && array.includes(propVal[i])) || (typeof propVal[i] === 'string' && array.includes(propVal[i].toLowerCase()))) {\n console.error('Values already included')\n } else {\n console.error('Array supports only string or number type values')\n }\n }\n\n // Update globalProfileMap with the array\n $ct.globalProfileMap[propKey] = array\n }\n\n // Save to local storage or cookie\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Call the sendMultiValueData function\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n var index = $ct.globalProfileMap[propKey].indexOf(propVal)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n } else {\n for (var k = 0; k < propVal.length; k++) {\n var idx = $ct.globalProfileMap[propKey].indexOf(propVal[k])\n if (idx !== -1) {\n $ct.globalProfileMap[propKey].splice(idx, 1)\n }\n }\n }\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n // console.log('Raise notification clicked event for ', item)\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","export const initialiseCTBuilder = (url, variant) => {\n document.addEventListener('DOMContentLoaded', () => onContentLoad(url, variant))\n}\n\nlet container\n\nfunction onContentLoad (url, variant) {\n document.body.innerHTML = ''\n container = document.createElement('div')\n container.id = 'overlayDiv'\n container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form\n container.style.display = 'flex'\n document.body.appendChild(container)\n const overlayPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js'\n loadOverlayScript(overlayPath, url, variant)\n .then(() => {\n console.log('Overlay script loaded successfully.')\n })\n .catch((error) => {\n console.error('Error loading overlay script:', error)\n })\n loadCSS()\n loadTypeKit()\n}\n\nfunction loadCSS () {\n var link = document.createElement('link')\n link.rel = 'stylesheet'\n link.type = 'text/css'\n link.href = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css'\n document.head.appendChild(link)\n}\n\nfunction loadOverlayScript (overlayPath, url, variant) {\n return new Promise((resolve, reject) => {\n var script = document.createElement('script')\n script.type = 'module'\n script.src = overlayPath\n script.onload = function () {\n if (typeof window.Overlay === 'function') {\n window.Overlay('#overlayDiv', url, variant)\n resolve()\n } else {\n reject(new Error('ContentLayout not found in overlay.js'))\n }\n }\n script.onerror = function (error) {\n reject(error)\n }\n document.head.appendChild(script)\n })\n}\n\nfunction loadTypeKit () {\n var config = {\n kitId: 'eqj6nom',\n scriptTimeout: 3000,\n async: true\n }\n\n var d = document\n var h = d.documentElement\n var t = setTimeout(function () {\n h.className = h.className.replace(/\\bwf-loading\\b/g, '') + ' wf-inactive'\n // $(document).trigger(\"TypeKitReady\");\n }, config.scriptTimeout)\n var tk = d.createElement('script')\n var f = false\n var s = d.getElementsByTagName('script')[0]\n var a\n\n h.className += ' wf-loading'\n tk.src = 'https://use.typekit.net/' + config.kitId + '.js'\n tk.async = true\n tk.onload = tk.onreadystatechange = function () {\n a = this.readyState\n if (f || (a && a !== 'complete' && a !== 'loaded')) return\n f = true\n clearTimeout(t)\n try {\n // eslint-disable-next-line no-undef\n Typekit.load(config)\n } catch (e) {}\n }\n\n s.parentNode.insertBefore(tk, s)\n}\n\nexport const renderVisualBuilder = (targetingMsgJson, isPreview) => {\n const details = targetingMsgJson.display.details[0]\n const siteUrl = Object.keys(details)[0]\n const selectors = details[siteUrl]\n\n if (siteUrl === window.location.href) {\n for (const selector in selectors) {\n const element = document.querySelector(selector)\n if (element) {\n if (selectors[selector].html) {\n element.outerHTML = selectors[selector].html\n } else {\n // Update json data\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n } else {\n let count = 0\n const intervalId = setInterval(() => {\n const retryElement = document.querySelector(selector)\n if (retryElement) {\n if (selectors[selector].html) {\n retryElement.outerHTML = selectors[selector].html\n } else {\n // Update json data\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n clearInterval(intervalId)\n } else {\n count++\n if (count >= 20) {\n console.log(`No element present on DOM with selector '${selector}'.`)\n clearInterval(intervalId)\n }\n }\n }, 500)\n }\n }\n }\n}\n// function addOverlayScript (overlayPath) {\n// const scriptTag = document.createElement('script')\n// scriptTag.setAttribute('type', 'text/javascript')\n// scriptTag.setAttribute('id', 'wzrk-alert-js')\n// scriptTag.setAttribute('src', overlayPath)\n// document.getElementsByTagName('body')[0].appendChild(scriptTag)\n// return scriptTag\n// }\n","import {\n addToLocalProfileMap,\n arp,\n getCampaignObject,\n saveCampaignObject,\n closeIframe\n} from './clevertap'\n\nimport {\n CAMP_COOKIE_NAME,\n DISPLAY,\n GLOBAL,\n EV_COOKIE,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n WZRK_PREFIX,\n WZRK_ID,\n CAMP_COOKIE_G,\n GCOOKIE_NAME\n} from './constants'\n\nimport {\n getNow,\n getToday\n} from './datetime'\n\nimport {\n compressToBase64\n} from './encoder'\n\nimport { StorageManager, $ct } from './storage'\nimport RequestDispatcher from './requestDispatcher'\nimport { CTWebPersonalisationBanner } from './web-personalisation/banner'\nimport { CTWebPersonalisationCarousel } from './web-personalisation/carousel'\nimport { CTWebPopupImageOnly } from './web-popupImageonly/popupImageonly'\nimport { checkAndRegisterWebInboxElements, initializeWebInbox, processWebInboxSettings, hasWebInboxSettingsInLS, processInboxNotifs } from '../modules/web-inbox/helper'\nimport { renderVisualBuilder } from '../modules/visualBuilder/pageBuilder'\n\nconst _tr = (msg, {\n device,\n session,\n request,\n logger\n}) => {\n const _device = device\n const _session = session\n const _request = request\n const _logger = logger\n let _wizCounter = 0\n\n // msg = {\n // arp: {\n // j_n: 'Zw==',\n // i_n: 'Y2NmewICAw==',\n // d_ts: 0,\n // dh: 0,\n // v: 1,\n // j_s: '{ }',\n // id: 'WWW-WWW-WWRZ',\n // e_ts: 0,\n // r_ts: 1649748826,\n // rc_w: 60,\n // rc_n: 5\n // },\n // inapp_notifs: [\n // {\n // msgContent: {\n // templateType: 'point-and-click',\n // type: 4\n // },\n // display: {\n // divId: 'hero-banner',\n // details: [{\n // 'http://localhost:3000/': {\n // '.heroDi1v': {\n // html: 'Hello Sonam'\n // },\n // '#selector_2': {\n // html: '

Hello Sonam

'\n // },\n // '.heroDiv2': {\n // json: {\n // name: 'Sonam',\n // identity: 1234\n // }\n // }\n // }\n // }],\n // wtarget_type: 2,\n // wmc: 1,\n // ff: 'Desktop'\n // },\n // wzrk_id: '1655316906_20220620',\n // wzrk_pivot: 'wzrk_default'\n // }\n // ]\n // }\n // Campaign House keeping\n const doCampHouseKeeping = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const today = getToday()\n\n const incrCount = (obj, campaignId, excludeFromFreqCaps) => {\n let currentCount = 0\n let totalCount = 0\n if (obj[campaignId] != null) {\n currentCount = obj[campaignId]\n }\n currentCount++\n if (obj.tc != null) {\n totalCount = obj.tc\n }\n // if exclude from caps then dont add to total counts\n if (excludeFromFreqCaps < 0) {\n totalCount++\n }\n\n obj.tc = totalCount\n obj[campaignId] = currentCount\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n delete sessionStorage[CAMP_COOKIE_NAME]\n var campTypeObj = {}\n const campObj = getCampaignObject()\n if (targetingMsgJson.display.wtarget_type === 3 && campObj.hasOwnProperty('wi')) {\n campTypeObj = campObj.wi\n } else if ((targetingMsgJson.display.wtarget_type === 0 || targetingMsgJson.display.wtarget_type === 1) && campObj.hasOwnProperty('wp')) {\n campTypeObj = campObj.wp\n } else {\n campTypeObj = {}\n }\n if (campObj.hasOwnProperty('global')) {\n campTypeObj.wp = campObj\n }\n // global session limit. default is 1\n if (targetingMsgJson[DISPLAY].wmc == null) {\n targetingMsgJson[DISPLAY].wmc = 1\n }\n\n // global session limit for web inbox. default is 1\n if (targetingMsgJson[DISPLAY].wimc == null) {\n targetingMsgJson[DISPLAY].wimc = 1\n }\n\n var excludeFromFreqCaps = -1 // efc - Exclude from frequency caps\n let campaignSessionLimit = -1 // mdc - Once per session\n let campaignDailyLimit = -1 // tdc - Once per day\n let campaignTotalLimit = -1 // tlc - Once per user for the duration of campaign\n let totalDailyLimit = -1\n let totalSessionLimit = -1 // wmc - Web Popup Global Session Limit\n let totalInboxSessionLimit = -1 // wimc - Web Inbox Global Session Limit\n\n if (targetingMsgJson[DISPLAY].efc != null) { // exclude from frequency cap\n excludeFromFreqCaps = parseInt(targetingMsgJson[DISPLAY].efc, 10)\n }\n if (targetingMsgJson[DISPLAY].mdc != null) { // Campaign Session Limit\n campaignSessionLimit = parseInt(targetingMsgJson[DISPLAY].mdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tdc != null) { // No of web popups in a day per campaign\n campaignDailyLimit = parseInt(targetingMsgJson[DISPLAY].tdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tlc != null) { // Total lifetime count\n campaignTotalLimit = parseInt(targetingMsgJson[DISPLAY].tlc, 10)\n }\n if (targetingMsgJson[DISPLAY].wmp != null) { // No of campaigns per day\n totalDailyLimit = parseInt(targetingMsgJson[DISPLAY].wmp, 10)\n }\n if (targetingMsgJson[DISPLAY].wmc != null) { // No of campaigns per session\n totalSessionLimit = parseInt(targetingMsgJson[DISPLAY].wmc, 10)\n }\n\n if (targetingMsgJson[DISPLAY].wimc != null) { // No of inbox campaigns per session\n totalInboxSessionLimit = parseInt(targetingMsgJson[DISPLAY].wimc, 10)\n }\n // session level capping\n var sessionObj = campTypeObj[_session.sessionId]\n if (sessionObj) {\n const campaignSessionCount = sessionObj[campaignId]\n const totalSessionCount = sessionObj.tc\n // dnd\n if (campaignSessionCount === 'dnd' && !$ct.dismissSpamControl) {\n return false\n }\n\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n // Inbox session\n if (totalInboxSessionLimit > 0 && totalSessionCount >= totalInboxSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n } else {\n // session\n if (totalSessionLimit > 0 && totalSessionCount >= totalSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n }\n\n // campaign session\n if (campaignSessionLimit > 0 && campaignSessionCount >= campaignSessionLimit) {\n return false\n }\n } else {\n sessionObj = {}\n campTypeObj[_session.sessionId] = sessionObj\n }\n\n // daily level capping\n var dailyObj = campTypeObj[today]\n if (dailyObj != null) {\n const campaignDailyCount = dailyObj[campaignId]\n const totalDailyCount = dailyObj.tc\n // daily\n if (totalDailyLimit > 0 && totalDailyCount >= totalDailyLimit && excludeFromFreqCaps < 0) {\n return false\n }\n // campaign daily\n if (campaignDailyLimit > 0 && campaignDailyCount >= campaignDailyLimit) {\n return false\n }\n } else {\n dailyObj = {}\n campTypeObj[today] = dailyObj\n }\n\n var globalObj = campTypeObj[GLOBAL]\n if (globalObj != null) {\n const campaignTotalCount = globalObj[campaignId]\n // campaign total\n if (campaignTotalLimit > 0 && campaignTotalCount >= campaignTotalLimit) {\n return false\n }\n } else {\n globalObj = {}\n campTypeObj[GLOBAL] = globalObj\n }\n }\n // delay\n if (targetingMsgJson[DISPLAY].delay != null && targetingMsgJson[DISPLAY].delay > 0) {\n const delay = targetingMsgJson[DISPLAY].delay\n targetingMsgJson[DISPLAY].delay = 0\n setTimeout(_tr, delay * 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n return false\n }\n\n incrCount(sessionObj, campaignId, excludeFromFreqCaps)\n incrCount(dailyObj, campaignId, excludeFromFreqCaps)\n incrCount(globalObj, campaignId, excludeFromFreqCaps)\n\n let campKey = 'wp'\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n campKey = 'wi'\n }\n // get ride of stale sessions and day entries\n const newCampObj = {}\n newCampObj[_session.sessionId] = sessionObj\n newCampObj[today] = dailyObj\n newCampObj[GLOBAL] = globalObj\n saveCampaignObject({ [campKey]: newCampObj })\n }\n\n const getCookieParams = () => {\n const gcookie = _device.getGuid()\n const scookieObj = _session.getSessionCookieObject()\n return '&t=wc&d=' + encodeURIComponent(compressToBase64(gcookie + '|' + scookieObj.p + '|' + scookieObj.s))\n }\n\n const setupClickEvent = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n if (onClick !== '' && onClick != null) {\n let ctaElement\n let jsCTAElements\n if (isLegacy) {\n ctaElement = contentDiv\n } else if (contentDiv !== null) {\n jsCTAElements = contentDiv.getElementsByClassName('jsCT_CTA')\n if (jsCTAElements != null && jsCTAElements.length === 1) {\n ctaElement = jsCTAElements[0]\n }\n }\n const jsFunc = targetingMsgJson.display.jsFunc\n const isPreview = targetingMsgJson.display.preview\n if (isPreview == null) {\n onClick += getCookieParams()\n }\n\n if (ctaElement != null) {\n ctaElement.onclick = () => {\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n if (isPreview == null) {\n RequestDispatcher.fireRequest(onClick)\n }\n invokeExternalJs(jsFunc, targetingMsgJson)\n // close iframe. using -1 for no campaignId\n closeIframe('-1', divId, _session.sessionId)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n }\n }\n\n const invokeExternalJs = (jsFunc, targetingMsgJson) => {\n const func = window.parent[jsFunc]\n if (typeof func === 'function') {\n if (targetingMsgJson.display.kv != null) {\n func(targetingMsgJson.display.kv)\n } else {\n func()\n }\n }\n }\n\n const setupClickUrl = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n incrementImpression(targetingMsgJson)\n setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy)\n }\n\n const incrementImpression = (targetingMsgJson) => {\n const data = {}\n data.type = 'event'\n data.evtName = NOTIFICATION_VIEWED\n data.evtData = { [WZRK_ID]: targetingMsgJson.wzrk_id }\n if (targetingMsgJson.wzrk_pivot) {\n data.evtData = { ...data.evtData, wzrk_pivot: targetingMsgJson.wzrk_pivot }\n }\n _request.processEvent(data)\n }\n\n const renderPersonalisationBanner = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const bannerEl = document.createElement('ct-web-personalisation-banner')\n bannerEl.msgId = targetingMsgJson.wzrk_id\n bannerEl.pivotId = targetingMsgJson.wzrk_pivot\n bannerEl.divHeight = targetingMsgJson.display.divHeight\n bannerEl.details = targetingMsgJson.display.details[0]\n const containerEl = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n containerEl.innerHTML = ''\n containerEl.appendChild(bannerEl)\n }\n\n const renderPersonalisationCarousel = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-carousel') === undefined) {\n customElements.define('ct-web-personalisation-carousel', CTWebPersonalisationCarousel)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const carousel = document.createElement('ct-web-personalisation-carousel')\n carousel.target = targetingMsgJson\n const container = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n container.innerHTML = ''\n container.appendChild(carousel)\n }\n\n const renderPopUpImageOnly = (targetingMsgJson) => {\n const divId = 'wzrkImageOnlyDiv'\n const popupImageOnly = document.createElement('ct-web-popup-imageonly')\n popupImageOnly.session = _session\n popupImageOnly.target = targetingMsgJson\n const containerEl = document.getElementById(divId)\n containerEl.innerHTML = ''\n containerEl.style.visibility = 'hidden'\n containerEl.appendChild(popupImageOnly)\n }\n\n const renderFooterNotification = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const displayObj = targetingMsgJson.display\n\n if (displayObj.wtarget_type === 2) { // Handling Web Native display\n // Logic for kv pair data\n if (targetingMsgJson.msgContent.type === 1) {\n const inaObj = {}\n\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.msgContent.kv != null) {\n inaObj.kv = targetingMsgJson.msgContent.kv\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n return\n }\n }\n if (displayObj.layout === 1) { // Handling Web Exit Intent\n return showExitIntent(undefined, targetingMsgJson)\n }\n if (displayObj.layout === 3) { // Handling Web Popup Image Only\n const divId = 'wzrkImageOnlyDiv'\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById(divId) != null || document.getElementById('intentPreview') != null) {\n return\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n document.body.appendChild(msgDiv)\n if (customElements.get('ct-web-popup-imageonly') === undefined) {\n customElements.define('ct-web-popup-imageonly', CTWebPopupImageOnly)\n }\n return renderPopUpImageOnly(targetingMsgJson)\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const divId = 'wizParDiv' + displayObj.layout\n\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n if (document.getElementById(divId) != null) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = divId\n const isBanner = displayObj.layout === 2\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n const viewHeight = window.innerHeight\n const viewWidth = window.innerWidth\n let legacy = false\n\n if (!isBanner) {\n const marginBottom = viewHeight * 5 / 100\n var contentHeight = 10\n let right = viewWidth * 5 / 100\n let bottomPosition = contentHeight + marginBottom\n let width = viewWidth * 30 / 100 + 20\n let widthPerct = 'width:30%;'\n // for small devices - mobile phones\n if ((/mobile/i.test(navigator.userAgent) || (/mini/i.test(navigator.userAgent))) && /iPad/i.test(navigator.userAgent) === false) {\n width = viewWidth * 85 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:80%;'\n // medium devices - tablets\n } else if ('ontouchstart' in window || (/tablet/i.test(navigator.userAgent))) {\n width = viewWidth * 50 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:50%;'\n }\n // legacy footer notif\n if (displayObj.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden; bottom:' + bottomPosition + 'px !important;width:' + width + 'px !important;right:' + right + 'px !important;position:fixed;z-index:2147483647;')\n } else {\n msgDiv.setAttribute('style', widthPerct + displayObj.iFrameStyle)\n }\n } else {\n msgDiv.setAttribute('style', displayObj.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n\n const borderRadius = displayObj.br === false ? '0' : '8'\n\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, leftTd, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n leftTd = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n leftTd = '#f4f4f4'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"\"\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'\" + divId + \"');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"\" +\n // \"\"+\n '' + imageTd + \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
'\n html = css + title + body\n }\n\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n const ifrm = (iframe.contentWindow) ? iframe.contentWindow : (iframe.contentDocument.document) ? iframe.contentDocument.document : iframe.contentDocument\n const doc = ifrm.document\n\n // Dispatch event for popup box/banner close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n doc.open()\n doc.write(html)\n\n if (displayObj['custom-editor']) {\n appendScriptForCustomEvent(targetingMsgJson, doc)\n }\n doc.close()\n\n const adjustIFrameHeight = () => {\n // adjust iframe and body height of html inside correctly\n contentHeight = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv').scrollHeight\n if (displayObj['custom-editor'] !== true && !isBanner) {\n contentHeight += 25\n }\n document.getElementById('wiz-iframe').contentDocument.body.style.margin = '0px'\n document.getElementById('wiz-iframe').style.height = contentHeight + 'px'\n }\n\n const ua = navigator.userAgent.toLowerCase()\n if (ua.indexOf('safari') !== -1) {\n if (ua.indexOf('chrome') > -1) {\n iframe.onload = () => {\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n } else {\n let inDoc = iframe.contentDocument || iframe.contentWindow\n if (inDoc.document) inDoc = inDoc.document\n // safari iphone 7+ needs this.\n adjustIFrameHeight()\n const _timer = setInterval(() => {\n if (inDoc.readyState === 'complete') {\n clearInterval(_timer)\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }, 10)\n }\n } else {\n iframe.onload = () => {\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }\n }\n\n const appendScriptForCustomEvent = (targetingMsgJson, doc) => {\n const script = doc.createElement('script')\n script.innerHTML = `\n const ct__camapignId = '${targetingMsgJson.wzrk_id}';\n const ct__formatVal = (v) => {\n return v && v.trim().substring(0, 20);\n }\n const ct__parentOrigin = window.parent.origin;\n document.body.addEventListener('click', (event) => {\n const elem = event.target.closest?.('a[wzrk_c2a], button[wzrk_c2a]');\n if (elem) {\n const {innerText, id, name, value, href} = elem;\n const clickAttr = elem.getAttribute('onclick') || elem.getAttribute('click');\n const onclickURL = clickAttr?.match(/(window.open)[(\\](\\\"|')(.*)(\\\"|',)/)?.[3] || clickAttr?.match(/(location.href *= *)(\\\"|')(.*)(\\\"|')/)?.[3];\n const props = {innerText, id, name, value};\n let msgCTkv = Object.keys(props).reduce((acc, c) => {\n const formattedVal = ct__formatVal(props[c]);\n formattedVal && (acc['wzrk_click_' + c] = formattedVal);\n return acc;\n }, {});\n if(onclickURL) { msgCTkv['wzrk_click_' + 'url'] = onclickURL; }\n if(href) { msgCTkv['wzrk_click_' + 'c2a'] = href; }\n const notifData = { msgId: ct__camapignId, msgCTkv, pivotId: '${targetingMsgJson.wzrk_pivot}' };\n window.parent.clevertap.renderNotificationClicked(notifData);\n }\n });\n `\n doc.body.appendChild(script)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe-intent'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n const ifrm = (iframe.contentWindow) ? iframe.contentWindow : (iframe.contentDocument.document) ? iframe.contentDocument.document : iframe.contentDocument\n const doc = ifrm.document\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n doc.open()\n doc.write(html)\n if (targetingMsgJson.display['custom-editor']) {\n appendScriptForCustomEvent(targetingMsgJson, doc)\n }\n doc.close()\n\n const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n this.#logger.error('Error subscribing: ' + error)\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\n// import { initialiseCTBuilder } from './modules/visualBuilder/pageBuilder'\nimport { initialiseCTBuilder, renderVisualBuilder } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token) {\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n #handleMessageEvent (event) {\n if (event.data && event.data.message) {\n if (event.data.message === 'Dashboard' && event.data.url) {\n initialiseCTBuilder(event.data.url, event.data.variant ?? null)\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n }\n }\n\n pageChanged () {\n const search = window.location.search\n if (search === '?ctBuilder') {\n // open in visual builder mode\n console.log('open in visual builder mode')\n window.addEventListener('message', this.#handleMessageEvent, false)\n window.postMessage('builder')\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', this.#handleMessageEvent, false)\n window.postMessage('preview')\n return\n }\n\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","constructor","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","dataPostPEURL","dataPostURL","recorderURL","emailURL","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","save","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","read","data","getItem","parse","e","remove","removeItem","removeCookie","name","domain","cookieStr","document","cookie","createCookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","readCookie","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","saveToLSorCookie","property","location","hostname","$ct","globalCache","readFromLSorCookie","trim","err","createBroadCookie","broadDomain","domainParts","testBroadDomain","testCookieName","tempCookie","getMetaProp","metaObj","setMetaProp","wzrkMetaObj","getAndClearMetaProp","setInstantDeleteFlagInK","k","flag","backupEvent","reqNo","backupArr","q","debug","removeBackup","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","get","item","saveCacheToLS","set","allKeys","objToArray","index","temp","getKey","getSecondLastKey","keysArr","getLastKey","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","s","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","sessionObj","getSessionCookieObject","kIdFromLS","guidFromLRUCache","lastK","lastGUID","unregisterTokenForGuid","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","_processOldValues","getDetails","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","fireRequest","skipARP","sendOULFlag","getDelayFrequency","account","randomDelay","random","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","ProfileHandler","profilesArr","getAttribute","propName","_handleIncrementDecrementValue","command","tz","profile","addSystemDataToObject","addFlags","compressedData","saveAndFireRequest","_handleMultiValueSet","arrayVal","array","toLowerCase","sendMultiValueData","_handleMultiValueAdd","propKey","propVal","_handleMultiValueRemove","_handleMultiValueDelete","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","clear","addToK","ids","g","kId","anonymousUser","foundInCache","gFromCache","Identity","cookieName","loginArr","pop","processProfile","CTWebPersonalisationBanner","HTMLElement","_details","shadow","attachShadow","mode","details","renderBanner","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","target","renderCarousel","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","button","setInterval","sliderTime","goTo","prev","cur","CTWebPopupImageOnly","_session","popup","container","resizeObserver","renderImageOnlyPopup","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","Message","config","message","wrapper","snackBar","renderMessage","createEl","part","_el","msg","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","raiseClickedEvent","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","contains","setBadgeStyle","msgCount","incomingMessages","msgs","updateInboxMessages","incomingMessagesForPreview","previewMsgs","now","buildUIForMessages","updateUnviewedBadgeCounter","connectedCallback","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","addMsgsToInboxFromLS","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","deleteMsgsFromUI","getInboxMessages","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","top","right","getBoundingClientRect","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","inbox_notifs","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","initialiseCTBuilder","variant","onContentLoad","position","overlayPath","loadOverlayScript","then","catch","loadCSS","loadTypeKit","link","rel","head","script","src","onload","Overlay","Error","onerror","kitId","scriptTimeout","h","documentElement","className","tk","onreadystatechange","Typekit","load","renderVisualBuilder","targetingMsgJson","siteUrl","selectors","selector","element","querySelector","outerHTML","intervalId","retryElement","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","onclick","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","inaObj","kvPairsEvent","CustomEvent","dispatchEvent","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","pointerCss","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","ifrm","contentWindow","contentDocument","doc","closeCampaign","Event","write","appendScriptForCustomEvent","close","adjustIFrameHeight","scrollHeight","margin","ua","inDoc","_timer","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","getTotalVisits","visitCount","getLastVisit","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","info","debugPE","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","getTimeElapsed","sessionStart","getPageCount","seqNo","requestTime","RequestManager","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","post","fetch","method","headers","response","ok","json","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","_enableWebPush","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","skipDialog","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","getValue","getdefaultValue","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","addValueChangedCallback","removeValueChangedCallback","clearStartFlag","VariableStore","syncVariables","onSyncSuccess","onSyncFailure","meta","r","status","fetchVariables","onFetchCallback","addVariablesChangedCallback","callback","addOneTimeVariablesChangedCallback","removeVariablesChangedCallback","removeOneTimeVariablesChangedCallback","callBack","CleverTap","spa","isSpa","bind","enablePersonalization","_isPersonalisationActive","ReqestManager","onUserLogin","privacy","notifications","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","handleDecrementValue","setMultiValuesForKey","addMultiValueForKey","addMultiValuesForKey","removeMultiValueForKey","removeMultiValuesForKey","removeValueForKey","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","sendLocationData","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","elements","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","postMessage","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","setOffline","arg","defineVariable","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;EAAO,MAAMA,aAAa,GAAG,oBAAtB;EACA,MAAMC,eAAe,GAAG,QAAxB;EACA,MAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;ECAQ,MAAMC,OAAN,CAAc;EAO3BC,EAAAA,WAAW,GAAsE;EAAA,QAApE;EAAEC,MAAAA;EAAF,KAAoE,uEAA3D,EAA2D;EAAA,QAAvDC,MAAuD,uEAA9C,EAA8C;EAAA,QAA1CC,YAA0C,uEAA3BP,aAA2B;EAAA,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yD,WAAD,EAAc,MAAd,EAAsBpV,QAAtB,CAAtB;EACAoV,EAAAA,WAAW,GAAGzD,QAAQ,CAACyD,WAAD,EAAc,GAAd,EAAmB3C,YAAY,CAAC7M,IAAI,CAACC,SAAL,CAAeE,IAAf,CAAD,8BAAuB,IAAvB,wBAA/B,CAAtB;;EAEA,4DAAcwX,kBAAd,CAAiCnI,WAAjC,EAA8CpN,GAAG,CAACgC,YAAlD;EACD;;yDAEoB;EACnB,SAAQ,OAAOrC,MAAM,CAACqqC,MAAd,KAAyB,WAAzB,IAAwCrqC,MAAM,CAACqqC,MAAP,CAAcC,IAAd,KAAuB,YAAvE;EACD;;yDAMmBlsC,MAAM;EACxB,MAAI,KAAKqlC,wBAAL,EAAJ,EAAqC;EACnCrlC,IAAAA,IAAI,CAAC+9B,KAAL,GAAa,IAAb;EACD;EACF;;QCtxBGruB,SAAS,GAAG,IAAIy8B,SAAJ,CAAcvqC,MAAM,CAAC8N,SAArB;EAElB9N,MAAM,CAAC8N,SAAP,GAAmB9N,MAAM,CAAC+N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/modules/visualBuilder/pageBuilder.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/notification.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {}\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n // Initialize array\n var array = []\n\n // Check if globalProfileMap is null, initialize if needed\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n // Check if the value to be set is either string or number\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = $ct.globalProfileMap[propKey]\n array.push(typeof propVal === 'number' ? propVal : propVal.toLowerCase())\n } else {\n $ct.globalProfileMap[propKey] = propVal\n }\n } else {\n // Check if propVal is an array\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = Array.isArray($ct.globalProfileMap[propKey]) ? $ct.globalProfileMap[propKey] : [$ct.globalProfileMap[propKey]]\n }\n\n // Check for case-sensitive inputs and filter the same ones\n for (var i = 0; i < propVal.length; i++) {\n if (typeof propVal[i] === 'number' && !array.includes(propVal[i])) {\n array.push(propVal[i])\n } else if (typeof propVal[i] === 'string' && !array.includes(propVal[i].toLowerCase())) {\n array.push(propVal[i].toLowerCase())\n } else if ((typeof propVal[i] === 'number' && array.includes(propVal[i])) || (typeof propVal[i] === 'string' && array.includes(propVal[i].toLowerCase()))) {\n console.error('Values already included')\n } else {\n console.error('Array supports only string or number type values')\n }\n }\n\n // Update globalProfileMap with the array\n $ct.globalProfileMap[propKey] = array\n }\n\n // Save to local storage or cookie\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Call the sendMultiValueData function\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n var index = $ct.globalProfileMap[propKey].indexOf(propVal)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n } else {\n for (var k = 0; k < propVal.length; k++) {\n var idx = $ct.globalProfileMap[propKey].indexOf(propVal[k])\n if (idx !== -1) {\n $ct.globalProfileMap[propKey].splice(idx, 1)\n }\n }\n }\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n // console.log('Raise notification clicked event for ', item)\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","export const initialiseCTBuilder = (url, variant) => {\n document.addEventListener('DOMContentLoaded', () => onContentLoad(url, variant))\n}\n\nlet container\n\nfunction onContentLoad (url, variant) {\n document.body.innerHTML = ''\n container = document.createElement('div')\n container.id = 'overlayDiv'\n container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form\n container.style.display = 'flex'\n document.body.appendChild(container)\n const overlayPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js'\n loadOverlayScript(overlayPath, url, variant)\n .then(() => {\n console.log('Overlay script loaded successfully.')\n })\n .catch((error) => {\n console.error('Error loading overlay script:', error)\n })\n loadCSS()\n loadTypeKit()\n}\n\nfunction loadCSS () {\n var link = document.createElement('link')\n link.rel = 'stylesheet'\n link.type = 'text/css'\n link.href = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css'\n document.head.appendChild(link)\n}\n\nfunction loadOverlayScript (overlayPath, url, variant) {\n return new Promise((resolve, reject) => {\n var script = document.createElement('script')\n script.type = 'module'\n script.src = overlayPath\n script.onload = function () {\n if (typeof window.Overlay === 'function') {\n window.Overlay('#overlayDiv', url, variant)\n resolve()\n } else {\n reject(new Error('ContentLayout not found in overlay.js'))\n }\n }\n script.onerror = function (error) {\n reject(error)\n }\n document.head.appendChild(script)\n })\n}\n\nfunction loadTypeKit () {\n var config = {\n kitId: 'eqj6nom',\n scriptTimeout: 3000,\n async: true\n }\n\n var d = document\n var h = d.documentElement\n var t = setTimeout(function () {\n h.className = h.className.replace(/\\bwf-loading\\b/g, '') + ' wf-inactive'\n // $(document).trigger(\"TypeKitReady\");\n }, config.scriptTimeout)\n var tk = d.createElement('script')\n var f = false\n var s = d.getElementsByTagName('script')[0]\n var a\n\n h.className += ' wf-loading'\n tk.src = 'https://use.typekit.net/' + config.kitId + '.js'\n tk.async = true\n tk.onload = tk.onreadystatechange = function () {\n a = this.readyState\n if (f || (a && a !== 'complete' && a !== 'loaded')) return\n f = true\n clearTimeout(t)\n try {\n // eslint-disable-next-line no-undef\n Typekit.load(config)\n } catch (e) {}\n }\n\n s.parentNode.insertBefore(tk, s)\n}\n\nexport const renderVisualBuilder = (targetingMsgJson, isPreview) => {\n const details = targetingMsgJson.display.details[0]\n const siteUrl = Object.keys(details)[0]\n const selectors = details[siteUrl]\n\n if (siteUrl === window.location.href) {\n for (const selector in selectors) {\n const element = document.querySelector(selector)\n if (element) {\n if (selectors[selector].html) {\n element.outerHTML = selectors[selector].html\n } else {\n // Update json data\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n } else {\n let count = 0\n const intervalId = setInterval(() => {\n const retryElement = document.querySelector(selector)\n if (retryElement) {\n if (selectors[selector].html) {\n retryElement.outerHTML = selectors[selector].html\n } else {\n // Update json data\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n clearInterval(intervalId)\n } else {\n count++\n if (count >= 20) {\n console.log(`No element present on DOM with selector '${selector}'.`)\n clearInterval(intervalId)\n }\n }\n }, 500)\n }\n }\n }\n}\n// function addOverlayScript (overlayPath) {\n// const scriptTag = document.createElement('script')\n// scriptTag.setAttribute('type', 'text/javascript')\n// scriptTag.setAttribute('id', 'wzrk-alert-js')\n// scriptTag.setAttribute('src', overlayPath)\n// document.getElementsByTagName('body')[0].appendChild(scriptTag)\n// return scriptTag\n// }\n","import {\n addToLocalProfileMap,\n arp,\n getCampaignObject,\n saveCampaignObject,\n closeIframe\n} from './clevertap'\n\nimport {\n CAMP_COOKIE_NAME,\n DISPLAY,\n GLOBAL,\n EV_COOKIE,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n WZRK_PREFIX,\n WZRK_ID,\n CAMP_COOKIE_G,\n GCOOKIE_NAME\n} from './constants'\n\nimport {\n getNow,\n getToday\n} from './datetime'\n\nimport {\n compressToBase64\n} from './encoder'\n\nimport { StorageManager, $ct } from './storage'\nimport RequestDispatcher from './requestDispatcher'\nimport { CTWebPersonalisationBanner } from './web-personalisation/banner'\nimport { CTWebPersonalisationCarousel } from './web-personalisation/carousel'\nimport { CTWebPopupImageOnly } from './web-popupImageonly/popupImageonly'\nimport { checkAndRegisterWebInboxElements, initializeWebInbox, processWebInboxSettings, hasWebInboxSettingsInLS, processInboxNotifs } from '../modules/web-inbox/helper'\nimport { renderVisualBuilder } from '../modules/visualBuilder/pageBuilder'\n\nconst _tr = (msg, {\n device,\n session,\n request,\n logger\n}) => {\n const _device = device\n const _session = session\n const _request = request\n const _logger = logger\n let _wizCounter = 0\n\n // msg = {\n // arp: {\n // j_n: 'Zw==',\n // i_n: 'Y2NmewICAw==',\n // d_ts: 0,\n // dh: 0,\n // v: 1,\n // j_s: '{ }',\n // id: 'WWW-WWW-WWRZ',\n // e_ts: 0,\n // r_ts: 1649748826,\n // rc_w: 60,\n // rc_n: 5\n // },\n // inapp_notifs: [\n // {\n // msgContent: {\n // templateType: 'point-and-click',\n // type: 4\n // },\n // display: {\n // divId: 'hero-banner',\n // details: [{\n // 'http://localhost:3000/': {\n // '.heroDi1v': {\n // html: 'Hello Sonam'\n // },\n // '#selector_2': {\n // html: '

Hello Sonam

'\n // },\n // '.heroDiv2': {\n // json: {\n // name: 'Sonam',\n // identity: 1234\n // }\n // }\n // }\n // }],\n // wtarget_type: 2,\n // wmc: 1,\n // ff: 'Desktop'\n // },\n // wzrk_id: '1655316906_20220620',\n // wzrk_pivot: 'wzrk_default'\n // }\n // ]\n // }\n // Campaign House keeping\n const doCampHouseKeeping = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const today = getToday()\n\n const incrCount = (obj, campaignId, excludeFromFreqCaps) => {\n let currentCount = 0\n let totalCount = 0\n if (obj[campaignId] != null) {\n currentCount = obj[campaignId]\n }\n currentCount++\n if (obj.tc != null) {\n totalCount = obj.tc\n }\n // if exclude from caps then dont add to total counts\n if (excludeFromFreqCaps < 0) {\n totalCount++\n }\n\n obj.tc = totalCount\n obj[campaignId] = currentCount\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n delete sessionStorage[CAMP_COOKIE_NAME]\n var campTypeObj = {}\n const campObj = getCampaignObject()\n if (targetingMsgJson.display.wtarget_type === 3 && campObj.hasOwnProperty('wi')) {\n campTypeObj = campObj.wi\n } else if ((targetingMsgJson.display.wtarget_type === 0 || targetingMsgJson.display.wtarget_type === 1) && campObj.hasOwnProperty('wp')) {\n campTypeObj = campObj.wp\n } else {\n campTypeObj = {}\n }\n if (campObj.hasOwnProperty('global')) {\n campTypeObj.wp = campObj\n }\n // global session limit. default is 1\n if (targetingMsgJson[DISPLAY].wmc == null) {\n targetingMsgJson[DISPLAY].wmc = 1\n }\n\n // global session limit for web inbox. default is 1\n if (targetingMsgJson[DISPLAY].wimc == null) {\n targetingMsgJson[DISPLAY].wimc = 1\n }\n\n var excludeFromFreqCaps = -1 // efc - Exclude from frequency caps\n let campaignSessionLimit = -1 // mdc - Once per session\n let campaignDailyLimit = -1 // tdc - Once per day\n let campaignTotalLimit = -1 // tlc - Once per user for the duration of campaign\n let totalDailyLimit = -1\n let totalSessionLimit = -1 // wmc - Web Popup Global Session Limit\n let totalInboxSessionLimit = -1 // wimc - Web Inbox Global Session Limit\n\n if (targetingMsgJson[DISPLAY].efc != null) { // exclude from frequency cap\n excludeFromFreqCaps = parseInt(targetingMsgJson[DISPLAY].efc, 10)\n }\n if (targetingMsgJson[DISPLAY].mdc != null) { // Campaign Session Limit\n campaignSessionLimit = parseInt(targetingMsgJson[DISPLAY].mdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tdc != null) { // No of web popups in a day per campaign\n campaignDailyLimit = parseInt(targetingMsgJson[DISPLAY].tdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tlc != null) { // Total lifetime count\n campaignTotalLimit = parseInt(targetingMsgJson[DISPLAY].tlc, 10)\n }\n if (targetingMsgJson[DISPLAY].wmp != null) { // No of campaigns per day\n totalDailyLimit = parseInt(targetingMsgJson[DISPLAY].wmp, 10)\n }\n if (targetingMsgJson[DISPLAY].wmc != null) { // No of campaigns per session\n totalSessionLimit = parseInt(targetingMsgJson[DISPLAY].wmc, 10)\n }\n\n if (targetingMsgJson[DISPLAY].wimc != null) { // No of inbox campaigns per session\n totalInboxSessionLimit = parseInt(targetingMsgJson[DISPLAY].wimc, 10)\n }\n // session level capping\n var sessionObj = campTypeObj[_session.sessionId]\n if (sessionObj) {\n const campaignSessionCount = sessionObj[campaignId]\n const totalSessionCount = sessionObj.tc\n // dnd\n if (campaignSessionCount === 'dnd' && !$ct.dismissSpamControl) {\n return false\n }\n\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n // Inbox session\n if (totalInboxSessionLimit > 0 && totalSessionCount >= totalInboxSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n } else {\n // session\n if (totalSessionLimit > 0 && totalSessionCount >= totalSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n }\n\n // campaign session\n if (campaignSessionLimit > 0 && campaignSessionCount >= campaignSessionLimit) {\n return false\n }\n } else {\n sessionObj = {}\n campTypeObj[_session.sessionId] = sessionObj\n }\n\n // daily level capping\n var dailyObj = campTypeObj[today]\n if (dailyObj != null) {\n const campaignDailyCount = dailyObj[campaignId]\n const totalDailyCount = dailyObj.tc\n // daily\n if (totalDailyLimit > 0 && totalDailyCount >= totalDailyLimit && excludeFromFreqCaps < 0) {\n return false\n }\n // campaign daily\n if (campaignDailyLimit > 0 && campaignDailyCount >= campaignDailyLimit) {\n return false\n }\n } else {\n dailyObj = {}\n campTypeObj[today] = dailyObj\n }\n\n var globalObj = campTypeObj[GLOBAL]\n if (globalObj != null) {\n const campaignTotalCount = globalObj[campaignId]\n // campaign total\n if (campaignTotalLimit > 0 && campaignTotalCount >= campaignTotalLimit) {\n return false\n }\n } else {\n globalObj = {}\n campTypeObj[GLOBAL] = globalObj\n }\n }\n // delay\n if (targetingMsgJson[DISPLAY].delay != null && targetingMsgJson[DISPLAY].delay > 0) {\n const delay = targetingMsgJson[DISPLAY].delay\n targetingMsgJson[DISPLAY].delay = 0\n setTimeout(_tr, delay * 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n return false\n }\n\n incrCount(sessionObj, campaignId, excludeFromFreqCaps)\n incrCount(dailyObj, campaignId, excludeFromFreqCaps)\n incrCount(globalObj, campaignId, excludeFromFreqCaps)\n\n let campKey = 'wp'\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n campKey = 'wi'\n }\n // get ride of stale sessions and day entries\n const newCampObj = {}\n newCampObj[_session.sessionId] = sessionObj\n newCampObj[today] = dailyObj\n newCampObj[GLOBAL] = globalObj\n saveCampaignObject({ [campKey]: newCampObj })\n }\n\n const getCookieParams = () => {\n const gcookie = _device.getGuid()\n const scookieObj = _session.getSessionCookieObject()\n return '&t=wc&d=' + encodeURIComponent(compressToBase64(gcookie + '|' + scookieObj.p + '|' + scookieObj.s))\n }\n\n const setupClickEvent = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n if (onClick !== '' && onClick != null) {\n let ctaElement\n let jsCTAElements\n if (isLegacy) {\n ctaElement = contentDiv\n } else if (contentDiv !== null) {\n jsCTAElements = contentDiv.getElementsByClassName('jsCT_CTA')\n if (jsCTAElements != null && jsCTAElements.length === 1) {\n ctaElement = jsCTAElements[0]\n }\n }\n const jsFunc = targetingMsgJson.display.jsFunc\n const isPreview = targetingMsgJson.display.preview\n if (isPreview == null) {\n onClick += getCookieParams()\n }\n\n if (ctaElement != null) {\n ctaElement.onclick = () => {\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n if (isPreview == null) {\n RequestDispatcher.fireRequest(onClick)\n }\n invokeExternalJs(jsFunc, targetingMsgJson)\n // close iframe. using -1 for no campaignId\n closeIframe('-1', divId, _session.sessionId)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n }\n }\n\n const invokeExternalJs = (jsFunc, targetingMsgJson) => {\n const func = window.parent[jsFunc]\n if (typeof func === 'function') {\n if (targetingMsgJson.display.kv != null) {\n func(targetingMsgJson.display.kv)\n } else {\n func()\n }\n }\n }\n\n const setupClickUrl = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n incrementImpression(targetingMsgJson)\n setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy)\n }\n\n const incrementImpression = (targetingMsgJson) => {\n const data = {}\n data.type = 'event'\n data.evtName = NOTIFICATION_VIEWED\n data.evtData = { [WZRK_ID]: targetingMsgJson.wzrk_id }\n if (targetingMsgJson.wzrk_pivot) {\n data.evtData = { ...data.evtData, wzrk_pivot: targetingMsgJson.wzrk_pivot }\n }\n _request.processEvent(data)\n }\n\n const renderPersonalisationBanner = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const bannerEl = document.createElement('ct-web-personalisation-banner')\n bannerEl.msgId = targetingMsgJson.wzrk_id\n bannerEl.pivotId = targetingMsgJson.wzrk_pivot\n bannerEl.divHeight = targetingMsgJson.display.divHeight\n bannerEl.details = targetingMsgJson.display.details[0]\n const containerEl = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n containerEl.innerHTML = ''\n containerEl.appendChild(bannerEl)\n }\n\n const renderPersonalisationCarousel = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-carousel') === undefined) {\n customElements.define('ct-web-personalisation-carousel', CTWebPersonalisationCarousel)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const carousel = document.createElement('ct-web-personalisation-carousel')\n carousel.target = targetingMsgJson\n const container = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n container.innerHTML = ''\n container.appendChild(carousel)\n }\n\n const renderPopUpImageOnly = (targetingMsgJson) => {\n const divId = 'wzrkImageOnlyDiv'\n const popupImageOnly = document.createElement('ct-web-popup-imageonly')\n popupImageOnly.session = _session\n popupImageOnly.target = targetingMsgJson\n const containerEl = document.getElementById(divId)\n containerEl.innerHTML = ''\n containerEl.style.visibility = 'hidden'\n containerEl.appendChild(popupImageOnly)\n }\n\n const renderFooterNotification = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const displayObj = targetingMsgJson.display\n\n if (displayObj.wtarget_type === 2) { // Handling Web Native display\n // Logic for kv pair data\n if (targetingMsgJson.msgContent.type === 1) {\n const inaObj = {}\n\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.msgContent.kv != null) {\n inaObj.kv = targetingMsgJson.msgContent.kv\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n return\n }\n }\n if (displayObj.layout === 1) { // Handling Web Exit Intent\n return showExitIntent(undefined, targetingMsgJson)\n }\n if (displayObj.layout === 3) { // Handling Web Popup Image Only\n const divId = 'wzrkImageOnlyDiv'\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById(divId) != null || document.getElementById('intentPreview') != null) {\n return\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n document.body.appendChild(msgDiv)\n if (customElements.get('ct-web-popup-imageonly') === undefined) {\n customElements.define('ct-web-popup-imageonly', CTWebPopupImageOnly)\n }\n return renderPopUpImageOnly(targetingMsgJson)\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const divId = 'wizParDiv' + displayObj.layout\n\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n if (document.getElementById(divId) != null) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = divId\n const isBanner = displayObj.layout === 2\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n const viewHeight = window.innerHeight\n const viewWidth = window.innerWidth\n let legacy = false\n\n if (!isBanner) {\n const marginBottom = viewHeight * 5 / 100\n var contentHeight = 10\n let right = viewWidth * 5 / 100\n let bottomPosition = contentHeight + marginBottom\n let width = viewWidth * 30 / 100 + 20\n let widthPerct = 'width:30%;'\n // for small devices - mobile phones\n if ((/mobile/i.test(navigator.userAgent) || (/mini/i.test(navigator.userAgent))) && /iPad/i.test(navigator.userAgent) === false) {\n width = viewWidth * 85 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:80%;'\n // medium devices - tablets\n } else if ('ontouchstart' in window || (/tablet/i.test(navigator.userAgent))) {\n width = viewWidth * 50 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:50%;'\n }\n // legacy footer notif\n if (displayObj.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden; bottom:' + bottomPosition + 'px !important;width:' + width + 'px !important;right:' + right + 'px !important;position:fixed;z-index:2147483647;')\n } else {\n msgDiv.setAttribute('style', widthPerct + displayObj.iFrameStyle)\n }\n } else {\n msgDiv.setAttribute('style', displayObj.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n\n const borderRadius = displayObj.br === false ? '0' : '8'\n\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, leftTd, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n leftTd = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n leftTd = '#f4f4f4'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"\"\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'\" + divId + \"');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"\" +\n // \"\"+\n '' + imageTd + \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
'\n html = css + title + body\n }\n\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n const ifrm = (iframe.contentWindow) ? iframe.contentWindow : (iframe.contentDocument.document) ? iframe.contentDocument.document : iframe.contentDocument\n const doc = ifrm.document\n\n // Dispatch event for popup box/banner close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n doc.open()\n doc.write(html)\n\n if (displayObj['custom-editor']) {\n appendScriptForCustomEvent(targetingMsgJson, doc)\n }\n doc.close()\n\n const adjustIFrameHeight = () => {\n // adjust iframe and body height of html inside correctly\n contentHeight = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv').scrollHeight\n if (displayObj['custom-editor'] !== true && !isBanner) {\n contentHeight += 25\n }\n document.getElementById('wiz-iframe').contentDocument.body.style.margin = '0px'\n document.getElementById('wiz-iframe').style.height = contentHeight + 'px'\n }\n\n const ua = navigator.userAgent.toLowerCase()\n if (ua.indexOf('safari') !== -1) {\n if (ua.indexOf('chrome') > -1) {\n iframe.onload = () => {\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n } else {\n let inDoc = iframe.contentDocument || iframe.contentWindow\n if (inDoc.document) inDoc = inDoc.document\n // safari iphone 7+ needs this.\n adjustIFrameHeight()\n const _timer = setInterval(() => {\n if (inDoc.readyState === 'complete') {\n clearInterval(_timer)\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }, 10)\n }\n } else {\n iframe.onload = () => {\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }\n }\n\n const appendScriptForCustomEvent = (targetingMsgJson, doc) => {\n const script = doc.createElement('script')\n script.innerHTML = `\n const ct__camapignId = '${targetingMsgJson.wzrk_id}';\n const ct__formatVal = (v) => {\n return v && v.trim().substring(0, 20);\n }\n const ct__parentOrigin = window.parent.origin;\n document.body.addEventListener('click', (event) => {\n const elem = event.target.closest?.('a[wzrk_c2a], button[wzrk_c2a]');\n if (elem) {\n const {innerText, id, name, value, href} = elem;\n const clickAttr = elem.getAttribute('onclick') || elem.getAttribute('click');\n const onclickURL = clickAttr?.match(/(window.open)[(\\](\\\"|')(.*)(\\\"|',)/)?.[3] || clickAttr?.match(/(location.href *= *)(\\\"|')(.*)(\\\"|')/)?.[3];\n const props = {innerText, id, name, value};\n let msgCTkv = Object.keys(props).reduce((acc, c) => {\n const formattedVal = ct__formatVal(props[c]);\n formattedVal && (acc['wzrk_click_' + c] = formattedVal);\n return acc;\n }, {});\n if(onclickURL) { msgCTkv['wzrk_click_' + 'url'] = onclickURL; }\n if(href) { msgCTkv['wzrk_click_' + 'c2a'] = href; }\n const notifData = { msgId: ct__camapignId, msgCTkv, pivotId: '${targetingMsgJson.wzrk_pivot}' };\n window.parent.clevertap.renderNotificationClicked(notifData);\n }\n });\n `\n doc.body.appendChild(script)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe-intent'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n const ifrm = (iframe.contentWindow) ? iframe.contentWindow : (iframe.contentDocument.document) ? iframe.contentDocument.document : iframe.contentDocument\n const doc = ifrm.document\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n doc.open()\n doc.write(html)\n if (targetingMsgJson.display['custom-editor']) {\n appendScriptForCustomEvent(targetingMsgJson, doc)\n }\n doc.close()\n\n const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n this.#logger.error('Error subscribing: ' + error)\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\n// import { initialiseCTBuilder } from './modules/visualBuilder/pageBuilder'\nimport { initialiseCTBuilder, renderVisualBuilder } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token) {\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n #handleMessageEvent (event) {\n if (event.data && event.data.message) {\n if (event.data.message === 'Dashboard' && event.data.url) {\n initialiseCTBuilder(event.data.url, event.data.variant ?? null)\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n }\n }\n\n pageChanged () {\n const search = window.location.search\n if (search === '?ctBuilder') {\n // open in visual builder mode\n console.log('open in visual builder mode')\n window.addEventListener('message', this.#handleMessageEvent, false)\n window.postMessage('builder', '*')\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', this.#handleMessageEvent, false)\n window.postMessage('preview', '*')\n return\n }\n\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","constructor","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","dataPostPEURL","dataPostURL","recorderURL","emailURL","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","save","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","read","data","getItem","parse","e","remove","removeItem","removeCookie","name","domain","cookieStr","document","cookie","createCookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","readCookie","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","saveToLSorCookie","property","location","hostname","$ct","globalCache","readFromLSorCookie","trim","err","createBroadCookie","broadDomain","domainParts","testBroadDomain","testCookieName","tempCookie","getMetaProp","metaObj","setMetaProp","wzrkMetaObj","getAndClearMetaProp","setInstantDeleteFlagInK","k","flag","backupEvent","reqNo","backupArr","q","debug","removeBackup","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","get","item","saveCacheToLS","set","allKeys","objToArray","index","temp","getKey","getSecondLastKey","keysArr","getLastKey","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","s","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","sessionObj","getSessionCookieObject","kIdFromLS","guidFromLRUCache","lastK","lastGUID","unregisterTokenForGuid","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","_processOldValues","getDetails","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","fireRequest","skipARP","sendOULFlag","getDelayFrequency","account","randomDelay","random","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","ProfileHandler","profilesArr","getAttribute","propName","_handleIncrementDecrementValue","command","tz","profile","addSystemDataToObject","addFlags","compressedData","saveAndFireRequest","_handleMultiValueSet","arrayVal","array","toLowerCase","sendMultiValueData","_handleMultiValueAdd","propKey","propVal","_handleMultiValueRemove","_handleMultiValueDelete","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","clear","addToK","ids","g","kId","anonymousUser","foundInCache","gFromCache","Identity","cookieName","loginArr","pop","processProfile","CTWebPersonalisationBanner","HTMLElement","_details","shadow","attachShadow","mode","details","renderBanner","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","target","renderCarousel","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","button","setInterval","sliderTime","goTo","prev","cur","CTWebPopupImageOnly","_session","popup","container","resizeObserver","renderImageOnlyPopup","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","Message","config","message","wrapper","snackBar","renderMessage","createEl","part","_el","msg","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","raiseClickedEvent","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","contains","setBadgeStyle","msgCount","incomingMessages","msgs","updateInboxMessages","incomingMessagesForPreview","previewMsgs","now","buildUIForMessages","updateUnviewedBadgeCounter","connectedCallback","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","addMsgsToInboxFromLS","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","deleteMsgsFromUI","getInboxMessages","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","top","right","getBoundingClientRect","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","inbox_notifs","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","initialiseCTBuilder","variant","onContentLoad","position","overlayPath","loadOverlayScript","then","catch","loadCSS","loadTypeKit","link","rel","head","script","src","onload","Overlay","Error","onerror","kitId","scriptTimeout","h","documentElement","className","tk","onreadystatechange","Typekit","load","renderVisualBuilder","targetingMsgJson","siteUrl","selectors","selector","element","querySelector","outerHTML","intervalId","retryElement","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","onclick","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","inaObj","kvPairsEvent","CustomEvent","dispatchEvent","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","pointerCss","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","ifrm","contentWindow","contentDocument","doc","closeCampaign","Event","write","appendScriptForCustomEvent","close","adjustIFrameHeight","scrollHeight","margin","ua","inDoc","_timer","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","getTotalVisits","visitCount","getLastVisit","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","info","debugPE","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","getTimeElapsed","sessionStart","getPageCount","seqNo","requestTime","RequestManager","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","post","fetch","method","headers","response","ok","json","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","_enableWebPush","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","skipDialog","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","getValue","getdefaultValue","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","addValueChangedCallback","removeValueChangedCallback","clearStartFlag","VariableStore","syncVariables","onSyncSuccess","onSyncFailure","meta","r","status","fetchVariables","onFetchCallback","addVariablesChangedCallback","callback","addOneTimeVariablesChangedCallback","removeVariablesChangedCallback","removeOneTimeVariablesChangedCallback","callBack","CleverTap","spa","isSpa","bind","enablePersonalization","_isPersonalisationActive","ReqestManager","onUserLogin","privacy","notifications","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","handleDecrementValue","setMultiValuesForKey","addMultiValueForKey","addMultiValuesForKey","removeMultiValueForKey","removeMultiValuesForKey","removeValueForKey","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","sendLocationData","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","elements","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","postMessage","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","setOffline","arg","defineVariable","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;EAAO,MAAMA,aAAa,GAAG,oBAAtB;EACA,MAAMC,eAAe,GAAG,QAAxB;EACA,MAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;ECAQ,MAAMC,OAAN,CAAc;EAO3BC,EAAAA,WAAW,GAAsE;EAAA,QAApE;EAAEC,MAAAA;EAAF,KAAoE,uEAA3D,EAA2D;EAAA,QAAvDC,MAAuD,uEAA9C,EAA8C;EAAA,QAA1CC,YAA0C,uEAA3BP,aAA2B;EAAA,QAAZQ,KAAY,uEAAJ,EAAI;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,aALvE;EAKuE;EAAA;EAAA;EAAA,aAJjER;EAIiE;EAAA;EAAA;EAAA,aAHjE;EAGiE;EAAA;EAAA;EAAA,aAFxE;EAEwE;EAC/E,SAAKK,EAAL,GAAUA,EAAV;;EACA,QAAIC,MAAJ,EAAY;EACV,WAAKA,MAAL,GAAcA,MAAd;EACD;;EACD,QAAIC,YAAJ,EAAkB;EAChB,WAAKA,YAAL,GAAoBA,YAApB;EACD;;EACD,QAAIC,KAAJ,EAAW;EACT,WAAKA,KAAL,GAAaA,KAAb;EACD;EACF;;EAED,MAAIH,EAAJ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ACD;;yDAMmBlsC,MAAM;EACxB,MAAI,KAAKqlC,wBAAL,EAAJ,EAAqC;EACnCrlC,IAAAA,IAAI,CAAC+9B,KAAL,GAAa,IAAb;EACD;EACF;;QCtxBGruB,SAAS,GAAG,IAAIy8B,SAAJ,CAAcvqC,MAAM,CAAC8N,SAArB;EAElB9N,MAAM,CAAC8N,SAAP,GAAmB9N,MAAM,CAAC+N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file diff --git a/clevertap.min.js b/clevertap.min.js index ef65b677..c15bba48 100644 --- a/clevertap.min.js +++ b/clevertap.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).clevertap=t()}(this,(function(){"use strict";var e=0;function t(t){return"__private_"+e+++"_"+t}function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}const o="clevertap-prod.com",n="https:";var s=t("accountId"),r=t("region"),a=t("targetDomain"),l=t("dcSdkversion"),c=t("token");class d{constructor(){let{id:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";Object.defineProperty(this,s,{writable:!0,value:void 0}),Object.defineProperty(this,r,{writable:!0,value:""}),Object.defineProperty(this,a,{writable:!0,value:o}),Object.defineProperty(this,l,{writable:!0,value:""}),Object.defineProperty(this,c,{writable:!0,value:""}),this.id=e,t&&(this.region=t),i&&(this.targetDomain=i),n&&(this.token=n)}get id(){return i(this,s)[s]}set id(e){i(this,s)[s]=e}get region(){return i(this,r)[r]}set region(e){i(this,r)[r]=e}get dcSDKVersion(){return i(this,l)[l]}set dcSDKVersion(e){i(this,l)[l]=e}get targetDomain(){return i(this,a)[a]}set targetDomain(e){i(this,a)[a]=e}get token(){return i(this,c)[c]}set token(e){i(this,c)[c]=e}get finalTargetDomain(){return this.region?"".concat(this.region,".").concat(this.targetDomain):this.targetDomain===o?"".concat("eu1",".").concat(this.targetDomain):this.targetDomain}get dataPostPEURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/defineVars")}get dataPostURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/a?t=96")}get recorderURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/r?r=1")}get emailURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/e?r=1")}}const h=new RegExp("^\\s+|\\.|:|\\$|'|\"|\\\\|\\s+$","g"),u=new RegExp("^\\s+|'|\"|\\\\|\\s+$","g"),p=new RegExp("'","g"),g="clear",f="Charged ID",v="WZRK_CHARGED_ID",b="WZRK_G",m="WZRK_K",y="WZRK_CAMP",w="WZRK_CAMP_G",C="WZRK_EV",k="WZRK_META",x="WZRK_PR",P="WZRK_ARP",S="WZRK_L",I="global",O="optOut",_="useIP",E="WZRK_X",A="push",L=31536e3,M="wzrk_",T="wzrk_id",R="Notification Viewed",j="Notification Clicked",D="WZRK_FPU",z="WZRK_PSD",B="$incr",N="$add",F="$remove",U="$delete",q="WZRK_INBOX_CONFIG",V="WZRK_INBOX",W=1e3,K="wzrk_fetch",G=["Stayed","UTM Visited","App Launched","Notification Sent",R,j],H=e=>"string"==typeof e||e instanceof String,J=e=>"[object Object]"===Object.prototype.toString.call(e),Z=e=>"object"==typeof e&&e instanceof Date,$=e=>{for(const t in e)if(e.hasOwnProperty(t))return!1;return!0},Y=e=>!isNaN(parseFloat(e))&&isFinite(e),Q=e=>/^-?[\d.]+(?:e-?\d+)?$/.test(e)&&"number"==typeof e,X=e=>null!=e&&"undefined"!==e,ee=(e,t)=>{if("object"!=typeof e){let i;return H(e)?(i=te(e,u),i.length>1024&&(i=i.substring(0,1024),t.reportError(521,i+"... length exceeded 1024 chars. Trimmed."))):i=e,i}for(const i in e)if(e.hasOwnProperty(i)){const o=ee(e[i],t);let n;n=te(i,h),n.length>1024&&(n=n.substring(0,1024),t.reportError(520,n+"... length exceeded 1024 chars. Trimmed.")),delete e[i],e[n]=o}return e},te=(e,t)=>e.replace(t,""),ie=()=>{const e=new Date;return e.getFullYear()+""+e.getMonth()+e.getDay()},oe=()=>Math.floor((new Date).getTime()/1e3),ne=e=>"$D_"+Math.round(e.getTime()/1e3),se=e=>{if(re(e))return"$D_"+e},re=e=>{const t=/^(\d{4})(\d{2})(\d{2})$/.exec(e);if(null==t)return!1;const i=t[3],o=t[2]-1,n=t[1],s=new Date(n,o,i);return s.getDate()==i&&s.getMonth()==o&&s.getFullYear()==n};class ae{static save(e,t){return!(!e||!t)&&(this._isLocalStorageSupported()?(localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),!0):void 0)}static read(e){if(!e)return!1;let t=null;if(this._isLocalStorageSupported()&&(t=localStorage.getItem(e)),null!=t)try{t=JSON.parse(t)}catch(e){}return t}static remove(e){return!!e&&(this._isLocalStorageSupported()?(localStorage.removeItem(e),!0):void 0)}static removeCookie(e,t){let i=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";t&&(i=i+" domain="+t+"; path=/"),document.cookie=i}static createCookie(e,t,i,o){let n="",s="";if(i){const e=new Date;e.setTime(e.getTime()+1e3*i),n="; expires="+e.toGMTString()}o&&(s="; domain="+o),t=encodeURIComponent(t),document.cookie=e+"="+t+n+s+"; path=/"}static readCookie(e){const t=e+"=",i=document.cookie.split(";");for(let e=0;e=0;o--){if(a=0===o?r[o]+a:"."+r[o]+a,this.readCookie(e)){var n="test_"+e+o;if(this.createCookie(n,t,10,a),!this.readCookie(n))continue;this.removeCookie(n,a)}this.createCookie(e,t,i,a);if(this.readCookie(e)==t){s=a,le.broadDomain=s;break}}}else this.createCookie(e,t,i,s)}else this.createCookie(e,t,i,o)}static getMetaProp(e){const t=this.readFromLSorCookie(k);if(null!=t)return t[e]}static setMetaProp(e,t){if(this._isLocalStorageSupported()){let i=this.readFromLSorCookie(k);null==i&&(i={}),void 0===t?delete i[e]:i[e]=t,this.saveToLSorCookie(k,i)}}static getAndClearMetaProp(e){const t=this.getMetaProp(e);return this.setMetaProp(e,void 0),t}static setInstantDeleteFlagInK(){let e=this.readFromLSorCookie(m);null==e&&(e={}),e.flag=!0,this.saveToLSorCookie(m,e)}static backupEvent(e,t,i){let o=this.readFromLSorCookie(S);void 0===o&&(o={}),o[t]={q:e},this.saveToLSorCookie(S,o),i.debug("stored in ".concat(S," reqNo : ").concat(t," -> ").concat(e))}static removeBackup(e,t){const i=this.readFromLSorCookie(S);null!=i&&void 0!==i[e]&&(t.debug("del event: ".concat(e," data-> ").concat(i[e].q)),delete i[e],this.saveToLSorCookie(S,i))}}const le={globalCache:{gcookie:null,REQ_N:0,RESP_N:0},LRU_CACHE:null,globalProfileMap:void 0,globalEventsMap:void 0,blockRequest:!1,isOptInRequest:!1,broadDomain:null,webPushEnabled:null,campaignDivMap:{},currentSessionId:null,wiz_counter:0,notifApi:{notifEnabledFromApi:!1},unsubGroups:[],updatedCategoryLong:null,inbox:null,isPrivacyArrPushed:!1,privacyArray:[],offline:!1,location:null,dismissSpamControl:!1,globalUnsubscribe:!0,flutterVersion:null,variableStore:{}};var ce=t("keyOrder"),de=t("deleteFromObject");class he{constructor(e){Object.defineProperty(this,de,{value:ue}),Object.defineProperty(this,ce,{writable:!0,value:void 0}),this.max=e;let t=ae.readFromLSorCookie(E);if(t){const e={};i(this,ce)[ce]=[],t=t.cache;for(const o in t)t.hasOwnProperty(o)&&(e[t[o][0]]=t[o][1],i(this,ce)[ce].push(t[o][0]));this.cache=e}else this.cache={},i(this,ce)[ce]=[]}get(e){const t=this.cache[e];return t&&(this.cache=i(this,de)[de](e,this.cache),this.cache[e]=t,i(this,ce)[ce].push(e)),this.saveCacheToLS(this.cache),t}set(e,t){const o=this.cache[e],n=i(this,ce)[ce];null!=o?this.cache=i(this,de)[de](e,this.cache):n.length===this.max&&(this.cache=i(this,de)[de](n[0],this.cache)),this.cache[e]=t,i(this,ce)[ce][i(this,ce)[ce]-1]!==e&&i(this,ce)[ce].push(e),this.saveCacheToLS(this.cache)}saveCacheToLS(e){const t=[],o=i(this,ce)[ce];for(const i in o)if(o.hasOwnProperty(i)){const n=[];n.push(o[i]),n.push(e[o[i]]),t.push(n)}ae.saveToLSorCookie(E,{cache:t})}getKey(e){if(null===e)return null;const t=i(this,ce)[ce];for(const i in t)if(t.hasOwnProperty(i)&&this.cache[t[i]]===e)return t[i];return null}getSecondLastKey(){const e=i(this,ce)[ce];return null!=e&&e.length>1?e[e.length-2]:-1}getLastKey(){const e=i(this,ce)[ce].length;if(e)return i(this,ce)[ce][e-1]}}var ue=function(e,t){const o=JSON.parse(JSON.stringify(i(this,ce)[ce])),n={};let s;for(const i in o)o.hasOwnProperty(i)&&(o[i]!==e?n[o[i]]=t[o[i]]:s=i);return o.splice(s,1),i(this,ce)[ce]=JSON.parse(JSON.stringify(o)),n},pe=t("logger"),ge=t("request"),fe=t("device"),ve=t("session");class be{constructor(e){let{logger:t,request:o,device:n,session:s}=e;Object.defineProperty(this,pe,{writable:!0,value:void 0}),Object.defineProperty(this,ge,{writable:!0,value:void 0}),Object.defineProperty(this,fe,{writable:!0,value:void 0}),Object.defineProperty(this,ve,{writable:!0,value:void 0}),i(this,pe)[pe]=t,i(this,ge)[ge]=o,i(this,fe)[fe]=n,i(this,ve)[ve]=s}s(e,t,o,n,s){let r=!1,a=!1;if(window.isOULInProgress&&(o||"undefined"!==n&&n===window.oulReqN)&&(window.isOULInProgress=!1,r=!0),void 0===n&&(n=0),ae.removeBackup(n,i(this,pe)[pe]),n>le.globalCache.REQ_N)return;if(X(i(this,fe)[fe].gcookie)||e&&(a=!0),!X(i(this,fe)[fe].gcookie)||o||"boolean"==typeof s){const n=i(this,ve)[ve].getSessionCookieObject();if(window.isOULInProgress||n.s&&t{if(J(e)){for(var t in e)if(e.hasOwnProperty(t)){if(J(e[t])||Array.isArray(e[t]))return!1;Z(e[t])&&(e[t]=ne(e[t]))}return!0}return!1},Re=(e,t)=>{if(J(e)){for(var i in e)if(e.hasOwnProperty(i))if("Items"===i){if(!Array.isArray(e[i]))return!1;for(var o in e[i].length>50&&t.reportError(522,"Charged Items exceed 50 limit. Actual count: "+e[i].length),e[i])if(e[i].hasOwnProperty(o)&&(!J(e[i][o])||!Te(e[i][o])))return!1}else{if(J(e[i])||Array.isArray(e[i]))return!1;Z(e[i])&&(e[i]=ne(e[i]))}if(H(e[f])||Q(e[f])){const i=e[f]+"";if(void 0===Me&&(Me=ae.readFromLSorCookie(v)),void 0!==Me&&Me.trim()===i.trim())return t.error("Duplicate charged Id - Dropped"+e),!1;Me=i,ae.saveToLSorCookie(v,i)}return!0}return!1};var je=t("logger"),De=t("oldValues"),ze=t("request"),Be=t("isPersonalisationActive"),Ne=t("processEventArray");class Fe extends Array{constructor(e,t){let{logger:o,request:n,isPersonalisationActive:s}=e;super(),Object.defineProperty(this,Ne,{value:Ue}),Object.defineProperty(this,je,{writable:!0,value:void 0}),Object.defineProperty(this,De,{writable:!0,value:void 0}),Object.defineProperty(this,ze,{writable:!0,value:void 0}),Object.defineProperty(this,Be,{writable:!0,value:void 0}),i(this,je)[je]=o,i(this,De)[De]=t,i(this,ze)[ze]=n,i(this,Be)[Be]=s}push(){for(var e=arguments.length,t=new Array(e),o=0;o0;){var t=e.shift();if(!H(t)){i(this,je)[je].error(xe);continue}if(t.length>1024&&(t=t.substring(0,1024),i(this,je)[je].reportError(510,t+"... length exceeded 1024 chars. Trimmed.")),G.includes(t)){i(this,je)[je].reportError(513,t+" is a restricted system event. It cannot be used as an event name.");continue}const o={type:"event"};if(o.evtName=te(t,h),0!==e.length){const n=e.shift();if(J(n)){if("Charged"===t){if(!Re(n,i(this,je)[je])){i(this,je)[je].reportError(511,"Charged event structure invalid. Not sent.");continue}}else if(!Te(n)){i(this,je)[je].reportError(512,t+" event structure invalid. Not sent.");continue}o.evtData=n}else e.unshift(n)}i(this,ze)[ze].processEvent(o)}};const qe=e=>{const t={},i=e.indexOf("?");if(i>1){const o=e.substring(i+1);let n;const s=/\+/g,r=/([^&=]+)=?([^&]*)/g,a=function(e){let t=e.replace(s," ");try{t=decodeURIComponent(t)}catch(e){}return t};for(n=r.exec(o);n;)t[a(n[1])]=a(n[2]),n=r.exec(o)}return t},Ve=(e,t,i)=>e+"&"+t+"="+encodeURIComponent(i),We=()=>window.location.hostname,Ke=(e,t)=>(t&&"function"==typeof t.debug&&t.debug("dobj:"+e),He(e)),Ge=(()=>{let e="",t=0;for(t=0;t<=25;t++)e+=String.fromCharCode(t+65);for(t=0;t<=25;t++)e+=String.fromCharCode(t+97);for(t=0;t<10;t++)e+=t;return e+"+/="})(),He=e=>{if(null==e)return"";var t,i,o,n,s,r,a,l="",c=0;for(e=(e=>{if(null==e)return"";let t,i,o,n={},s={},r="",a="",l="",c=2,d=3,h=2,u="",p=0,g=0,f=String.fromCharCode;for(o=0;o>=1}else{for(i=1,t=0;t>=1}c--,0==c&&(c=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;c--,0==c&&(c=Math.pow(2,h),h++),n[a]=d++,l=String(r)}if(""!==l){if(Object.prototype.hasOwnProperty.call(s,l)){if(l.charCodeAt(0)<256){for(t=0;t>=1}else{for(i=1,t=0;t>=1}c--,0==c&&(c=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;c--,0==c&&(c=Math.pow(2,h),h++)}for(i=2,t=0;t>=1;for(;;){if(p<<=1,15==g){u+=f(p);break}g++}return u})(e);c<2*e.length;)c%2==0?(t=e.charCodeAt(c/2)>>8,i=255&e.charCodeAt(c/2),o=c/2+1>8:NaN):(t=255&e.charCodeAt((c-1)/2),(c+1)/2>8,o=255&e.charCodeAt((c+1)/2)):i=o=NaN),c+=3,n=t>>2,s=(3&t)<<4|i>>4,r=(15&i)<<2|o>>6,a=63&o,isNaN(i)?r=a=64:isNaN(o)&&(a=64),l=l+Ge.charAt(n)+Ge.charAt(s)+Ge.charAt(r)+Ge.charAt(a);return l};var Je=t("fireRequest"),Ze=t("dropRequestDueToOptOut"),$e=t("addUseIPToRequest"),Ye=t("addARPToRequest");class Qe{constructor(){this.networkRetryCount=0,this.minDelayFrequency=0}static fireRequest(e,t,o,n){i(this,Je)[Je](e,1,t,o,n)}getDelayFrequency(){if(this.logger.debug("Network retry #"+this.networkRetryCount),this.networkRetryCount<10)return this.logger.debug(this.account.id,"Failure count is "+this.networkRetryCount+". Setting delay frequency to 1s"),this.minDelayFrequency=W,this.minDelayFrequency;if(null==this.account.region)return this.logger.debug(this.account.id,"Setting delay frequency to 1s"),W;{const e=1e3*(Math.floor(10*Math.random())+1);return this.minDelayFrequency+=e,this.minDelayFrequency<6e5?(this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency):(this.minDelayFrequency=W,this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency)}}}Qe.logger=void 0,Qe.device=void 0,Qe.account=void 0,Object.defineProperty(Qe,Je,{value:function(e,t,o,n,s){var r,a;if(i(this,Ze)[Ze]())return void this.logger.debug("req dropped due to optout cookie: "+this.device.gcookie);if(X(this.device.gcookie)||(le.blockRequest=!0),s&&s===K)!X(this.device.gcookie)&&le.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(this.networkRetryCount)),i(this,Je)[Je](e,void 0,o,n)}),this.getDelayFrequency());else if(!X(this.device.gcookie)&&le.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(t)),i(this,Je)[Je](e,t+1,o,n)}),50);if(n?window.isOULInProgress=!0:(X(this.device.gcookie)&&(e=Ve(e,"gc",this.device.gcookie)),e=i(this,Ye)[Ye](e,o)),e=Ve(e,"tries",t),e=i(this,$e)[$e](e),e=Ve(e,"r",(new Date).getTime()),(null===(r=window.clevertap)||void 0===r?void 0:r.hasOwnProperty("plugin"))||(null===(a=window.wizrocket)||void 0===a?void 0:a.hasOwnProperty("plugin"))){const t=window.clevertap.plugin||window.wizrocket.plugin;e=Ve(e,"ct_pl",t)}-1!==e.indexOf("chrome-extension:")&&(e=e.replace("chrome-extension:","https:"));for(var l=document.getElementsByClassName("ct-jp-cb");l[0]&&l[0].parentNode;)l[0].parentNode.removeChild(l[0]);const c=document.createElement("script");c.setAttribute("type","text/javascript"),c.setAttribute("src",e),c.setAttribute("class","ct-jp-cb"),c.setAttribute("rel","nofollow"),c.async=!0,document.getElementsByTagName("head")[0].appendChild(c),this.logger.debug("req snt -> url: "+e)}}),Object.defineProperty(Qe,Ze,{value:function(){return!le.isOptInRequest&&X(this.device.gcookie)&&H(this.device.gcookie)?":OO"===this.device.gcookie.slice(-3):(le.isOptInRequest=!1,!1)}}),Object.defineProperty(Qe,$e,{value:function(e){var t=ae.getMetaProp(_);return"boolean"!=typeof t&&(t=!1),Ve(e,_,t?"true":"false")}}),Object.defineProperty(Qe,Ye,{value:function(e,t){if(!0===t){const t={skipResARP:!0};return Ve(e,"arp",Ke(JSON.stringify(t),this.logger))}return ae._isLocalStorageSupported()&&void 0!==localStorage.getItem(P)&&null!==localStorage.getItem(P)?Ve(e,"arp",Ke(JSON.stringify(ae.readFromLSorCookie(P)),this.logger)):e}});const Xe=()=>{let e={};if(ae._isLocalStorageSupported()){let t=ae.read(y);null!=t?(t=JSON.parse(decodeURIComponent(t).replace(p,'"')),t.hasOwnProperty("global")?e.wp=t:e=t):e={}}return e},et=e=>{if(ae._isLocalStorageSupported()){const t={...Xe(),...e},i=JSON.stringify(t);ae.save(y,encodeURIComponent(i)),tt()}},tt=()=>{if(ae._isLocalStorageSupported()){let i=ae.read(b);if(X(i))try{i=JSON.parse(decodeURIComponent(ae.read(b)));const o=ae.read(w)?JSON.parse(decodeURIComponent(ae.read(w))):{};if(i&&ae._isLocalStorageSupported()){var e={},t=Xe();Object.keys(t).forEach((n=>{const s=i in o&&Object.keys(o[i]).length&&o[i][n]?o[i][n]:{},r=t[n].global,a=ie(),l=t[n][a];if(void 0!==r){const e=Object.keys(r);for(const t in e){let i=[];if(e.hasOwnProperty(t)){let o=0,n=0;const a=e[t];if("tc"===a)continue;void 0!==l&&void 0!==l[a]&&(o=l[a]),void 0!==r&&void 0!==r[a]&&(n=r[a]),i=[a,o,n],s[a]=i}}}e={...e,[n]:s}})),o[i]=e,ae.save(w,encodeURIComponent(JSON.stringify(o)))}}catch(e){console.error("Invalid clevertap Id "+e)}}},it=()=>{const e=JSON.parse(decodeURIComponent(ae.read(b)));let t={};if(ae._isLocalStorageSupported()){let i={};t=Xe();const o=ae.read(w),n=o?decodeURIComponent(o):null,s=n?JSON.parse(n):null,r=e&&null!=o&&s&&s[e]&&s[e].wp?Object.values(s[e].wp):[],a=e&&null!=o&&s&&s[e]&&s[e].wi?Object.values(s[e].wi):[],l=ie();let c=0,d=0;return t.wp&&t.wp[l]&&"undefined"!==t.wp[l].tc&&(c=t.wp[l].tc),t.wi&&t.wi[l]&&"undefined"!==t.wi[l].tc&&(d=t.wi[l].tc),i={wmp:c,wimp:d,tlc:r,witlc:a},i}},ot=(e,t)=>{let{logger:i}=t,o=!1;if(J(e))for(const t in e)if(e.hasOwnProperty(t)){o=!0;let n=e[t];if(null==n){delete e[t];continue}"Gender"!==t||n.match(/^M$|^F$/)||(o=!1,i.error(Pe)),"Employed"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Se)),"Married"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Ie)),"Education"!==t||n.match(/^School$|^College$|^Graduate$/)||(o=!1,i.error(Oe)),"Age"===t&&null!=n&&(Y(n)?e.Age=+n:(o=!1,i.error(_e))),"DOB"===t?(/^\$D_/.test(n)&&11===(n+"").length||Z(n)||(o=!1,i.error(Ee)),Z(n)&&(e[t]=ne(n))):Z(n)&&(e[t]=ne(n)),"Phone"!==t||$(n)||(n.length>8&&"+"===n.charAt(0)?(n=n.substring(1,n.length),Y(n)?e.Phone=+n:(o=!1,i.error(Le+". Removed."))):(o=!1,i.error(Le+". Removed."))),o||delete e[t]}return o},nt=e=>{const t={};t.Name=e.name,null!=e.id&&(t.FBID=e.id+""),"male"===e.gender?t.Gender="M":"female"===e.gender?t.Gender="F":t.Gender="O";null!=e.relationship_status&&(t.Married="N","Married"===e.relationship_status&&(t.Married="Y"));const i=function(e){if(null!=e){let t="",i="";for(let o=0;o0?"Y":"N",null!=e.email&&(t.Email=e.email),null!=e.birthday){const i=e.birthday.split("/");t.DOB=se(i[2]+i[0]+i[1])}return t},st=(e,t)=>{let{logger:i}=t;const o={};if(null!=e.displayName&&(o.Name=e.displayName),null!=e.id&&(o.GPID=e.id+""),null!=e.gender&&("male"===e.gender?o.Gender="M":"female"===e.gender?o.Gender="F":"other"===e.gender&&(o.Gender="O")),null!=e.image&&!1===e.image.isDefault&&(o.Photo=e.image.url.split("?sz")[0]),null!=e.emails)for(let t=0;t{if(ae._isLocalStorageSupported()){if(null==le.globalProfileMap&&(le.globalProfileMap=ae.readFromLSorCookie(x),null==le.globalProfileMap&&(le.globalProfileMap={})),null!=e._custom){const t=e._custom;for(const i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);delete e._custom}for(const i in e)if(e.hasOwnProperty(i)){if(le.globalProfileMap.hasOwnProperty(i)&&!t)continue;le.globalProfileMap[i]=e[i]}null!=le.globalProfileMap._custom&&delete le.globalProfileMap._custom,ae.saveToLSorCookie(x,le.globalProfileMap)}},at=(e,t,i)=>{if(null!=e&&"-1"!==e&&ae._isLocalStorageSupported()){const t=Xe();let o=t.wp[i];null==o&&(o={},t[i]=o),o[e]="dnd",et(t)}if(null!=le.campaignDivMap){const t=le.campaignDivMap[e];null!=t&&(document.getElementById(t).style.display="none","intentPreview"===t&&null!=document.getElementById("intentOpacityDiv")&&(document.getElementById("intentOpacityDiv").style.display="none"))}};var lt=t("logger"),ct=t("request"),dt=t("account"),ht=t("oldValues"),ut=t("isPersonalisationActive"),pt=t("processProfileArray");class gt extends Array{constructor(e,t){let{logger:o,request:n,account:s,isPersonalisationActive:r}=e;super(),Object.defineProperty(this,pt,{value:ft}),Object.defineProperty(this,lt,{writable:!0,value:void 0}),Object.defineProperty(this,ct,{writable:!0,value:void 0}),Object.defineProperty(this,dt,{writable:!0,value:void 0}),Object.defineProperty(this,ht,{writable:!0,value:void 0}),Object.defineProperty(this,ut,{writable:!0,value:void 0}),i(this,lt)[lt]=o,i(this,ct)[ct]=n,i(this,dt)[dt]=s,i(this,ht)[ht]=t,i(this,ut)[ut]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o0)for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];let n,s={};if(null!=o.Site){if(n=o.Site,$(n)||!ot(n,{logger:i(this,lt)[lt]}))return}else if(null!=o.Facebook){const e=o.Facebook;$(e)||e.error||(n=nt(e))}else if(null!=o["Google Plus"]){const e=o["Google Plus"];$(e)||e.error||(n=st(e,{logger:i(this,lt)[lt]}))}if(null!=n&&!$(n)){s.type="profile",null==n.tz&&(n.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),s.profile=n,rt(n,!0),s=i(this,ct)[ct].addSystemDataToObject(s,void 0),i(this,ct)[ct].addFlags(s);const e=Ke(JSON.stringify(s),i(this,lt)[lt]);let t=i(this,dt)[dt].dataPostURL;t=Ve(t,"type",A),t=Ve(t,"d",e),i(this,ct)[ct].saveAndFireRequest(t,le.blockRequest)}}},vt=t("request"),bt=t("logger"),mt=t("account"),yt=t("session"),wt=t("oldValues"),Ct=t("device"),kt=t("processOUL"),xt=t("handleCookieFromCache"),Pt=t("deleteUser"),St=t("processLoginArray");class It extends Array{constructor(e,t){let{request:o,account:n,session:s,logger:r,device:a}=e;super(),Object.defineProperty(this,St,{value:At}),Object.defineProperty(this,Pt,{value:Et}),Object.defineProperty(this,xt,{value:_t}),Object.defineProperty(this,kt,{value:Ot}),Object.defineProperty(this,vt,{writable:!0,value:void 0}),Object.defineProperty(this,bt,{writable:!0,value:void 0}),Object.defineProperty(this,mt,{writable:!0,value:void 0}),Object.defineProperty(this,yt,{writable:!0,value:void 0}),Object.defineProperty(this,wt,{writable:!0,value:void 0}),Object.defineProperty(this,Ct,{writable:!0,value:void 0}),i(this,vt)[vt]=o,i(this,mt)[mt]=n,i(this,yt)[yt]=s,i(this,bt)[bt]=r,i(this,wt)[wt]=t,i(this,Ct)[Ct]=a}clear(){i(this,bt)[bt].debug("clear called. Reset flag has been set."),i(this,Pt)[Pt](),ae.setMetaProp(g,!0)}push(){for(var e=arguments.length,t=new Array(e),o=0;o{let o=ae.readFromLSorCookie(m);const n=ae.readFromLSorCookie(b);let s;if(null==o)o={},s=e;else{s=o.id;let r=!1,a=!1;if(null==s&&(s=e[0],r=!0),null==le.LRU_CACHE&&ae._isLocalStorageSupported()&&(le.LRU_CACHE=new he(100)),r)null!=n&&(le.LRU_CACHE.set(s,n),le.blockRequest=!1);else for(const t in e)if(e.hasOwnProperty(t)){const i=e[t];if(le.LRU_CACHE.cache[i]){s=i,a=!0;break}}if(a){s!==le.LRU_CACHE.getLastKey()?i(this,xt)[xt]():(t=!1,ae.saveToLSorCookie(D,t));const e=le.LRU_CACHE.get(s);le.LRU_CACHE.set(s,e),ae.saveToLSorCookie(b,e),i(this,Ct)[Ct].gcookie=e;const o=le.LRU_CACHE.getSecondLastKey();if(ae.readFromLSorCookie(D)&&-1!==o){const e=le.LRU_CACHE.cache[o];i(this,vt)[vt].unregisterTokenForGuid(e)}}else r?null!=n&&(i(this,Ct)[Ct].gcookie=n,ae.saveToLSorCookie(b,n),t=!1):this.clear(),ae.saveToLSorCookie(D,!1),s=e[0]}o.id=s,ae.saveToLSorCookie(m,o)};if(Array.isArray(e)&&e.length>0)for(const n in e)if(e.hasOwnProperty(n)){const s=e[n];let r,a={};if(null!=s.Site){if(r=s.Site,$(r)||!ot(r,{logger:i(this,bt)[bt]}))return}else if(null!=s.Facebook){const e=s.Facebook;$(e)||e.error||(r=nt(e))}else if(null!=s["Google Plus"]){const e=s["Google Plus"];$(e)&&!e.error&&(r=st(e,{logger:i(this,bt)[bt]}))}if(null!=r&&!$(r)){a.type="profile",null==r.tz&&(r.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),a.profile=r;const e=[];ae._isLocalStorageSupported()&&(r.Identity&&e.push(r.Identity),r.Email&&e.push(r.Email),r.GPID&&e.push("GP:"+r.GPID),r.FBID&&e.push("FB:"+r.FBID),e.length>0&&o(e)),rt(r,!0),a=i(this,vt)[vt].addSystemDataToObject(a,void 0),i(this,vt)[vt].addFlags(a),t&&(a.isOUL=!0);const n=Ke(JSON.stringify(a),i(this,bt)[bt]);let s=i(this,mt)[mt].dataPostURL;s=Ve(s,"type",A),s=Ve(s,"d",n),i(this,vt)[vt].saveAndFireRequest(s,le.blockRequest,t)}}},_t=function(){le.blockRequest=!1,console.debug("Block request is false"),ae._isLocalStorageSupported()&&(delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),ae.removeCookie(y,We()),ae.removeCookie(i(this,yt)[yt].cookieName,le.broadDomain),ae.removeCookie(P,le.broadDomain),i(this,yt)[yt].setSessionCookieObject("")},Et=function(){le.blockRequest=!0,i(this,bt)[bt].debug("Block request is true"),le.globalCache={gcookie:null,REQ_N:0,RESP_N:0},ae._isLocalStorageSupported()&&(delete localStorage.WZRK_G,delete localStorage.WZRK_K,delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),ae.removeCookie(b,le.broadDomain),ae.removeCookie(y,We()),ae.removeCookie(m,We()),ae.removeCookie(i(this,yt)[yt].cookieName,le.broadDomain),ae.removeCookie(P,le.broadDomain),i(this,Ct)[Ct].gcookie=null,i(this,yt)[yt].setSessionCookieObject("")},At=function(e){if(Array.isArray(e)&&e.length>0){const t=e.pop();if(null!=t&&J(t)&&(null!=t.Site&&Object.keys(t.Site).length>0||null!=t.Facebook&&Object.keys(t.Facebook).length>0||null!=t["Google Plus"]&&Object.keys(t["Google Plus"]).length>0)){ae.setInstantDeleteFlagInK();try{i(this,kt)[kt]([t])}catch(e){i(this,bt)[bt].debug(e)}}else i(this,bt)[bt].error("Profile object is in incorrect format")}};class Lt extends HTMLElement{constructor(){super(),this._details=null,this.shadow=null,this.shadow=this.attachShadow({mode:"open"})}get details(){return this._details||""}set details(e){null===this._details&&(this._details=e,this.renderBanner())}renderBanner(){this.shadow.innerHTML=this.getBannerContent(),!1!==this.trackClick&&this.addEventListener("click",(()=>{const e=this.details.onClick;e&&(this.details.window?window.open(e,"_blank"):window.parent.location.href=e),window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId})}getBannerContent(){return'\n \n \n ")}}class Mt extends HTMLElement{constructor(){super(),this._target=null,this._carousel=null,this.shadow=null,this.slides=0,this.previouslySelectedItem=-1,this.selectedItem=1,this.autoSlide=null,this.stopAutoSlideTimeout=null,this.shadow=this.attachShadow({mode:"open"}),void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Lt)}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderCarousel())}get details(){return this.target.display.details}get display(){return this.target.display}renderCarousel(){this.slides=this.details.length,this.shadow.innerHTML=this.getStyles();const e=this.getCarouselContent();this.display.showNavBtns&&e.insertAdjacentHTML("beforeend",this.display.navBtnsHtml),this.display.showNavArrows&&(e.insertAdjacentHTML("beforeend",this.display.leftNavArrowHtml),e.insertAdjacentHTML("beforeend",this.display.rightNavArrowHtml)),this._carousel=e,this.shadow.appendChild(e),this.setupClick(),this.updateSelectedItem(),this.startAutoSlide(),this.setupOnHover(),window.clevertap.renderNotificationViewed({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot})}setupClick(){this._carousel.addEventListener("click",(e=>{const t=e.target.id;if(t.startsWith("carousel__button")){const e=+t.split("-")[1];e!==this.selectedItem&&(this.previouslySelectedItem=this.selectedItem,this.selectedItem=e,this.updateSelectedItem(),this.startAutoSlide())}else if(t.startsWith("carousel__arrow"))t.endsWith("right")?this.goToNext():this.goToPrev(),this.startAutoSlide();else if(t.indexOf("-")>-1){const e=+t.split("-")[1],i=e-1;window.parent.clevertap&&window.clevertap.renderNotificationClicked({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot,wzrk_slideNo:e});const o=this.details[i].onClick;""!==o&&(this.details[i].window?window.open(o,"_blank"):window.location.href=o)}}))}setupOnHover(){this._carousel.addEventListener("mouseenter",(e=>{this.stopAutoSlideTimeout=setTimeout((()=>{this.autoSlide=clearInterval(this.autoSlide)}),500)})),this._carousel.addEventListener("mouseleave",(e=>{clearTimeout(this.stopAutoSlideTimeout),void 0===this.autoSlide&&this.startAutoSlide()}))}getCarouselContent(){const e=document.createElement("div");return e.setAttribute("class","carousel"),this.details.forEach(((t,i)=>{const o=document.createElement("ct-web-personalisation-banner");o.classList.add("carousel__item"),o.trackClick=!1,o.setAttribute("id","carousel__item-".concat(i+1)),o.details=t,e.appendChild(o)})),e}getStyles(){var e,t;return"\n \n ")}updateSelectedItem(){if(-1!==this.previouslySelectedItem){const e=this.shadow.getElementById("carousel__item-".concat(this.previouslySelectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.previouslySelectedItem));e.classList.remove("carousel__item--selected"),t&&t.classList.remove("carousel__button--selected")}const e=this.shadow.getElementById("carousel__item-".concat(this.selectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.selectedItem));e.classList.add("carousel__item--selected"),t&&t.classList.add("carousel__button--selected")}startAutoSlide(){clearInterval(this.autoSlide),this.autoSlide=setInterval((()=>{this.goToNext()}),this.display.sliderTime?1e3*this.display.sliderTime:3e3)}goToNext(){this.goTo(this.selectedItem,(this.selectedItem+1)%this.slides)}goToPrev(){this.goTo(this.selectedItem,this.selectedItem-1)}goTo(e,t){this.previouslySelectedItem=e,this.selectedItem=t,0===t&&(this.selectedItem=this.slides),this.updateSelectedItem()}}class Tt extends HTMLElement{constructor(){super(),this._target=null,this._session=null,this.shadow=null,this.popup=null,this.container=null,this.resizeObserver=null,this.shadow=this.attachShadow({mode:"open"})}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderImageOnlyPopup())}get session(){return this._session||""}set session(e){this._session=e}get msgId(){return this.target.wzrk_id}get pivotId(){return this.target.wzrk_pivot}get onClickUrl(){return this.target.display.onClickUrl}renderImageOnlyPopup(){const e=this.target.wzrk_id.split("_")[0],t=this.session.sessionId;this.shadow.innerHTML=this.getImageOnlyPopupContent(),this.popup=this.shadowRoot.getElementById("imageOnlyPopup"),this.container=this.shadowRoot.getElementById("container"),this.closeIcon=this.shadowRoot.getElementById("close"),this.popup.addEventListener("load",this.updateImageAndContainerWidth()),this.resizeObserver=new ResizeObserver((()=>this.handleResize(this.popup,this.container))),this.resizeObserver.observe(this.popup),this.closeIcon.addEventListener("click",(()=>{if(this.resizeObserver.unobserve(this.popup),document.getElementById("wzrkImageOnlyDiv").style.display="none",this.remove(),null!=e&&"-1"!==e&&ae._isLocalStorageSupported()){const i=Xe();let o=i.wp[t];null==o&&(o={},i[t]=o),o[e]="dnd",et(i)}})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId}),this.onClickUrl&&this.popup.addEventListener("click",(()=>{this.target.display.window?window.open(this.onClickUrl,"_blank"):window.parent.location.href=this.onClickUrl,window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})}))}handleResize(e,t){const i=this.getRenderedImageWidth(e);t.style.setProperty("width","".concat(i,"px"))}getImageOnlyPopupContent(){return"\n ".concat(this.target.msgContent.css,"\n ").concat(this.target.msgContent.html,"\n ")}updateImageAndContainerWidth(){return()=>{const e=this.getRenderedImageWidth(this.popup);this.popup.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("height","auto"),this.container.style.setProperty("position","fixed"),this.popup.style.setProperty("visibility","visible"),this.closeIcon.style.setProperty("visibility","visible"),document.getElementById("wzrkImageOnlyDiv").style.visibility="visible"}}getRenderedImageWidth(e){const t=e.naturalWidth/e.naturalHeight;return e.height*t}}class Rt extends HTMLElement{constructor(e,t){super(),this.wrapper=null,this.snackBar=null,this.shadow=this.attachShadow({mode:"open"}),this.config=e,this.message=t,this.renderMessage(t)}get pivotId(){return this.message.wzrk_pivot}get campaignId(){return this.message.wzrk_id}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}renderMessage(e){switch(this.wrapper=this.createEl("div","messageWrapper"),e.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":{const t=this.prepareBasicMessage(e.msg[0]);this.wrapper.appendChild(t)}}const t=this.createEl("div","timeStamp");if(t.innerHTML="".concat(Wt(e.id.split("_")[1]),""),!e.viewed){const e=this.createEl("span","unreadMarker");t.appendChild(e)}this.wrapper.appendChild(t),this.shadow.appendChild(this.wrapper)}prepareBasicMessage(e){const t=this.createEl("div","message");if(e.imageUrl){const i=this.addImage(e.imageUrl,"mainImg");t.appendChild(i)}const i=this.createEl("div","iconTitleDescWrapper");if(e.iconUrl){const t=this.addImage(e.iconUrl,"iconImg");i.appendChild(t)}const o=this.createEl("div","titleDescWrapper");if(e.title){const t=this.createEl("div","title");t.innerText=e.title,o.appendChild(t)}if(e.description){const t=this.createEl("div","description");t.innerText=e.description,o.appendChild(t)}if((e.title||e.description)&&i.appendChild(o),(e.iconUrl||e.title||e.description)&&t.appendChild(i),e.buttons&&e.buttons.length){const i=this.addButtons(e.buttons);t.appendChild(i)}return t}addButtons(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.createEl("div","buttonsContainer");let i=!1;return e.forEach(((e,o)=>{const n=this.createEl("button","button-".concat(o),"button");n.innerText=e.text,o>0&&(n.style.cssText+="margin-left: 2px;"),"copy"===e.action&&(i=!0),t.appendChild(n)})),i&&this.addSnackbar(t),t}addSnackbar(e){this.snackBar=this.createEl("div","snackbar-".concat(this.campaignId),"snackbar"),this.snackBar.innerHTML=Ht;const t=this.createEl("span","snackbar-msg-".concat(this.campaignId),"snackbar-msg");t.innerText="Copied to clipboard",this.snackBar.appendChild(t),e.appendChild(this.snackBar)}addImage(e,t){const i=this.createEl("div","".concat(t,"Container")),o=this.createEl("img",t);return o.setAttribute("src",e),o.setAttribute("loading","lazy"),i.appendChild(o),i}raiseClickedEvent(e,t){switch(this.message.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":this.raiseClickedForBasicTemplates(e,t)}}raiseClickedForBasicTemplates(e,t){const i=this.message.msg[0],o={msgId:this.campaignId,pivotId:this.pivotId};if("BUTTON"===e.tagName){const t=e.id.split("-")[1],n=i.buttons[t];o.kv={wzrk_c2a:n.text},"url"===n.action?n.openUrlInNewTab?window.open(n.url,"_blank"):window.location=n.url:"copy"===n.action&&(window.focus(),navigator.clipboard.writeText(n.clipboardText),this.snackBar.style.setProperty("display","flex","important"),setTimeout((()=>{this.snackBar.style.setProperty("display","none","important")}),2e3))}else"CT-INBOX-MESSAGE"===e.tagName&&i.onClickUrl&&(i.openUrlInNewTab?window.open(i.onClickUrl,"_blank"):window.location=i.onClickUrl);t?console.log("Notifiction clicked event will be raised at run time with payload ::",o):window.clevertap.renderNotificationClicked(o)}}class jt extends HTMLElement{constructor(e){super(),this.isInboxOpen=!1,this.isInboxFromFlutter=!1,this.selectedCategory=null,this.unviewedMessages={},this.unviewedCounter=0,this.isPreview=!1,this.inboxConfigForPreview={},this.inboxSelector=null,this.inbox=null,this.emptyInboxMsg=null,this.inboxCard=null,this.unviewedBadge=null,this.observer=null,this.selectedCategoryRef=null,this.addClickListenerOnDocument=(()=>e=>{if(e.composedPath().includes(this.inbox)){const t=e.path||e.composedPath&&e.composedPath();if(t.length){const e=t[0].id;if("closeInbox"===e)this.toggleInbox();else if(e.startsWith("category-"))this.prevCategoryRef=this.selectedCategoryRef,this.selectedCategoryRef=t[0],this.updateActiveCategory(t[0].innerText);else{const e=t.filter((e=>{var t;return(null===(t=e.id)||void 0===t?void 0:t.startsWith("button-"))||"CT-INBOX-MESSAGE"===e.tagName}));if(e.length){e[e.length-1].raiseClickedEvent(e[0],this.isPreview)}}}}else(this.inboxSelector.contains(e.target)||this.isInboxOpen)&&(this.isInboxFromFlutter?this.isInboxFromFlutter=!1:this.toggleInbox(e))})(),this.setBadgeStyle=e=>{null!==this.unviewedBadge&&(this.unviewedBadge.innerText=e>9?"9+":e,this.unviewedBadge.style.display=e>0?"flex":"none")},this.logger=e,this.shadow=this.attachShadow({mode:"open"})}get incomingMessages(){return[]}set incomingMessages(e){void 0===e&&(e=[]),e.length>0&&this.inbox&&this.updateInboxMessages(e)}get incomingMessagesForPreview(){return[]}set incomingMessagesForPreview(e){void 0===e&&(e=[]);const t={};e.length>0&&this.inbox&&(this.isPreview=!0,this.unviewedCounter=0,e.forEach((e=>{const i="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=i,t[i]=e,this.unviewedMessages[i]=e,this.unviewedCounter++})),this.buildUIForMessages(t),this.updateUnviewedBadgeCounter())}connectedCallback(){this.init()}init(){this.config=this.isPreview?this.inboxConfigForPreview:ae.readFromLSorCookie(q)||{},0!==Object.keys(this.config).length&&(this.inboxSelector=document.getElementById(this.config.inboxSelector),null!==this.inboxSelector&&(this.config.styles.notificationsBadge?this.addUnviewedBadge():this.unviewedBadge&&this.unviewedBadge.remove(),this.createinbox(),document.removeEventListener("click",this.addClickListenerOnDocument),document.addEventListener("click",this.addClickListenerOnDocument),this.config.categories.length&&this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadow.innerHTML=this.getInboxStyles(),this.shadow.appendChild(this.inbox)))}addMsgsToInboxFromLS(){const e=this.deleteExpiredAndGetUnexpiredMsgs(!1),t=e?Object.keys(e):[];0!==t.length&&(t.forEach((t=>{e[t].viewed||(this.unviewedMessages[t]=e[t],this.unviewedCounter++)})),this.buildUIForMessages(e),this.updateUnviewedBadgeCounter())}deleteExpiredAndGetUnexpiredMsgs(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Nt();const i=Math.floor(Date.now()/1e3);for(const o in t)if(t[o].wzrk_ttl&&t[o].wzrk_ttl>0&&t[o].wzrk_ttl0&&(t=Object.values(t).sort(((e,t)=>t.date-e.date)).reduce(((e,t)=>(e[t.id]=t,e)),{})),Ft(t),t}updateInboxMessages(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.deleteExpiredAndGetUnexpiredMsgs(),i=Date.now(),o={};e.forEach(((e,n)=>{const s="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=s,e.date=i-n,e.viewed=0,t[s]=e,o[s]=e,this.unviewedMessages[s]=e,this.unviewedCounter++})),Ft(t),this.buildUIForMessages(o),this.updateUnviewedBadgeCounter()}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}addUnviewedBadge(){this.unviewedBadge||(this.unviewedBadge=this.createEl("div","unviewedBadge"),this.unviewedBadge.style.cssText="display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ".concat(this.config.styles.notificationsBadge.backgroundColor,"; font-size: 12px; color: ").concat(this.config.styles.notificationsBadge.textColor,"; font-weight: bold; align-items: center; justify-content: center;"),document.body.appendChild(this.unviewedBadge)),this.updateUnviewedBadgePosition(),window.addEventListener("resize",(()=>{this.updateUnviewedBadgePosition()}))}updateUnviewedBadgePosition(){const{top:e,right:t}=this.inboxSelector.getBoundingClientRect();this.unviewedBadge.style.top="".concat(e-8,"px"),this.unviewedBadge.style.left="".concat(t-8,"px")}createinbox(){this.inbox=this.createEl("div","inbox");const e=this.createEl("div","header"),t=this.createEl("div","headerTitle");t.innerText=this.config.title;const i=this.createEl("div","closeInbox");if(i.innerHTML="×",e.appendChild(t),e.appendChild(i),this.inbox.appendChild(e),this.config.categories.length){const e=this.createCategories();this.inbox.appendChild(e)}this.inboxCard=this.createEl("div","inboxCard"),this.inbox.appendChild(this.inboxCard),this.emptyInboxMsg=this.createEl("div","emptyInboxMsg"),this.emptyInboxMsg.innerText="All messages will be displayed here.",this.inboxCard.appendChild(this.emptyInboxMsg);const o={root:this.inboxCard,rootMargin:"0px",threshold:.5};this.observer=new IntersectionObserver(((e,t)=>{this.handleMessageViewed(e)}),o),this.addMsgsToInboxFromLS()}createCategories(){const e=this.createEl("div","categoriesContainer"),t=this.createEl("div","leftArrow");t.innerHTML=Gt,t.children[0].style="transform: rotate(180deg)",t.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(-70,0)})),e.appendChild(t);const i=this.createEl("div","categoriesWrapper");["All",...this.config.categories].forEach(((e,t)=>{const o=this.createEl("div","category-".concat(t),"category");o.innerText=e,0===t&&(this.selectedCategoryRef=o),i.appendChild(o)})),e.appendChild(i);const o=this.createEl("div","rightArrow");o.innerHTML=Gt,o.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(70,0)})),e.appendChild(o);const n={root:e,threshold:.9},s=i.children[0],r=i.children[this.config.categories.length];new IntersectionObserver((e=>{this.categoryObserverCb(t,e[0].intersectionRatio>=.9)}),n).observe(s);return new IntersectionObserver((e=>{this.categoryObserverCb(o,e[0].intersectionRatio>=.9)}),n).observe(r),e}categoryObserverCb(e,t){e&&(e.style.display=t?"none":"flex")}updateActiveCategory(e){this.selectedCategory=e,this.inboxCard.scrollTop=0;let t=0;this.prevCategoryRef&&this.prevCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef.setAttribute("selected","true"),this.inboxCard.childNodes.forEach((e=>{"emptyInboxMsg"!==e.getAttribute("id")&&(e.style.display="All"===this.selectedCategory||e.getAttribute("category")===this.selectedCategory?"block":"none","block"===e.style.display&&t++)})),0===t?(this.emptyInboxMsg.innerText="".concat(e," messages will be displayed here."),this.emptyInboxMsg.style.display="block"):this.emptyInboxMsg.style.display="none"}buildUIForMessages(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!this.isPreview&&this.updateTSForRenderedMsgs(),this.inboxCard.scrollTop=0;const i=null!==(e=this.config.maxMsgsInInbox)&&void 0!==e?e:15,o=this.inboxCard.firstChild,n=Object.values(t).sort(((e,t)=>t.date-e.date)).map((e=>e.id));for(const e of n){const i=new Rt(this.config,t[e]);i.setAttribute("id",t[e].id),i.setAttribute("pivot",t[e].wzrk_pivot),i.setAttribute("part","ct-inbox-message"),this.config.categories.length>0?(i.setAttribute("category",t[e].tags[0]||""),i.style.display="All"===this.selectedCategory||t[e].category===this.selectedCategory?"block":"none"):i.style.display="block",this.inboxCard.insertBefore(i,o),this.observer.observe(i)}let s=this.inboxCard.querySelectorAll("ct-inbox-message").length;for(;s>i;){const e=this.inboxCard.querySelectorAll("ct-inbox-message");e.length>0&&e[e.length-1].remove(),s--}const r=this.inboxCard.querySelectorAll('ct-inbox-message[style*="display: block"]').length;this.emptyInboxMsg.style.display=r?"none":"block"}handleMessageViewed(e){const t=!this.isPreview;this.isInboxOpen&&e.forEach((e=>{e.isIntersecting&&this.unviewedMessages.hasOwnProperty(e.target.id)&&0===e.target.message.viewed&&(e.target.message.viewed=1,t?(window.clevertap.renderNotificationViewed({msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.updateMessageInLS(e.target.id,{...e.target.message,viewed:1}),setTimeout((()=>{e.target.shadowRoot.getElementById("unreadMarker").style.display="none"}),1e3)):console.log("Notifiction viewed event will be raised at run time with payload ::",{msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.unviewedCounter--,this.updateUnviewedBadgeCounter(),delete this.unviewedMessages[e.target.id])}))}updateMessageInLS(e,t){if(!this.isPreview){const i=Nt();i[e]=t,Ft(i)}}toggleInbox(e){this.isInboxOpen=!this.isInboxOpen,this.isInboxFromFlutter=!!(null==e?void 0:e.rect),this.isInboxOpen?(this.inboxCard.scrollTop=0,!this.isPreview&&this.deleteExpiredAndGetUnexpiredMsgs(),this.inbox.style.display="block",this.inbox.style.zIndex="2147483647",this.config.categories.length&&(this.selectedCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef=this.shadowRoot.getElementById("category-0"),this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadowRoot.getElementById("categoriesWrapper").scrollLeft-=this.shadowRoot.getElementById("categoriesWrapper").scrollWidth),this.setInboxPosition(e)):this.inbox.style.display="none"}setInboxPosition(e){const t=window.outerWidth,i=getComputedStyle(le.inbox),o=i.getPropertyValue("--inbox-top"),n=i.getPropertyValue("--inbox-bottom"),s=i.getPropertyValue("--inbox-left"),r=i.getPropertyValue("--inbox-right");if(t>481&&!(o||n||s||r)){const t=Vt(e,this.inbox.clientHeight,this.inbox.clientWidth),i=t.xPos,o=t.yPos;this.inbox.style.top=o+"px",this.inbox.style.left=i+"px"}}updateUnviewedBadgeCounter(){if(this.isPreview)return void this.setBadgeStyle(this.unviewedCounter);let e=0;this.inboxCard.querySelectorAll("ct-inbox-message").forEach((t=>{const i=Nt();i[t.id]&&0===i[t.id].viewed&&e++})),this.setBadgeStyle(e)}updateTSForRenderedMsgs(){this.inboxCard.querySelectorAll("ct-inbox-message").forEach((e=>{const t=e.id.split("_")[1];e.shadow.getElementById("timeStamp").firstChild.innerText=Wt(t)}))}getInboxStyles(){const e=this.config.categories.length?64:16,t={panelBackgroundColor:this.config.styles.panelBackgroundColor,panelBorderColor:this.config.styles.panelBorderColor,headerBackgroundColor:this.config.styles.header.backgroundColor,headerTitleColor:this.config.styles.header.titleColor,closeIconColor:this.config.styles.closeIconColor,categoriesTabColor:this.config.styles.categories.tabColor,categoriesTitleColor:this.config.styles.categories.titleColor,selectedCategoryTabColor:this.config.styles.categories.selectedTab.tabColor,selectedCategoryTitleColor:this.config.styles.categories.selectedTab.titleColor,headerCategoryHeight:36+e};this.config.styles.categories.borderColor&&(t.categoriesBorderColor=this.config.styles.categories.borderColor),this.config.styles.categories.selectedTab.borderColor&&(t.selectedCategoryBorderColor=this.config.styles.categories.selectedTab.borderColor);const i=(e=>{let{panelBackgroundColor:t,panelBorderColor:i,headerBackgroundColor:o,headerTitleColor:n,closeIconColor:s,categoriesTabColor:r,categoriesTitleColor:a,categoriesBorderColor:l,selectedCategoryTabColor:c,selectedCategoryTitleColor:d,selectedCategoryBorderColor:h,headerCategoryHeight:u}=e;return'\n \n ")})(t),o=this.config.styles.cards;return i+(e=>{let{backgroundColor:t,borderColor:i,titleColor:o,descriptionColor:n,buttonColor:s,buttonTextColor:r,unreadMarkerColor:a}=e;return'\n \n ")})({backgroundColor:o.backgroundColor,borderColor:o.borderColor,titleColor:o.titleColor,descriptionColor:o.descriptionColor,buttonColor:o.buttonColor,buttonTextColor:o.buttonTextColor,unreadMarkerColor:o.unreadMarkerColor})}}const Dt=e=>{e.inbox_preview?le.inbox.incomingMessagesForPreview=e.inbox_notifs:le.inbox.incomingMessages=e},zt=e=>{qt(),le.inbox=new jt({logger:e}),document.body.appendChild(le.inbox)},Bt=e=>{const t=ae.readFromLSorCookie(V)||{};if(Object.keys(t).length>0&&Object.keys(t)[0].includes("_")){const i={};return i[e]=t,ae.saveToLSorCookie(V,i),i}return t},Nt=()=>{const e=JSON.parse(decodeURIComponent(ae.read(b)));if(!X(e))return{};const t=Bt(e);return t.hasOwnProperty(e)?t[e]:{}},Ft=e=>{const t=JSON.parse(decodeURIComponent(ae.read(b)));if(!X(t))return;const i={...Bt(t),[t]:e};ae.saveToLSorCookie(V,i)},Ut=e=>new Promise(((t,i)=>{if("complete"===document.readyState)zt(e),t();else{const i=ae.readFromLSorCookie(q)||{},o=()=>{null===le.inbox&&zt(e),t()};window.addEventListener("load",(()=>{if(document.getElementById(i.inboxSelector))o();else{let n=0;if(n<20){const s=setInterval((()=>{document.getElementById(i.inboxSelector)?(o(),clearInterval(s),t()):n>=20&&(clearInterval(s),e.debug("Failed to add inbox")),n++}),500)}}}))}})),qt=()=>{void 0===customElements.get("ct-web-inbox")&&(customElements.define("ct-web-inbox",jt),customElements.define("ct-inbox-message",Rt))},Vt=(e,t,i)=>{const o=document.scrollingElement.scrollLeft,n=document.scrollingElement.scrollTop,s=window.innerWidth+o,r=window.innerHeight+n,a=e.rect||e.target.getBoundingClientRect(),l=a.x+o,c=a.y+n,d=a.left+o,h=a.right+o,u=a.top+n,p=a.bottom,g=a.height,f=a.width;let v,b,m=!1;const y=16;if(p+t<=r){const e=r-(p+t);b=e>=y?p+y:p+e}else if(u-t>=n){const e=u-t;b=e>=y?u-t-y:u-t-e}else m=!0,b=c+g/2-t/2,br&&(b=r-t);if(m){const e=h+i;if(e<=s){v=h+(e+y<=s?y:s-e)}else{const e=d-i;v=e-(e-y>=o?y:e-o)}}else v=l+f/2-i/2,vs&&(v=h-i>=o?h-i:s-i);return{xPos:v,yPos:b}},Wt=e=>{const t=Date.now();let i=Math.floor((t-e)/6e4);return i<5?"Just now":i<60?"".concat(i," minute").concat(i>1?"s":""," ago"):(i=Math.floor(i/60),i<24?"".concat(i," hour").concat(i>1?"s":""," ago"):(i=Math.floor(i/24),"".concat(i," day").concat(i>1?"s":""," ago")))},Kt=()=>Object.keys(ae.readFromLSorCookie(q)||{}).length>0,Gt='\n\n\n',Ht='\n\n\n',Jt=(e,t)=>{document.addEventListener("DOMContentLoaded",(()=>function(e,t){document.body.innerHTML="",Zt=document.createElement("div"),Zt.id="overlayDiv",Zt.style.position="relative",Zt.style.display="flex",document.body.appendChild(Zt);(function(e,t,i){return new Promise(((o,n)=>{var s=document.createElement("script");s.type="module",s.src=e,s.onload=function(){"function"==typeof window.Overlay?(window.Overlay("#overlayDiv",t,i),o()):n(new Error("ContentLayout not found in overlay.js"))},s.onerror=function(e){n(e)},document.head.appendChild(s)}))})("https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js",e,t).then((()=>{console.log("Overlay script loaded successfully.")})).catch((e=>{console.error("Error loading overlay script:",e)})),d=document.createElement("link"),d.rel="stylesheet",d.type="text/css",d.href="https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css",document.head.appendChild(d),o={kitId:"eqj6nom",scriptTimeout:3e3,async:!0},n=document,s=n.documentElement,r=setTimeout((function(){s.className=s.className.replace(/\bwf-loading\b/g,"")+" wf-inactive"}),o.scriptTimeout),a=n.createElement("script"),l=!1,c=n.getElementsByTagName("script")[0],s.className+=" wf-loading",a.src="https://use.typekit.net/"+o.kitId+".js",a.async=!0,a.onload=a.onreadystatechange=function(){if(i=this.readyState,!(l||i&&"complete"!==i&&"loaded"!==i)){l=!0,clearTimeout(r);try{Typekit.load(o)}catch(e){}}},c.parentNode.insertBefore(a,c);var i,o,n,s,r,a,l,c;var d}(e,t)))};let Zt;const $t=(e,t)=>{const i=e.display.details[0],o=Object.keys(i)[0],n=i[o];if(o===window.location.href)for(const i in n){const o=document.querySelector(i);if(o)n[i].html&&(o.outerHTML=n[i].html),t||window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot});else{let o=0;const s=setInterval((()=>{const r=document.querySelector(i);r?(n[i].html&&(r.outerHTML=n[i].html),t||window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot}),clearInterval(s)):(o++,o>=20&&(console.log("No element present on DOM with selector '".concat(i,"'.")),clearInterval(s)))}),500)}}},Yt=(e,t)=>{let{device:i,session:o,request:n,logger:s}=t;const r=i,a=o,l=n,c=s;let d=0;const h=t=>{const i=t.wzrk_id.split("_")[0],o=ie(),n=(e,t,i)=>{let o=0,n=0;null!=e[t]&&(o=e[t]),o++,null!=e.tc&&(n=e.tc),i<0&&n++,e.tc=n,e[t]=o};if(ae._isLocalStorageSupported()){delete sessionStorage.WZRK_CAMP;var s={};const e=Xe();s=3===t.display.wtarget_type&&e.hasOwnProperty("wi")?e.wi:0!==t.display.wtarget_type&&1!==t.display.wtarget_type||!e.hasOwnProperty("wp")?{}:e.wp,e.hasOwnProperty("global")&&(s.wp=e),null==t.display.wmc&&(t.display.wmc=1),null==t.display.wimc&&(t.display.wimc=1);var d=-1;let n=-1,r=-1,l=-1,c=-1,g=-1,f=-1;null!=t.display.efc&&(d=parseInt(t.display.efc,10)),null!=t.display.mdc&&(n=parseInt(t.display.mdc,10)),null!=t.display.tdc&&(r=parseInt(t.display.tdc,10)),null!=t.display.tlc&&(l=parseInt(t.display.tlc,10)),null!=t.display.wmp&&(c=parseInt(t.display.wmp,10)),null!=t.display.wmc&&(g=parseInt(t.display.wmc,10)),null!=t.display.wimc&&(f=parseInt(t.display.wimc,10));var h=s[a.sessionId];if(h){const e=h[i],o=h.tc;if("dnd"===e&&!le.dismissSpamControl)return!1;if(3===t.display.wtarget_type){if(f>0&&o>=f&&d<0)return!1}else if(g>0&&o>=g&&d<0)return!1;if(n>0&&e>=n)return!1}else h={},s[a.sessionId]=h;var u=s[o];if(null!=u){const e=u[i],t=u.tc;if(c>0&&t>=c&&d<0)return!1;if(r>0&&e>=r)return!1}else u={},s[o]=u;var p=s.global;if(null!=p){const e=p[i];if(l>0&&e>=l)return!1}else p={},s.global=p}if(null!=t.display.delay&&t.display.delay>0){const i=t.display.delay;return t.display.delay=0,setTimeout(Yt,1e3*i,e,{device:r,session:a,request:l,logger:c}),!1}n(h,i,d),n(u,i,d),n(p,i,d);let g="wp";3===t.display.wtarget_type&&(g="wi");const f={};f[a.sessionId]=h,f[o]=u,f.global=p,et({[g]:f})},u=()=>{const e=r.getGuid(),t=a.getSessionCookieObject();return"&t=wc&d="+encodeURIComponent(He(e+"|"+t.p+"|"+t.s))},p=(e,t)=>{const i=window.parent[e];"function"==typeof i&&(null!=t.display.kv?i(t.display.kv):i())},g=(e,t,i,o,n)=>{f(t),((e,t,i,o,n)=>{if(""!==e&&null!=e){let o,s;n?o=i:null!==i&&(s=i.getElementsByClassName("jsCT_CTA"),null!=s&&1===s.length&&(o=s[0]));const r=t.display.jsFunc,l=t.display.preview;null==l&&(e+=u()),null!=o&&(o.onclick=()=>{if(null!=r)return null==l&&Qe.fireRequest(e),p(r,t),void at("-1",0,a.sessionId);1===t.display.window?window.open(e,"_blank"):window.location=e})}})(e,t,i,0,n)},f=e=>{const t={type:"event"};t.evtName=R,t.evtData={[T]:e.wzrk_id},e.wzrk_pivot&&(t.evtData={...t.evtData,wzrk_pivot:e.wzrk_pivot}),l.processEvent(t)},v=e=>{var t;void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Lt);const i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,o=document.createElement("ct-web-personalisation-banner");o.msgId=e.wzrk_id,o.pivotId=e.wzrk_pivot,o.divHeight=e.display.divHeight,o.details=e.display.details[0];const n=e.display.divId?document.getElementById(i):document.querySelector(i);n.innerHTML="",n.appendChild(o)},m=e=>{var t;void 0===customElements.get("ct-web-personalisation-carousel")&&customElements.define("ct-web-personalisation-carousel",Mt);const i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,o=document.createElement("ct-web-personalisation-carousel");o.target=e;const n=e.display.divId?document.getElementById(i):document.querySelector(i);n.innerHTML="",n.appendChild(o)},y=e=>{const t=e.wzrk_id.split("_")[0],i=e.display;if(2===i.wtarget_type&&1===e.msgContent.type){const t={};t.msgId=e.wzrk_id,e.wzrk_pivot&&(t.pivotId=e.wzrk_pivot),null!=e.msgContent.kv&&(t.kv=e.msgContent.kv);const i=new CustomEvent("CT_web_native_display",{detail:t});return void document.dispatchEvent(i)}if(1===i.layout)return O(void 0,e);if(3===i.layout){const t="wzrkImageOnlyDiv";if(!1===h(e))return;if(le.dismissSpamControl&&null!=document.getElementById(t)){document.getElementById(t).remove()}if(null!=document.getElementById(t)||null!=document.getElementById("intentPreview"))return;const i=document.createElement("div");return i.id=t,document.body.appendChild(i),void 0===customElements.get("ct-web-popup-imageonly")&&customElements.define("ct-web-popup-imageonly",Tt),(e=>{const t=document.createElement("ct-web-popup-imageonly");t.session=a,t.target=e;const i=document.getElementById("wzrkImageOnlyDiv");i.innerHTML="",i.style.visibility="hidden",i.appendChild(t)})(e)}if(!1===h(e))return;const o="wizParDiv"+i.layout;if(le.dismissSpamControl&&null!=document.getElementById(o)){document.getElementById(o).remove()}if(null!=document.getElementById(o))return;le.campaignDivMap[t]=o;const n=2===i.layout,s=document.createElement("div");s.id=o;const r=window.innerHeight,l=window.innerWidth;let c=!1;if(n)s.setAttribute("style",i.iFrameStyle);else{var d=10;let e=5*l/100,t=d+5*r/100,o=30*l/100+20,n="width:30%;";(/mobile/i.test(navigator.userAgent)||/mini/i.test(navigator.userAgent))&&!1===/iPad/i.test(navigator.userAgent)?(o=85*l/100+20,e=5*l/100,t=5*r/100,n="width:80%;"):("ontouchstart"in window||/tablet/i.test(navigator.userAgent))&&(o=50*l/100+20,e=5*l/100,t=5*r/100,n="width:50%;"),null==i.proto?(c=!0,s.setAttribute("style","display:block;overflow:hidden; bottom:"+t+"px !important;width:"+o+"px !important;right:"+e+"px !important;position:fixed;z-index:2147483647;")):s.setAttribute("style",n+i.iFrameStyle)}document.body.appendChild(s);const u=document.createElement("iframe"),p=!1===i.br?"0":"8";u.frameborder="0px",u.marginheight="0px",u.marginwidth="0px",u.scrolling="no",u.id="wiz-iframe";const f=e.display.onClick;let v,b="";if(""!==f&&null!=f&&(b="cursor:pointer;"),1===e.msgContent.type)v=e.msgContent.html,v=v.replace(/##campaignId##/g,t),v=v.replace(/##campaignId_batchId##/g,e.wzrk_id);else{const i='";let n,s,r,a,l;"dark"===e.display.theme?(n="#2d2d2e",s="#eaeaea",r="#353535",a="#353535",l="#ffffff"):(n="#ffffff",s="#000000",a="#f4f4f4",r="#a5a6a6",l="#ffffff");const c=e.msgContent.title,d=e.msgContent.description;let h="";null!=e.msgContent.imageUrl&&""!==e.msgContent.imageUrl&&(h="");v=i+("
×
"+h+"
"+c+"
")+("
"+d+"
")}u.setAttribute("style","z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;"),s.appendChild(u);const m=(u.contentWindow?u.contentWindow:u.contentDocument.document?u.contentDocument.document:u.contentDocument).document,y=new Event("CT_campaign_rendered");document.dispatchEvent(y),m.open(),m.write(v),i["custom-editor"]&&k(e,m),m.close();const w=()=>{d=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv").scrollHeight,!0===i["custom-editor"]||n||(d+=25),document.getElementById("wiz-iframe").contentDocument.body.style.margin="0px",document.getElementById("wiz-iframe").style.height=d+"px"},C=navigator.userAgent.toLowerCase();if(-1!==C.indexOf("safari"))if(C.indexOf("chrome")>-1)u.onload=()=>{w();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)};else{let t=u.contentDocument||u.contentWindow;t.document&&(t=t.document),w();const i=setInterval((()=>{if("complete"===t.readyState){clearInterval(i),w();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)}}),10)}else u.onload=()=>{w();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)}},k=(e,t)=>{const i=t.createElement("script");i.innerHTML="\n const ct__camapignId = '".concat(e.wzrk_id,"';\n const ct__formatVal = (v) => {\n return v && v.trim().substring(0, 20);\n }\n const ct__parentOrigin = window.parent.origin;\n document.body.addEventListener('click', (event) => {\n const elem = event.target.closest?.('a[wzrk_c2a], button[wzrk_c2a]');\n if (elem) {\n const {innerText, id, name, value, href} = elem;\n const clickAttr = elem.getAttribute('onclick') || elem.getAttribute('click');\n const onclickURL = clickAttr?.match(/(window.open)[(](\"|')(.*)(\"|',)/)?.[3] || clickAttr?.match(/(location.href *= *)(\"|')(.*)(\"|')/)?.[3];\n const props = {innerText, id, name, value};\n let msgCTkv = Object.keys(props).reduce((acc, c) => {\n const formattedVal = ct__formatVal(props[c]);\n formattedVal && (acc['wzrk_click_' + c] = formattedVal);\n return acc;\n }, {});\n if(onclickURL) { msgCTkv['wzrk_click_' + 'url'] = onclickURL; }\n if(href) { msgCTkv['wzrk_click_' + 'c2a'] = href; }\n const notifData = { msgId: ct__camapignId, msgCTkv, pivotId: '").concat(e.wzrk_pivot,"' };\n window.parent.clevertap.renderNotificationClicked(notifData);\n }\n });\n "),t.body.appendChild(i)};let x=!1;const S=e=>{let t=e.display.onClick;if(window.clevertap.hasOwnProperty("notificationCallback")&&void 0!==window.clevertap.notificationCallback&&"function"==typeof window.clevertap.notificationCallback){const i=window.clevertap.notificationCallback;if(!x){const o={};o.msgContent=e.msgContent,o.msgId=e.wzrk_id,e.wzrk_pivot&&(o.pivotId=e.wzrk_pivot),null!=e.display.kv&&(o.kv=e.display.kv),window.clevertap.raiseNotificationClicked=()=>{if(""!==t&&null!=t){const i=e.display.jsFunc;if(t+=u(),null!=i)return Qe.fireRequest(t),void p(i,e);1===e.display.window?window.open(t,"_blank"):window.location=t}},window.clevertap.raiseNotificationViewed=()=>{f(e)},i(o),x=!0}}else if(window.clevertap.popupCurrentWzrkId=e.wzrk_id,y(e),window.clevertap.hasOwnProperty("popupCallbacks")&&void 0!==window.clevertap.popupCallbacks&&"function"==typeof window.clevertap.popupCallbacks[e.wzrk_id]){const t=window.clevertap.popupCallbacks[e.wzrk_id],n={};n.msgContent=e.msgContent,n.msgId=e.wzrk_id,e.wzrk_pivot&&(n.pivotId=e.wzrk_pivot);var i=[];for(var o in e)if(o.startsWith(M)&&o!==T){const t={[o]:e[o]};i.push(t)}i.length>0&&(n.msgCTkv=i),null!=e.display.kv&&(n.kv=e.display.kv),window.clevertap.raisePopupNotificationClicked=t=>{if(!t||!t.msgId)return;const i={type:"event"};if(i.evtName=j,i.evtData={[T]:t.msgId},e.wzrk_pivot&&(i.evtData={...i.evtData,wzrk_pivot:t.pivotId}),t.msgCTkv)for(var o of t.msgCTkv)i.evtData={...i.evtData,...o};l.processEvent(i)},t(n)}};let I;const O=(e,t)=>{let i;if(null!=e&&e.clientY>0)return;if(i=null==t?I:t,le.dismissSpamControl&&0===i.display.wtarget_type&&null!=document.getElementById("intentPreview")&&null!=document.getElementById("intentOpacityDiv")){document.getElementById("intentPreview").remove(),document.getElementById("intentOpacityDiv").remove()}if(null!=document.getElementById("intentPreview")||null!=document.getElementById("wzrkImageOnlyDiv"))return;if(null==i.display.layout&&(/mobile/i.test(navigator.userAgent)||/mini/i.test(navigator.userAgent)||/iPad/i.test(navigator.userAgent)||"ontouchstart"in window||/tablet/i.test(navigator.userAgent)))return;if(!1===h(i))return;const o=i.wzrk_id.split("_")[0];le.campaignDivMap[o]="intentPreview";let n=!1;const s=document.createElement("div");s.id="intentOpacityDiv";const r=i.display.opacity||.7,a="rgba(0,0,0,".concat(r,")");s.setAttribute("style","position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ".concat(a,";")),document.body.appendChild(s);const l=document.createElement("div");l.id="intentPreview",null==i.display.proto?(n=!0,l.setAttribute("style","display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;")):l.setAttribute("style",i.display.iFrameStyle),document.body.appendChild(l);const c=document.createElement("iframe"),d=!1===i.display.br?"0":"8";c.frameborder="0px",c.marginheight="0px",c.marginwidth="0px",c.scrolling="no",c.id="wiz-iframe-intent";const u=i.display.onClick;let p,f="";if(""!==u&&null!=u&&(f="cursor:pointer;"),1===i.msgContent.type)p=i.msgContent.html,p=p.replace(/##campaignId##/g,o),p=p.replace(/##campaignId_batchId##/g,i.wzrk_id);else{const e='";let t,n,s,r;"dark"===i.display.theme?(t="#2d2d2e",n="#eaeaea",s="#353535",r="#ffffff"):(t="#ffffff",n="#000000",s="#a5a6a6",r="#ffffff");const a=i.msgContent.title,l=i.msgContent.description;let c="";null!=i.msgContent.ctaText&&""!==i.msgContent.ctaText&&(c="");let h="";null!=i.msgContent.imageUrl&&""!==i.msgContent.imageUrl&&(h="
+a+
");p=e+("
×
"+a+"
")+("
"+l+"
"+h+c+"
")}c.setAttribute("style","z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;"),l.appendChild(c);const v=(c.contentWindow?c.contentWindow:c.contentDocument.document?c.contentDocument.document:c.contentDocument).document,b=new Event("CT_campaign_rendered");document.dispatchEvent(b),v.open(),v.write(p),i.display["custom-editor"]&&k(i,v),v.close();const m=document.getElementById("wiz-iframe-intent").contentDocument.getElementById("contentDiv");g(u,i,m,0,n)};if(!document.body)return void(d<6&&(d++,setTimeout(Yt,1e3,e,{device:r,session:a,request:l,logger:c})));const _=e=>{Object.keys(e).map((t=>{var i,o;e[t].display.divId?(i=e[t].display.divId,o=document.getElementById(i)):(i=e[t].display.divSelector,o=document.querySelector(i)),null!==o&&(2===e[t].msgContent.type?v(e[t]):m(e[t]),delete e[t])}))};if(null!=e.inapp_notifs){const t={};for(let i=0;i{window.addEventListener("load",(()=>{let t=0;if(t<20){const i=setInterval((()=>{_(e),0!==Object.keys(e).length&&20!==t||(clearInterval(i),e={}),t++}),500)}}))})(t))}const E=()=>{if(e.inbox_preview)Dt(e);else if(e.inbox_notifs){const t=[];for(let i=0;i1&&void 0!==arguments[1]&&arguments[1];const i=ae.readFromLSorCookie(q)||{};t?(le.inbox.inboxConfigForPreview=e,le.inbox.isPreview=!0,le.inbox&&le.inbox.init()):JSON.stringify(i)!==JSON.stringify(e)&&(ae.saveToLSorCookie(q,e),le.inbox&&le.inbox.init())}(e.webInboxSetting),Ut(c).then((()=>{E()})).catch((e=>{}))):E()),e.vars)return void le.variableStore.mergeVariables(e.vars);const A=(e,t)=>{const i=Xe(),o=i[t].global;if(null!=o&&t)for(const i in e)if(e.hasOwnProperty(i)&&(delete o[e[i]],ae.read(w))){const o=JSON.parse(decodeURIComponent(ae.read(w))),n=JSON.parse(decodeURIComponent(ae.read(b)));o[n]&&o[n][t]&&o[n][t][e[i]]&&(delete o[n][t][e[i]],ae.save(w,encodeURIComponent(JSON.stringify(o))))}et(i)};if(ae._isLocalStorageSupported())try{if(null!=e.evpr){const t=e.evpr.events,i=e.evpr.profile,o=e.evpr.expires_in,n=oe();ae.setMetaProp("lsTime",n),ae.setMetaProp("exTs",o),(e=>{if(null!=le.globalEventsMap||(le.globalEventsMap=ae.readFromLSorCookie(C),null!=le.globalEventsMap)){for(const t in e)if(e.hasOwnProperty(t)){const i=le.globalEventsMap[t],o=e[t];null!=le.globalEventsMap[t]?null!=o[0]&&o[0]>i[0]&&(le.globalEventsMap[t]=o):le.globalEventsMap[t]=o}}else le.globalEventsMap=e})(t),ae.saveToLSorCookie(C,le.globalEventsMap),null==le.globalProfileMap?rt(i,!0):rt(i,!1)}null!=e.arp&&(e=>{if(null!=e.skipResARP&&e.skipResARP)return console.debug("Update ARP Request rejected",e),null;const t=!0===e.isOUL;if(ae._isLocalStorageSupported())try{let i=ae.readFromLSorCookie(P);if(null==i||t){i={};for(const t in e)e.hasOwnProperty(t)&&(-1===e[t]?delete i[t]:i[t]=e[t]);ae.saveToLSorCookie(P,i)}}catch(e){console.error("Unable to parse ARP JSON: "+e)}})(e.arp),null!=e.inapp_stale&&e.inapp_stale.length>0&&A(e.inapp_stale,"wp"),null!=e.inbox_stale&&e.inbox_stale.length>0&&A(e.inbox_stale,"wi")}catch(e){c.error("Unable to persist evrp/arp: "+e)}};var Qt=t("isPersonalisationActive");class Xt{constructor(e){let{isPersonalisationActive:t}=e;Object.defineProperty(this,Qt,{writable:!0,value:void 0}),i(this,Qt)[Qt]=t}getTotalVisits(){if(!i(this,Qt)[Qt]())return;let e=ae.getMetaProp("sc");return null==e&&(e=1),e}getLastVisit(){if(!i(this,Qt)[Qt]())return;const e=ae.getMetaProp("ps");return null!=e?new Date(1e3*e):void 0}}const ei=1,ti=2,ii=3,oi=4;var ni=t("logLevel"),si=t("log"),ri=t("isLegacyDebug");class ai{constructor(e){Object.defineProperty(this,ri,{get:ci,set:void 0}),Object.defineProperty(this,si,{value:li}),Object.defineProperty(this,ni,{writable:!0,value:void 0}),this.wzrkError={},i(this,ni)[ni]=null==e?e:ti,this.wzrkError={}}get logLevel(){return i(this,ni)[ni]}set logLevel(e){i(this,ni)[ni]=e}error(e){i(this,ni)[ni]>=ei&&i(this,si)[si]("error",e)}info(e){i(this,ni)[ni]>=ti&&i(this,si)[si]("log",e)}debug(e){(i(this,ni)[ni]>=ii||i(this,ri)[ri])&&i(this,si)[si]("debug",e)}debugPE(e){i(this,ni)[ni]>=oi&&i(this,si)[si]("debug_pe",e)}reportError(e,t){this.wzrkError.c=e,this.wzrkError.d=t,this.error("".concat(Ce," ").concat(e,": ").concat(t))}}var li=function(e,t){if(window.console)try{const i=(new Date).getTime();console[e]("CleverTap [".concat(i,"]: ").concat(t))}catch(e){}},ci=function(){return"undefined"!=typeof sessionStorage&&""===sessionStorage.WZRK_D},di=t("logger"),hi=t("sessionId"),ui=t("isPersonalisationActive");class pi{constructor(e){let{logger:t,isPersonalisationActive:o}=e;Object.defineProperty(this,di,{writable:!0,value:void 0}),Object.defineProperty(this,hi,{writable:!0,value:void 0}),Object.defineProperty(this,ui,{writable:!0,value:void 0}),this.cookieName=void 0,this.scookieObj=void 0,this.sessionId=ae.getMetaProp("cs"),i(this,di)[di]=t,i(this,ui)[ui]=o}get sessionId(){return i(this,hi)[hi]}set sessionId(e){i(this,hi)[hi]=e}getSessionCookieObject(){let e=ae.readCookie(this.cookieName),t={};if(null!=e)if(e=e.replace(p,'"'),t=JSON.parse(e),J(t)){if(void 0!==t.t){const e=t.t;oe()-e>1260&&(t={})}}else t={};return this.scookieObj=t,t}setSessionCookieObject(e){const t=JSON.stringify(e);ae.createBroadCookie(this.cookieName,t,1200,We())}manageSession(e){if(void 0===this.sessionId||this.sessionId!==e){const t=ae.getMetaProp("cs");if(void 0===t)ae.setMetaProp("ps",e),ae.setMetaProp("cs",e),ae.setMetaProp("sc",1);else if(t!==e){ae.setMetaProp("ps",t),ae.setMetaProp("cs",e);let i=ae.getMetaProp("sc");void 0===i&&(i=0),ae.setMetaProp("sc",i+1)}this.sessionId=e}}getTimeElapsed(){if(!i(this,ui)[ui]())return;null!=this.scookieObj&&(this.scookieObj=this.getSessionCookieObject());const e=this.scookieObj.s;if(null!=e){const t=oe();return Math.floor(t-e)}}getPageCount(){if(i(this,ui)[ui]())return null!=this.scookieObj&&(this.scookieObj=this.getSessionCookieObject()),this.scookieObj.p}}let gi=0,fi=0;var vi=t("logger"),bi=t("account"),mi=t("device"),yi=t("session"),wi=t("isPersonalisationActive"),Ci=t("clearCookie"),ki=t("addToLocalEventMap");class xi{constructor(e){let{logger:t,account:o,device:n,session:s,isPersonalisationActive:r}=e;Object.defineProperty(this,ki,{value:Pi}),Object.defineProperty(this,vi,{writable:!0,value:void 0}),Object.defineProperty(this,bi,{writable:!0,value:void 0}),Object.defineProperty(this,mi,{writable:!0,value:void 0}),Object.defineProperty(this,yi,{writable:!0,value:void 0}),Object.defineProperty(this,wi,{writable:!0,value:void 0}),Object.defineProperty(this,Ci,{writable:!0,value:!1}),this.processingBackup=!1,i(this,vi)[vi]=t,i(this,bi)[bi]=o,i(this,mi)[mi]=n,i(this,yi)[yi]=s,i(this,wi)[wi]=r,Qe.logger=t,Qe.device=n,Qe.account=o}processBackupEvents(){const e=ae.readFromLSorCookie(S);if(null!=e){this.processingBackup=!0;for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];void 0===o.fired&&(i(this,vi)[vi].debug("Processing backup event : "+o.q),void 0!==o.q&&Qe.fireRequest(o.q),o.fired=!0)}ae.saveToLSorCookie(S,e),this.processingBackup=!1}}addSystemDataToObject(e,t){void 0===t&&(e=ee(e,i(this,vi)[vi])),$(i(this,vi)[vi].wzrkError)||(e.wzrk_error=i(this,vi)[vi].wzrkError,i(this,vi)[vi].wzrkError={}),e.id=i(this,bi)[bi].id,X(i(this,mi)[mi].gcookie)&&(e.g=i(this,mi)[mi].gcookie);const o=i(this,yi)[yi].getSessionCookieObject();e.s=o.s,e.pg=void 0===o.p?1:o.p;let n=document.location.protocol;return n=n.replace(":",""),e.af={lib:"web-sdk-v1.7.3",protocol:n,...le.flutterVersion},sessionStorage.hasOwnProperty("WZRK_D")&&(e.debug=!0),e}addFlags(e){if(i(this,Ci)[Ci]=ae.getAndClearMetaProp(g),void 0!==i(this,Ci)[Ci]&&i(this,Ci)[Ci]&&(e.rc=!0,i(this,vi)[vi].debug("reset cookie sent in request and cleared from meta for future requests.")),i(this,wi)[wi]()){const t=ae.getMetaProp("lsTime"),i=ae.getMetaProp("exTs");if(void 0===t||void 0===i)return void(e.dsync=!0);t+i{if(e.ok)return e.json();throw e})).then((e=>(i(this,vi)[vi].debug("Sync data successful",e),e))).catch((e=>{throw i(this,vi)[vi].debug("Error in syncing variables",e),e}))}}var Pi=function(e){if(ae._isLocalStorageSupported()){void 0===le.globalEventsMap&&(le.globalEventsMap=ae.readFromLSorCookie(C),void 0===le.globalEventsMap&&(le.globalEventsMap={}));const t=oe();let i=le.globalEventsMap[e];void 0!==i?(i[2]=t,i[0]++):(i=[],i.push(1),i.push(t),i.push(t)),le.globalEventsMap[e]=i,ae.saveToLSorCookie(C,le.globalEventsMap)}},Si=t("request"),Ii=t("account"),Oi=t("oldValues"),_i=t("logger"),Ei=t("processPrivacyArray");class Ai extends Array{constructor(e,t){let{request:o,account:n,logger:s}=e;super(),Object.defineProperty(this,Ei,{value:Li}),Object.defineProperty(this,Si,{writable:!0,value:void 0}),Object.defineProperty(this,Ii,{writable:!0,value:void 0}),Object.defineProperty(this,Oi,{writable:!0,value:void 0}),Object.defineProperty(this,_i,{writable:!0,value:void 0}),i(this,_i)[_i]=s,i(this,Si)[Si]=o,i(this,Ii)[Ii]=n,i(this,Oi)[Oi]=t}push(){for(var e=arguments.length,t=new Array(e),o=0;o0?le.privacyArray:t):le.privacyArray.push(...t),0}_processOldValues(){i(this,Oi)[Oi]&&i(this,Ei)[Ei](i(this,Oi)[Oi]),i(this,Oi)[Oi]=null}}var Li=function(e){if(Array.isArray(e)&&e.length>0){const o=e.reduce(((e,t)=>({...e,...t})),{});let n={};const s={};var t=!1;if(o.hasOwnProperty(O)&&"boolean"==typeof(t=o.optOut)&&(s.ct_optout=t,le.isOptInRequest=!t),o.hasOwnProperty(_)){const e=o.useIP,t="boolean"==typeof e&&e;ae.setMetaProp(_,t)}if(!$(s)){n.type="profile",n.profile=s,n=i(this,Si)[Si].addSystemDataToObject(n,void 0);const o=Ke(JSON.stringify(n),i(this,_i)[_i]);let r=i(this,Ii)[Ii].dataPostURL;r=Ve(r,"type",A),r=Ve(r,"d",o),r=Ve(r,O,t?"true":"false"),i(this,Si)[Si].saveAndFireRequest(r,le.blockRequest),e.splice(0,e.length)}}},Mi=t("oldValues"),Ti=t("logger"),Ri=t("request"),ji=t("account"),Di=t("wizAlertJSPath"),zi=t("fcmPublicKey"),Bi=t("setUpWebPush"),Ni=t("setUpWebPushNotifications"),Fi=t("setApplicationServerKey"),Ui=t("setUpSafariNotifications"),qi=t("setUpChromeFirefoxNotifications"),Vi=t("addWizAlertJS"),Wi=t("removeWizAlertJS"),Ki=t("handleNotificationRegistration");class Gi extends Array{constructor(e,t){let{logger:o,session:n,request:s,account:r}=e;super(),Object.defineProperty(this,Ki,{value:eo}),Object.defineProperty(this,Wi,{value:Xi}),Object.defineProperty(this,Vi,{value:Qi}),Object.defineProperty(this,qi,{value:Yi}),Object.defineProperty(this,Ui,{value:$i}),Object.defineProperty(this,Fi,{value:Zi}),Object.defineProperty(this,Ni,{value:Ji}),Object.defineProperty(this,Bi,{value:Hi}),Object.defineProperty(this,Mi,{writable:!0,value:void 0}),Object.defineProperty(this,Ti,{writable:!0,value:void 0}),Object.defineProperty(this,Ri,{writable:!0,value:void 0}),Object.defineProperty(this,ji,{writable:!0,value:void 0}),Object.defineProperty(this,Di,{writable:!0,value:void 0}),Object.defineProperty(this,zi,{writable:!0,value:void 0}),i(this,Di)[Di]="https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js",i(this,zi)[zi]=null,i(this,Mi)[Mi]=t,i(this,Ti)[Ti]=o,i(this,Ri)[Ri]=s,i(this,ji)[ji]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o0?i(this,Ki)[Ki](e):null==le.webPushEnabled&&e.length>0?(le.notifApi.notifEnabledFromApi=!0,le.notifApi.displayArgs=e.slice()):!1===le.webPushEnabled&&e.length>0&&i(this,Ti)[Ti].error("Make sure push notifications are fully enabled and integrated")},Ji=function(e,t,o,n){-1!==navigator.userAgent.indexOf("Chrome")||-1!==navigator.userAgent.indexOf("Firefox")?i(this,qi)[qi](e,t):-1!==navigator.userAgent.indexOf("Safari")&&i(this,Ui)[Ui](e,o,n)},Zi=function(e){i(this,zi)[zi]=e},$i=function(e,t,o){void 0===t&&i(this,Ti)[Ti].error("Ensure that APNS Web Push ID is supplied"),void 0===o&&i(this,Ti)[Ti].error("Ensure that APNS Web Push service path is supplied"),"safari"in window&&"pushNotification"in window.safari&&window.safari.pushNotification.requestPermission(o,t,{},(e=>{if("granted"===e.permission){const t=JSON.parse(JSON.stringify(e));t.endpoint=e.deviceToken,t.browser="Safari",ae.saveToLSorCookie(z,t),i(this,Ri)[Ri].registerToken(t),i(this,Ti)[Ti].info("Safari Web Push registered. Device Token: "+e.deviceToken)}else"denied"===e.permission&&i(this,Ti)[Ti].info("Error subscribing to Safari web push")}))},Yi=function(e,t){let o="";"serviceWorker"in navigator&&navigator.serviceWorker.register(t).then((e=>{if("undefined"!=typeof __wzrk_account_id)return new Promise((t=>setTimeout((()=>t(e)),5e3)));o=e.scope;return/^(\.?)(\/?)([^/]*).js$/.test(t)?navigator.serviceWorker.ready:-1!==navigator.userAgent.indexOf("Chrome")?new Promise((t=>setTimeout((()=>t(e)),5e3))):navigator.serviceWorker.getRegistrations()})).then((t=>{-1!==navigator.userAgent.indexOf("Firefox")&&Array.isArray(t)&&(t=t.filter((e=>e.scope===o))[0]);const n={userVisibleOnly:!0};null!=i(this,zi)[zi]&&(n.applicationServerKey=(e=>{let t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),i=window.atob(t),o=[];for(let e=0;e{i(this,Ti)[Ti].info("Service Worker registered. Endpoint: "+t.endpoint);const o=JSON.parse(JSON.stringify(t));-1!==navigator.userAgent.indexOf("Chrome")?(o.endpoint=o.endpoint.split("/").pop(),o.browser="Chrome"):-1!==navigator.userAgent.indexOf("Firefox")&&(o.endpoint=o.endpoint.split("/").pop(),o.browser="Firefox"),ae.saveToLSorCookie(z,o),i(this,Ri)[Ri].registerToken(o),void 0!==e&&"function"==typeof e&&e()})).catch((e=>{i(this,Ti)[Ti].error("Error subscribing: "+e),t.pushManager.getSubscription().then((e=>{null!==e&&e.unsubscribe().then((e=>{i(this,Ti)[Ti].info("Unsubscription successful")})).catch((e=>{i(this,Ti)[Ti].error("Error unsubscribing: "+e)}))}))}))})).catch((e=>{i(this,Ti)[Ti].error("error registering service worker: "+e)}))},Qi=function(){const e=document.createElement("script");return e.setAttribute("type","text/javascript"),e.setAttribute("id","wzrk-alert-js"),e.setAttribute("src",i(this,Di)[Di]),document.getElementsByTagName("body")[0].appendChild(e),e},Xi=function(){const e=document.getElementById("wzrk-alert-js");e.parentNode.removeChild(e)},eo=function(e){let t,o,n,s,r,a,l,c,d,h,u,p,g,f,v;if(1===e.length){if(J(e[0])){const i=e[0];t=i.titleText,o=i.bodyText,n=i.okButtonText,s=i.rejectButtonText,r=i.okButtonColor,a=i.skipDialog,l=i.askAgainTimeInSeconds,c=i.okCallback,d=i.rejectCallback,h=i.subscriptionCallback,u=i.serviceWorkerPath,p=i.httpsPopupPath,g=i.httpsIframePath,f=i.apnsWebPushId,v=i.apnsWebPushServiceUrl}}else t=e[0],o=e[1],n=e[2],s=e[3],r=e[4],a=e[5],l=e[6];if(null==a&&(a=!1),null==u&&(u="/clevertap_sw.js"),void 0===navigator.serviceWorker)return;const b=null!=p&&null!=g;if("https:"!==window.location.protocol&&"localhost"!==document.location.hostname&&!b)return void i(this,Ti)[Ti].error("Make sure you are https or localhost to register for notifications");if(-1!==navigator.userAgent.indexOf("Chrome")){const e=navigator.userAgent.match(/Chrome\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}else if(-1!==navigator.userAgent.indexOf("Firefox")){const e=navigator.userAgent.match(/Firefox\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}else{if(-1===navigator.userAgent.indexOf("Safari"))return;{const e=navigator.userAgent.match(/Safari\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}}if(!b){if(null==Notification)return;if("granted"===Notification.permission)return void i(this,Ni)[Ni](h,u,f,v);if("denied"===Notification.permission)return;if(a)return void i(this,Ni)[Ni](h,u,f,v)}if(!(t&&o&&n&&s))return void i(this,Ti)[Ti].error("Missing input parameters; please specify title, body, ok button and cancel button text");null!=r&&r.match(/^#[a-f\d]{6}$/i)||(r="#f28046");const m=(new Date).getTime()/1e3;if(null==ae.getMetaProp("notif_last_time"))ae.setMetaProp("notif_last_time",m);else{if(null==l&&(l=604800),m-ae.getMetaProp("notif_last_time"){if(null!=e.data){let a={};try{a=JSON.parse(e.data)}catch(e){return}null!=a.state&&"ct"===a.from&&"not"===a.state&&(i(this,Vi)[Vi]().onload=()=>{window.wzrkPermissionPopup.wizAlert({title:t,body:o,confirmButtonText:n,confirmButtonColor:r,rejectButtonText:s},(e=>{e?("function"==typeof c&&c(),window.open(p)):"function"==typeof d&&d(),i(this,Wi)[Wi]()}))})}}),!1)}else i(this,Vi)[Vi]().onload=()=>{window.wzrkPermissionPopup.wizAlert({title:t,body:o,confirmButtonText:n,confirmButtonColor:r,rejectButtonText:s},(e=>{e?("function"==typeof c&&c(),i(this,Ni)[Ni](h,u,f,v)):"function"==typeof d&&d(),i(this,Wi)[Wi]()}))}},to=t("variableStore");class io{constructor(e){let{variableStore:t}=e;Object.defineProperty(this,to,{writable:!0,value:void 0}),this.name=null,this.defaultValue=null,this.value=null,this.type=null,this.hadStarted=!1,this.valueChangedCallbacks=[],i(this,to)[to]=t}getValue(){return this.value}getdefaultValue(){return this.defaultValue}static define(e,t,i){if(!e||"string"!=typeof e)return console.error("Empty or invalid name parameter provided."),null;if(e.startsWith(".")||e.endsWith("."))return console.error("Variable name starts or ends with a `.` which is not allowed: "+e),null;const o=typeof t;if("string"!==o&&"number"!==o&&"boolean"!==o)return console.error("Only primitive types (string, number, boolean) are accepted as value"),null;const n=i.getVariable(e);if(n)return n;const s=new io({variableStore:i});try{s.name=e,s.defaultValue=t,s.value=t,s.type=o,i.registerVariable(s),s.update(t)}catch(e){console.error(e)}return s}update(e){const t=this.value;this.value=e,null===e&&null===t||null!==e&&e===t&&this.hadStarted||i(this,to)[to].hasVarsRequestCompleted()&&(this.hadStarted=!0,this.triggerValueChanged())}triggerValueChanged(){this.valueChangedCallbacks.forEach((e=>{e(this)}))}addValueChangedCallback(e){e?(this.valueChangedCallbacks.push(e),i(this,to)[to].hasVarsRequestCompleted()&&e(this)):console.log("Invalid callback parameter provided.")}removeValueChangedCallback(e){const t=this.valueChangedCallbacks.indexOf(e);-1!==t&&this.valueChangedCallbacks.splice(t,1)}clearStartFlag(){this.hadStarted=!1}}var oo=t("logger"),no=t("account"),so=t("request"),ro=t("event"),ao=t("variables"),lo=t("remoteVariables"),co=t("fetchCallback"),ho=t("variablesChangedCallbacks"),uo=t("oneTimeVariablesChangedCallbacks"),po=t("hasVarsRequestCompleted"),go=t("runVariablesChangedCallback");class fo{constructor(e){let{logger:t,request:o,account:n,event:s}=e;Object.defineProperty(this,go,{value:vo}),Object.defineProperty(this,oo,{writable:!0,value:void 0}),Object.defineProperty(this,no,{writable:!0,value:void 0}),Object.defineProperty(this,so,{writable:!0,value:void 0}),Object.defineProperty(this,ro,{writable:!0,value:void 0}),Object.defineProperty(this,ao,{writable:!0,value:void 0}),Object.defineProperty(this,lo,{writable:!0,value:void 0}),Object.defineProperty(this,co,{writable:!0,value:void 0}),Object.defineProperty(this,ho,{writable:!0,value:void 0}),Object.defineProperty(this,uo,{writable:!0,value:void 0}),Object.defineProperty(this,po,{writable:!0,value:!1}),i(this,oo)[oo]=t,i(this,no)[no]=n,i(this,so)[so]=o,i(this,ro)[ro]=s,i(this,ao)[ao]={},i(this,lo)[lo]={},i(this,ho)[ho]=[],i(this,uo)[uo]=[],le.variableStore=this}registerVariable(e){const{name:t}=e;i(this,ao)[ao][t]=e,console.log("registerVariable",i(this,ao)[ao])}getVariable(e){return i(this,ao)[ao][e]}hasVarsRequestCompleted(){return i(this,po)[po]}syncVariables(e,t){if(!i(this,no)[no].token){const e="Account token is missing.";return i(this,oo)[oo].error(e),Promise.reject(new Error(e))}const o={type:"varsPayload",vars:{}};for(const e in i(this,ao)[ao])o.vars[e]={defaultValue:i(this,ao)[ao][e].defaultValue,type:i(this,ao)[ao][e].type};if(0===Object.keys(o.vars).length){const e="No variables are defined.";return i(this,oo)[oo].error(e),Promise.reject(new Error(e))}let n={};n=i(this,so)[so].addSystemDataToObject(n,void 0),n.tk=i(this,no)[no].token,n.type="meta";const s=JSON.stringify([n,o]),r=i(this,no)[no].dataPostPEURL;return i(this,so)[so].post(r,s).then((t=>(e&&"function"==typeof e&&e(t),t))).catch((e=>{throw t&&"function"==typeof t&&t(e),400===e.status?i(this,oo)[oo].error("Invalid sync payload or clear the existing draft"):401===e.status?i(this,oo)[oo].error("This is not a test profile"):i(this,oo)[oo].error("Sync variable failed"),e}))}fetchVariables(e){i(this,ro)[ro].push(K,{t:4}),e&&"function"==typeof e&&(i(this,co)[co]=e)}mergeVariables(e){console.log("msg vars is ",e),i(this,po)[po]=!0,ae.saveToLSorCookie("WZRK_PE",e),i(this,lo)[lo]=e;for(const t in i(this,ao)[ao])e.hasOwnProperty(t)&&i(this,ao)[ao][t].update(e[t]);i(this,co)[co]&&i(this,co)[co](),i(this,go)[go]()}addVariablesChangedCallback(e){e&&"function"==typeof e?(i(this,ho)[ho].push(e),this.hasVarsRequestCompleted()&&e()):i(this,oo)[oo].error("callback is not a function")}addOneTimeVariablesChangedCallback(e){e&&"function"==typeof e&&(this.hasVarsRequestCompleted()?e():i(this,uo)[uo].push(e))}removeVariablesChangedCallback(e){const t=i(this,ho)[ho].indexOf(e);-1!==t&&i(this,ho)[ho].splice(t,1)}removeOneTimeVariablesChangedCallback(e){const t=i(this,uo)[uo].indexOf(e);-1!==t&&i(this,uo)[uo].splice(t,1)}}var vo=function(){for(var e of i(this,ho)[ho])e();for(var t of i(this,uo)[uo])t();i(this,uo)[uo].length=0},bo=t("logger"),mo=t("api"),yo=t("onloadcalled"),wo=t("device"),Co=t("session"),ko=t("account"),xo=t("request"),Po=t("variableStore"),So=t("isSpa"),Io=t("previousUrl"),Oo=t("boundCheckPageChanged"),_o=t("dismissSpamControl"),Eo=t("processOldValues"),Ao=t("debounce"),Lo=t("checkPageChanged"),Mo=t("handleMessageEvent"),To=t("pingRequest"),Ro=t("isPingContinuous"),jo=t("overrideDSyncFlag");var Do=function(){this.onUserLogin._processOldValues(),this.privacy._processOldValues(),this.event._processOldValues(),this.profile._processOldValues(),this.notifications._processOldValues()},zo=function(e){let t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300;return function(){clearTimeout(t),t=setTimeout(e,i)}},Bo=function(){i(this,Ao)[Ao]((()=>{i(this,Io)[Io]!==location.href&&this.pageChanged()}))()},No=function(e){var t;e.data&&e.data.message&&("Dashboard"===e.data.message&&e.data.url?Jt(e.data.url,null!==(t=e.data.variant)&&void 0!==t?t:null):"Overlay"===e.data.message&&$t(e.data,!0))},Fo=function(){let e=i(this,ko)[ko].dataPostURL,t={};t=i(this,xo)[xo].addSystemDataToObject(t,void 0),e=Ve(e,"type","ping"),e=Ve(e,"d",Ke(JSON.stringify(t),i(this,bo)[bo])),i(this,xo)[xo].saveAndFireRequest(e,le.blockRequest)},Uo=function(){return void 0!==window.wzrk_d&&"continuous"===window.wzrk_d.ping},qo=function(e){this._isPersonalisationActive()&&(e.dsync=!0)};const Vo=new class{get spa(){return i(this,So)[So]}set spa(e){const t=!0===e;i(this,So)[So]!==t&&1===i(this,yo)[yo]&&(t?document.addEventListener("click",i(this,Oo)[Oo]):document.removeEventListener("click",i(this,Oo)[Oo])),i(this,So)[So]=t}get dismissSpamControl(){return i(this,_o)[_o]}set dismissSpamControl(e){const t=!0===e;i(this,_o)[_o]=t,le.dismissSpamControl=t}constructor(){var e,t,o,n,s;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.defineProperty(this,jo,{value:qo}),Object.defineProperty(this,Ro,{value:Uo}),Object.defineProperty(this,To,{value:Fo}),Object.defineProperty(this,Mo,{value:No}),Object.defineProperty(this,Lo,{value:Bo}),Object.defineProperty(this,Ao,{value:zo}),Object.defineProperty(this,Eo,{value:Do}),Object.defineProperty(this,bo,{writable:!0,value:void 0}),Object.defineProperty(this,mo,{writable:!0,value:void 0}),Object.defineProperty(this,yo,{writable:!0,value:void 0}),Object.defineProperty(this,wo,{writable:!0,value:void 0}),Object.defineProperty(this,Co,{writable:!0,value:void 0}),Object.defineProperty(this,ko,{writable:!0,value:void 0}),Object.defineProperty(this,xo,{writable:!0,value:void 0}),Object.defineProperty(this,Po,{writable:!0,value:void 0}),Object.defineProperty(this,So,{writable:!0,value:void 0}),Object.defineProperty(this,Io,{writable:!0,value:void 0}),Object.defineProperty(this,Oo,{writable:!0,value:i(this,Lo)[Lo].bind(this)}),Object.defineProperty(this,_o,{writable:!0,value:void 0}),this.enablePersonalization=void 0,this.popupCallbacks={},this.popupCurrentWzrkId="",i(this,yo)[yo]=0,this._isPersonalisationActive=this._isPersonalisationActive.bind(this),this.raiseNotificationClicked=()=>{},i(this,bo)[bo]=new ai(ti),i(this,ko)[ko]=new d(null===(e=r.account)||void 0===e?void 0:e[0],r.region||(null===(t=r.account)||void 0===t?void 0:t[1]),r.targetDomain||(null===(o=r.account)||void 0===o?void 0:o[2]),r.token||(null===(n=r.account)||void 0===n?void 0:n[3])),i(this,wo)[wo]=new ye({logger:i(this,bo)[bo]}),i(this,_o)[_o]=r.dismissSpamControl||!1,i(this,Co)[Co]=new pi({logger:i(this,bo)[bo],isPersonalisationActive:this._isPersonalisationActive}),i(this,xo)[xo]=new xi({logger:i(this,bo)[bo],account:i(this,ko)[ko],device:i(this,wo)[wo],session:i(this,Co)[Co],isPersonalisationActive:this._isPersonalisationActive}),this.enablePersonalization=r.enablePersonalization||!1,this.event=new Fe({logger:i(this,bo)[bo],request:i(this,xo)[xo],isPersonalisationActive:this._isPersonalisationActive},r.event),this.profile=new gt({logger:i(this,bo)[bo],request:i(this,xo)[xo],account:i(this,ko)[ko],isPersonalisationActive:this._isPersonalisationActive},r.profile),this.onUserLogin=new It({request:i(this,xo)[xo],account:i(this,ko)[ko],session:i(this,Co)[Co],logger:i(this,bo)[bo],device:i(this,wo)[wo]},r.onUserLogin),this.privacy=new Ai({request:i(this,xo)[xo],account:i(this,ko)[ko],logger:i(this,bo)[bo]},r.privacy),this.notifications=new Gi({logger:i(this,bo)[bo],request:i(this,xo)[xo],account:i(this,ko)[ko]},r.notifications),i(this,Po)[Po]=new fo({logger:i(this,bo)[bo],request:i(this,xo)[xo],account:i(this,ko)[ko],event:this.event}),i(this,mo)[mo]=new be({logger:i(this,bo)[bo],request:i(this,xo)[xo],device:i(this,wo)[wo],session:i(this,Co)[Co]}),this.spa=r.spa,this.dismissSpamControl=r.dismissSpamControl,this.user=new Xt({isPersonalisationActive:this._isPersonalisationActive}),this.session={getTimeElapsed:()=>i(this,Co)[Co].getTimeElapsed(),getPageCount:()=>i(this,Co)[Co].getPageCount()},this.logout=()=>{i(this,bo)[bo].debug("logout called"),ae.setInstantDeleteFlagInK()},this.clear=()=>{this.onUserLogin.clear()},this.getCleverTapID=()=>i(this,wo)[wo].getGuid(),this.getAccountID=()=>i(this,ko)[ko].id,this.getSCDomain=()=>i(this,ko)[ko].finalTargetDomain,this.setLibrary=(e,t)=>{le.flutterVersion={[e]:t}},this.setSCSDKVersion=e=>{i(this,ko)[ko].scSDKVersion=e;const t={};t.af={scv:"sc-sdk-v"+i(this,ko)[ko].scSDKVersion};let o=i(this,ko)[ko].dataPostURL;o=Ve(o,"type","page"),o=Ve(o,"d",Ke(JSON.stringify(t),i(this,bo)[bo])),i(this,xo)[xo].saveAndFireRequest(o,le.blockRequest)},Kt()&&(qt(),Ut(i(this,bo)[bo])),this.getInboxMessageCount=()=>{const e=Nt();return Object.keys(e).length},this.getInboxMessageUnreadCount=()=>{if(le.inbox)return le.inbox.unviewedCounter;i(this,bo)[bo].debug("No unread messages")},this.getAllInboxMessages=()=>Nt(),this.getUnreadInboxMessages=()=>{if(le.inbox)return le.inbox.unviewedMessages;i(this,bo)[bo].debug("No unread messages")},this.getInboxMessageForId=e=>{const t=Nt();if((null!==e||""!==e)&&t.hasOwnProperty(e))return t[e];i(this,bo)[bo].error("No message available for message Id "+e)},this.deleteInboxMessage=e=>{const t=Nt();if(null===e&&""===e||!t.hasOwnProperty(e))i(this,bo)[bo].error("No message available for message Id "+e);else{const i=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);0===t[e].viewed&&(le.inbox.unviewedCounter--,delete le.inbox.unviewedMessages[e],document.getElementById("unviewedBadge").innerText=le.inbox.unviewedCounter,document.getElementById("unviewedBadge").style.display=le.inbox.unviewedCounter>0?"flex":"none"),i&&i.remove(),delete t[e],Ft(t)}},this.markReadInboxMessage=e=>{const t=le.inbox.unviewedMessages,o=Nt();if(null===e&&""===e||!t.hasOwnProperty(e))i(this,bo)[bo].error("No message available for message Id "+e);else{const t=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);if(null!==t&&(t.shadowRoot.getElementById("unreadMarker").style.display="none"),o[e].viewed=1,document.getElementById("unviewedBadge")){var n=parseInt(document.getElementById("unviewedBadge").innerText)-1;document.getElementById("unviewedBadge").innerText=n,document.getElementById("unviewedBadge").style.display=n>0?"flex":"none"}window.clevertap.renderNotificationViewed({msgId:o[e].wzrk_id,pivotId:o[e].pivotId}),le.inbox.unviewedCounter--,delete le.inbox.unviewedMessages[e],Ft(o)}},this.markReadInboxMessagesForIds=e=>{if(Array.isArray(e))for(var t=0;t{const e=le.inbox.unviewedMessages,t=Nt();if(Object.keys(e).length>0){Object.keys(e).forEach((e=>{const i=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);null!==i&&(i.shadowRoot.getElementById("unreadMarker").style.display="none"),t[e].viewed=1,window.clevertap.renderNotificationViewed({msgId:t[e].wzrk_id,pivotId:t[e].wzrk_pivot})})),document.getElementById("unviewedBadge").innerText=0,document.getElementById("unviewedBadge").style.display="none",Ft(t),le.inbox.unviewedCounter=0,le.inbox.unviewedMessages={}}else i(this,bo)[bo].debug("All messages are already read")},this.toggleInbox=e=>{var t;return null===(t=le.inbox)||void 0===t?void 0:t.toggleInbox(e)},this.renderNotificationViewed=e=>{a(R,e)},this.renderNotificationClicked=e=>{a(j,e)};const a=(e,t)=>{if(!t||!t.msgId)return;const o={type:"event"};if(o.evtName=e,o.evtData={[T]:t.msgId},t.pivotId&&(o.evtData={...o.evtData,wzrk_pivot:t.pivotId}),t.wzrk_slideNo&&(o.evtData={...o.evtData,wzrk_slideNo:t.wzrk_slideNo}),t.kv&&null!==t.kv&&void 0!==t.kv)for(const e in t.kv)e.startsWith(M)&&(o.evtData={...o.evtData,[e]:t.kv[e]});if(t.msgCTkv&&null!==t.msgCTkv&&void 0!==t.msgCTkv)for(const e in t.msgCTkv)e.startsWith(M)&&(o.evtData={...o.evtData,[e]:t.msgCTkv[e]});i(this,xo)[xo].processEvent(o)};this.setLogLevel=e=>{i(this,bo)[bo].logLevel=Number(e),3===e?sessionStorage.WZRK_D="":delete sessionStorage.WZRK_D},this.handleIncrementValue=(e,t)=>{this.profile._handleIncrementDecrementValue(e,t,B)},this.handleDecrementValue=(e,t)=>{this.profile._handleIncrementDecrementValue(e,t,"$decr")},this.setMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueSet(e,t,"$set"):console.error("setMultiValuesForKey should be called with a value of type array")},this.addMultiValueForKey=(e,t)=>{"string"==typeof t||"number"==typeof t?this.profile._handleMultiValueAdd(e,t,N):console.error("addMultiValueForKey should be called with a value of type string or number.")},this.addMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueAdd(e,t,N):console.error("addMultiValuesForKey should be called with a value of type array.")},this.removeMultiValueForKey=(e,t)=>{"string"==typeof t||"number"==typeof t?this.profile._handleMultiValueRemove(e,t,F):console.error("removeMultiValueForKey should be called with a value of type string or number.")},this.removeMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueRemove(e,t,F):console.error("removeMultiValuesForKey should be called with a value of type array.")},this.removeValueForKey=e=>{this.profile._handleMultiValueDelete(e,U)};const l=(e,t,o)=>{((e,t,i,o,n)=>{const s=qe(location.href),r=s.e,a=s.p,l=s.page_type;if(void 0!==r){const s={};s.id=o.id,s.unsubGroups=le.unsubGroups,le.updatedCategoryLong&&(s.cUsY=le.updatedCategoryLong);let c=o.emailURL;i&&(c=Ve(c,"fetchGroups",i)),t&&(c=Ve(c,"encoded",t)),c=Ve(c,"e",r),c=Ve(c,"d",Ke(JSON.stringify(s),n)),a&&(c=Ve(c,"p",a)),"-1"!==e&&(c=Ve(c,"sub",e)),l&&(le.globalUnsubscribe=l===I,c=Ve(c,"page_type",l)),Qe.fireRequest(c)}})(e,t,o,i(this,ko)[ko],i(this,bo)[bo])};function c(e){var t=e.coords.latitude,i=e.coords.longitude;le.location={Latitude:t,Longitude:i},this.sendLocationData({Latitude:t,Longitude:i})}function h(e){switch(e.code){case e.PERMISSION_DENIED:console.log("User denied the request for Geolocation.");break;case e.POSITION_UNAVAILABLE:console.log("Location information is unavailable.");break;case e.TIMEOUT:console.log("The request to get user location timed out.");break;case e.UNKNOWN_ERROR:console.log("An unknown error occurred.")}}this.getLocation=function(e,t){if(e&&"number"!=typeof e||t&&"number"!=typeof t)console.log("Latitude and Longitude must be of number type");else if(e&&t){if(e<=-90||e>90)return void console.log("A vaid latitude must range between -90 and 90");if(t<=-180||t>180)return void console.log("A valid longitude must range between -180 and 180");le.location={Latitude:e,Longitude:t},this.sendLocationData({Latitude:e,Longitude:t})}else navigator.geolocation?navigator.geolocation.getCurrentPosition(c.bind(this),h):console.log("Geolocation is not supported by this browser.")};const u=i(this,mo)[mo];u.logout=this.logout,u.clear=this.clear,u.closeIframe=(e,t)=>{at(e,0,i(this,Co)[Co].sessionId)},u.enableWebPush=(e,t)=>{this.notifications._enableWebPush(e,t)},u.tr=e=>{Yt(e,{device:i(this,wo)[wo],session:i(this,Co)[Co],request:i(this,xo)[xo],logger:i(this,bo)[bo]})},u.setEnum=e=>{((e,t)=>{if(H(e)||Q(e))return"$E_"+e;t.error(Ae)})(e,i(this,bo)[bo])},u.is_onloadcalled=()=>1===i(this,yo)[yo],u.subEmail=e=>{l("1",e)},u.getEmail=(e,t)=>{l("-1",e,t)},u.unSubEmail=e=>{l("0",e)},u.unsubEmailGroups=e=>{le.unsubGroups=[];const t=document.getElementsByClassName("ct-unsub-group-input-item");for(let e=0;e{le.unsubGroups=e},u.getSubscriptionGroups=()=>le.unsubGroups,u.changeSubscriptionGroups=(e,t)=>{u.setSubscriptionGroups(t),l("2",e)},u.isGlobalUnsubscribe=()=>le.globalUnsubscribe,u.setIsGlobalUnsubscribe=e=>{le.globalUnsubscribe=e},u.setUpdatedCategoryLong=e=>{e.cUsY&&(le.updatedCategoryLong=e.cUsY)},window.$CLTP_WR=window.$WZRK_WR=u,(null===(s=r.account)||void 0===s?void 0:s[0].id)&&this.init()}init(e,t,o,n){if(1===i(this,yo)[yo])return;if(ae.removeCookie("WZRK_P",window.location.hostname),!i(this,ko)[ko].id){if(!e)return void i(this,bo)[bo].error(ke);i(this,ko)[ko].id=e}i(this,Co)[Co].cookieName="WZRK_S_"+i(this,ko)[ko].id,t&&(i(this,ko)[ko].region=t),o&&(i(this,ko)[ko].targetDomain=o),n&&(i(this,ko)[ko].token=n);const s=location.href,r=qe(s.toLowerCase());if(void 0!==r.e&&"0"==r.wzrk_ex)return;le.isPrivacyArrPushed=!0,le.privacyArray.length>0&&this.privacy.push(le.privacyArray),i(this,Eo)[Eo](),this.pageChanged();const a=setInterval((()=>{i(this,wo)[wo].gcookie&&(clearInterval(a),i(this,xo)[xo].processBackupEvents())}),3e3);i(this,So)[So]?document.addEventListener("click",i(this,Oo)[Oo]):document.removeEventListener("click",i(this,Oo)[Oo]),i(this,yo)[yo]=1}pageChanged(){const e=window.location.search;if("?ctBuilder"===e)return console.log("open in visual builder mode"),window.addEventListener("message",i(this,Mo)[Mo],!1),void window.postMessage("builder");if("?ctBuilderPreview"===e)return window.addEventListener("message",i(this,Mo)[Mo],!1),void window.postMessage("preview");const t=window.location.href,o=qe(t.toLowerCase()),n=i(this,Co)[Co].getSessionCookieObject();let s=void 0===n.p?0:n.p;n.p=++s,i(this,Co)[Co].setSessionCookieObject(n);let r={},a=(e=>{if(""===e)return"";var t=document.createElement("a");return t.href=e,t.hostname})(document.referrer);if(window.location.hostname!==a){const e=120;""!==a&&(a=a.length>e?a.substring(0,e):a,r.referrer=a);let t=o.utm_source||o.wzrk_source;void 0!==t&&(t=t.length>e?t.substring(0,e):t,r.us=t);let i=o.utm_medium||o.wzrk_medium;void 0!==i&&(i=i.length>e?i.substring(0,e):i,r.um=i);let n=o.utm_campaign||o.wzrk_campaign;if(void 0!==n&&(n=n.length>e?n.substring(0,e):n,r.uc=n),void 0!==o.wzrk_medium){const e=o.wzrk_medium;e.match(/^email$|^social$|^search$/)&&(r.wm=e)}}r=i(this,xo)[xo].addSystemDataToObject(r,void 0),r.cpg=t,r.WZRK_CAMP=it();let l=i(this,ko)[ko].dataPostURL;i(this,xo)[xo].addFlags(r),1===parseInt(r.pg)&&i(this,jo)[jo](r),l=Ve(l,"type","page"),l=Ve(l,"d",Ke(JSON.stringify(r),i(this,bo)[bo])),i(this,xo)[xo].saveAndFireRequest(l,le.blockRequest),1===parseInt(r.pg)&&this.event.push(K,{t:4}),i(this,Io)[Io]=t,setTimeout((()=>{s<=3&&i(this,To)[To](),i(this,Ro)[Ro]()&&setInterval((()=>{i(this,To)[To]()}),3e5)}),12e4)}_isPersonalisationActive(){return ae._isLocalStorageSupported()&&this.enablePersonalization}set popupCallback(e){this.popupCallbacks[this.popupCurrentWzrkId]=e}sendLocationData(e){let t={af:{}};const o={};if(t.type="profile",null==o.tz&&(o.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),t.profile=o,e){Object.keys(e).forEach((i=>{t.af[i]=e[i]}))}le.location&&(t.af={...t.af,...le.location}),t=i(this,xo)[xo].addSystemDataToObject(t,!0),i(this,xo)[xo].addFlags(t);const n=Ke(JSON.stringify(t),i(this,bo)[bo]);let s=i(this,ko)[ko].dataPostURL;s=Ve(s,"type",A),s=Ve(s,"d",n),i(this,xo)[xo].saveAndFireRequest(s,le.blockRequest)}setOffline(e){"boolean"==typeof e?(le.offline=e,e||i(this,xo)[xo].processBackupEvents()):console.error("setOffline should be called with a value of type boolean")}defineVariable(e,t){return io.define(e,t,i(this,Po)[Po])}syncVariables(e,t){if(4===i(this,bo)[bo].logLevel)return i(this,Po)[Po].syncVariables(e,t);{const e="App log level is not set to 4";return i(this,bo)[bo].error(e),Promise.reject(new Error(e))}}fetchVariables(e){i(this,Po)[Po].fetchVariables(e)}addVariablesChangedCallback(e){i(this,Po)[Po].addVariablesChangedCallback(e)}addOneTimeVariablesChangedCallback(e){i(this,Po)[Po].addOneTimeVariablesChangedCallback(e)}}(window.clevertap);return window.clevertap=window.wizrocket=Vo,Vo})); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).clevertap=t()}(this,(function(){"use strict";var e=0;function t(t){return"__private_"+e+++"_"+t}function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}const o="clevertap-prod.com",n="https:";var s=t("accountId"),r=t("region"),a=t("targetDomain"),l=t("dcSdkversion"),c=t("token");class d{constructor(){let{id:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";Object.defineProperty(this,s,{writable:!0,value:void 0}),Object.defineProperty(this,r,{writable:!0,value:""}),Object.defineProperty(this,a,{writable:!0,value:o}),Object.defineProperty(this,l,{writable:!0,value:""}),Object.defineProperty(this,c,{writable:!0,value:""}),this.id=e,t&&(this.region=t),i&&(this.targetDomain=i),n&&(this.token=n)}get id(){return i(this,s)[s]}set id(e){i(this,s)[s]=e}get region(){return i(this,r)[r]}set region(e){i(this,r)[r]=e}get dcSDKVersion(){return i(this,l)[l]}set dcSDKVersion(e){i(this,l)[l]=e}get targetDomain(){return i(this,a)[a]}set targetDomain(e){i(this,a)[a]=e}get token(){return i(this,c)[c]}set token(e){i(this,c)[c]=e}get finalTargetDomain(){return this.region?"".concat(this.region,".").concat(this.targetDomain):this.targetDomain===o?"".concat("eu1",".").concat(this.targetDomain):this.targetDomain}get dataPostPEURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/defineVars")}get dataPostURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/a?t=96")}get recorderURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/r?r=1")}get emailURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/e?r=1")}}const h=new RegExp("^\\s+|\\.|:|\\$|'|\"|\\\\|\\s+$","g"),u=new RegExp("^\\s+|'|\"|\\\\|\\s+$","g"),p=new RegExp("'","g"),g="clear",f="Charged ID",v="WZRK_CHARGED_ID",b="WZRK_G",m="WZRK_K",y="WZRK_CAMP",w="WZRK_CAMP_G",C="WZRK_EV",k="WZRK_META",x="WZRK_PR",P="WZRK_ARP",S="WZRK_L",I="global",O="optOut",_="useIP",E="WZRK_X",A="push",L=31536e3,M="wzrk_",T="wzrk_id",R="Notification Viewed",j="Notification Clicked",D="WZRK_FPU",z="WZRK_PSD",B="$incr",N="$add",F="$remove",U="$delete",q="WZRK_INBOX_CONFIG",V="WZRK_INBOX",W=1e3,K="wzrk_fetch",G=["Stayed","UTM Visited","App Launched","Notification Sent",R,j],H=e=>"string"==typeof e||e instanceof String,J=e=>"[object Object]"===Object.prototype.toString.call(e),Z=e=>"object"==typeof e&&e instanceof Date,$=e=>{for(const t in e)if(e.hasOwnProperty(t))return!1;return!0},Y=e=>!isNaN(parseFloat(e))&&isFinite(e),Q=e=>/^-?[\d.]+(?:e-?\d+)?$/.test(e)&&"number"==typeof e,X=e=>null!=e&&"undefined"!==e,ee=(e,t)=>{if("object"!=typeof e){let i;return H(e)?(i=te(e,u),i.length>1024&&(i=i.substring(0,1024),t.reportError(521,i+"... length exceeded 1024 chars. Trimmed."))):i=e,i}for(const i in e)if(e.hasOwnProperty(i)){const o=ee(e[i],t);let n;n=te(i,h),n.length>1024&&(n=n.substring(0,1024),t.reportError(520,n+"... length exceeded 1024 chars. Trimmed.")),delete e[i],e[n]=o}return e},te=(e,t)=>e.replace(t,""),ie=()=>{const e=new Date;return e.getFullYear()+""+e.getMonth()+e.getDay()},oe=()=>Math.floor((new Date).getTime()/1e3),ne=e=>"$D_"+Math.round(e.getTime()/1e3),se=e=>{if(re(e))return"$D_"+e},re=e=>{const t=/^(\d{4})(\d{2})(\d{2})$/.exec(e);if(null==t)return!1;const i=t[3],o=t[2]-1,n=t[1],s=new Date(n,o,i);return s.getDate()==i&&s.getMonth()==o&&s.getFullYear()==n};class ae{static save(e,t){return!(!e||!t)&&(this._isLocalStorageSupported()?(localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),!0):void 0)}static read(e){if(!e)return!1;let t=null;if(this._isLocalStorageSupported()&&(t=localStorage.getItem(e)),null!=t)try{t=JSON.parse(t)}catch(e){}return t}static remove(e){return!!e&&(this._isLocalStorageSupported()?(localStorage.removeItem(e),!0):void 0)}static removeCookie(e,t){let i=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";t&&(i=i+" domain="+t+"; path=/"),document.cookie=i}static createCookie(e,t,i,o){let n="",s="";if(i){const e=new Date;e.setTime(e.getTime()+1e3*i),n="; expires="+e.toGMTString()}o&&(s="; domain="+o),t=encodeURIComponent(t),document.cookie=e+"="+t+n+s+"; path=/"}static readCookie(e){const t=e+"=",i=document.cookie.split(";");for(let e=0;e=0;o--){if(a=0===o?r[o]+a:"."+r[o]+a,this.readCookie(e)){var n="test_"+e+o;if(this.createCookie(n,t,10,a),!this.readCookie(n))continue;this.removeCookie(n,a)}this.createCookie(e,t,i,a);if(this.readCookie(e)==t){s=a,le.broadDomain=s;break}}}else this.createCookie(e,t,i,s)}else this.createCookie(e,t,i,o)}static getMetaProp(e){const t=this.readFromLSorCookie(k);if(null!=t)return t[e]}static setMetaProp(e,t){if(this._isLocalStorageSupported()){let i=this.readFromLSorCookie(k);null==i&&(i={}),void 0===t?delete i[e]:i[e]=t,this.saveToLSorCookie(k,i)}}static getAndClearMetaProp(e){const t=this.getMetaProp(e);return this.setMetaProp(e,void 0),t}static setInstantDeleteFlagInK(){let e=this.readFromLSorCookie(m);null==e&&(e={}),e.flag=!0,this.saveToLSorCookie(m,e)}static backupEvent(e,t,i){let o=this.readFromLSorCookie(S);void 0===o&&(o={}),o[t]={q:e},this.saveToLSorCookie(S,o),i.debug("stored in ".concat(S," reqNo : ").concat(t," -> ").concat(e))}static removeBackup(e,t){const i=this.readFromLSorCookie(S);null!=i&&void 0!==i[e]&&(t.debug("del event: ".concat(e," data-> ").concat(i[e].q)),delete i[e],this.saveToLSorCookie(S,i))}}const le={globalCache:{gcookie:null,REQ_N:0,RESP_N:0},LRU_CACHE:null,globalProfileMap:void 0,globalEventsMap:void 0,blockRequest:!1,isOptInRequest:!1,broadDomain:null,webPushEnabled:null,campaignDivMap:{},currentSessionId:null,wiz_counter:0,notifApi:{notifEnabledFromApi:!1},unsubGroups:[],updatedCategoryLong:null,inbox:null,isPrivacyArrPushed:!1,privacyArray:[],offline:!1,location:null,dismissSpamControl:!1,globalUnsubscribe:!0,flutterVersion:null,variableStore:{}};var ce=t("keyOrder"),de=t("deleteFromObject");class he{constructor(e){Object.defineProperty(this,de,{value:ue}),Object.defineProperty(this,ce,{writable:!0,value:void 0}),this.max=e;let t=ae.readFromLSorCookie(E);if(t){const e={};i(this,ce)[ce]=[],t=t.cache;for(const o in t)t.hasOwnProperty(o)&&(e[t[o][0]]=t[o][1],i(this,ce)[ce].push(t[o][0]));this.cache=e}else this.cache={},i(this,ce)[ce]=[]}get(e){const t=this.cache[e];return t&&(this.cache=i(this,de)[de](e,this.cache),this.cache[e]=t,i(this,ce)[ce].push(e)),this.saveCacheToLS(this.cache),t}set(e,t){const o=this.cache[e],n=i(this,ce)[ce];null!=o?this.cache=i(this,de)[de](e,this.cache):n.length===this.max&&(this.cache=i(this,de)[de](n[0],this.cache)),this.cache[e]=t,i(this,ce)[ce][i(this,ce)[ce]-1]!==e&&i(this,ce)[ce].push(e),this.saveCacheToLS(this.cache)}saveCacheToLS(e){const t=[],o=i(this,ce)[ce];for(const i in o)if(o.hasOwnProperty(i)){const n=[];n.push(o[i]),n.push(e[o[i]]),t.push(n)}ae.saveToLSorCookie(E,{cache:t})}getKey(e){if(null===e)return null;const t=i(this,ce)[ce];for(const i in t)if(t.hasOwnProperty(i)&&this.cache[t[i]]===e)return t[i];return null}getSecondLastKey(){const e=i(this,ce)[ce];return null!=e&&e.length>1?e[e.length-2]:-1}getLastKey(){const e=i(this,ce)[ce].length;if(e)return i(this,ce)[ce][e-1]}}var ue=function(e,t){const o=JSON.parse(JSON.stringify(i(this,ce)[ce])),n={};let s;for(const i in o)o.hasOwnProperty(i)&&(o[i]!==e?n[o[i]]=t[o[i]]:s=i);return o.splice(s,1),i(this,ce)[ce]=JSON.parse(JSON.stringify(o)),n},pe=t("logger"),ge=t("request"),fe=t("device"),ve=t("session");class be{constructor(e){let{logger:t,request:o,device:n,session:s}=e;Object.defineProperty(this,pe,{writable:!0,value:void 0}),Object.defineProperty(this,ge,{writable:!0,value:void 0}),Object.defineProperty(this,fe,{writable:!0,value:void 0}),Object.defineProperty(this,ve,{writable:!0,value:void 0}),i(this,pe)[pe]=t,i(this,ge)[ge]=o,i(this,fe)[fe]=n,i(this,ve)[ve]=s}s(e,t,o,n,s){let r=!1,a=!1;if(window.isOULInProgress&&(o||"undefined"!==n&&n===window.oulReqN)&&(window.isOULInProgress=!1,r=!0),void 0===n&&(n=0),ae.removeBackup(n,i(this,pe)[pe]),n>le.globalCache.REQ_N)return;if(X(i(this,fe)[fe].gcookie)||e&&(a=!0),!X(i(this,fe)[fe].gcookie)||o||"boolean"==typeof s){const n=i(this,ve)[ve].getSessionCookieObject();if(window.isOULInProgress||n.s&&t{if(J(e)){for(var t in e)if(e.hasOwnProperty(t)){if(J(e[t])||Array.isArray(e[t]))return!1;Z(e[t])&&(e[t]=ne(e[t]))}return!0}return!1},Re=(e,t)=>{if(J(e)){for(var i in e)if(e.hasOwnProperty(i))if("Items"===i){if(!Array.isArray(e[i]))return!1;for(var o in e[i].length>50&&t.reportError(522,"Charged Items exceed 50 limit. Actual count: "+e[i].length),e[i])if(e[i].hasOwnProperty(o)&&(!J(e[i][o])||!Te(e[i][o])))return!1}else{if(J(e[i])||Array.isArray(e[i]))return!1;Z(e[i])&&(e[i]=ne(e[i]))}if(H(e[f])||Q(e[f])){const i=e[f]+"";if(void 0===Me&&(Me=ae.readFromLSorCookie(v)),void 0!==Me&&Me.trim()===i.trim())return t.error("Duplicate charged Id - Dropped"+e),!1;Me=i,ae.saveToLSorCookie(v,i)}return!0}return!1};var je=t("logger"),De=t("oldValues"),ze=t("request"),Be=t("isPersonalisationActive"),Ne=t("processEventArray");class Fe extends Array{constructor(e,t){let{logger:o,request:n,isPersonalisationActive:s}=e;super(),Object.defineProperty(this,Ne,{value:Ue}),Object.defineProperty(this,je,{writable:!0,value:void 0}),Object.defineProperty(this,De,{writable:!0,value:void 0}),Object.defineProperty(this,ze,{writable:!0,value:void 0}),Object.defineProperty(this,Be,{writable:!0,value:void 0}),i(this,je)[je]=o,i(this,De)[De]=t,i(this,ze)[ze]=n,i(this,Be)[Be]=s}push(){for(var e=arguments.length,t=new Array(e),o=0;o0;){var t=e.shift();if(!H(t)){i(this,je)[je].error(xe);continue}if(t.length>1024&&(t=t.substring(0,1024),i(this,je)[je].reportError(510,t+"... length exceeded 1024 chars. Trimmed.")),G.includes(t)){i(this,je)[je].reportError(513,t+" is a restricted system event. It cannot be used as an event name.");continue}const o={type:"event"};if(o.evtName=te(t,h),0!==e.length){const n=e.shift();if(J(n)){if("Charged"===t){if(!Re(n,i(this,je)[je])){i(this,je)[je].reportError(511,"Charged event structure invalid. Not sent.");continue}}else if(!Te(n)){i(this,je)[je].reportError(512,t+" event structure invalid. Not sent.");continue}o.evtData=n}else e.unshift(n)}i(this,ze)[ze].processEvent(o)}};const qe=e=>{const t={},i=e.indexOf("?");if(i>1){const o=e.substring(i+1);let n;const s=/\+/g,r=/([^&=]+)=?([^&]*)/g,a=function(e){let t=e.replace(s," ");try{t=decodeURIComponent(t)}catch(e){}return t};for(n=r.exec(o);n;)t[a(n[1])]=a(n[2]),n=r.exec(o)}return t},Ve=(e,t,i)=>e+"&"+t+"="+encodeURIComponent(i),We=()=>window.location.hostname,Ke=(e,t)=>(t&&"function"==typeof t.debug&&t.debug("dobj:"+e),He(e)),Ge=(()=>{let e="",t=0;for(t=0;t<=25;t++)e+=String.fromCharCode(t+65);for(t=0;t<=25;t++)e+=String.fromCharCode(t+97);for(t=0;t<10;t++)e+=t;return e+"+/="})(),He=e=>{if(null==e)return"";var t,i,o,n,s,r,a,l="",c=0;for(e=(e=>{if(null==e)return"";let t,i,o,n={},s={},r="",a="",l="",c=2,d=3,h=2,u="",p=0,g=0,f=String.fromCharCode;for(o=0;o>=1}else{for(i=1,t=0;t>=1}c--,0==c&&(c=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;c--,0==c&&(c=Math.pow(2,h),h++),n[a]=d++,l=String(r)}if(""!==l){if(Object.prototype.hasOwnProperty.call(s,l)){if(l.charCodeAt(0)<256){for(t=0;t>=1}else{for(i=1,t=0;t>=1}c--,0==c&&(c=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;c--,0==c&&(c=Math.pow(2,h),h++)}for(i=2,t=0;t>=1;for(;;){if(p<<=1,15==g){u+=f(p);break}g++}return u})(e);c<2*e.length;)c%2==0?(t=e.charCodeAt(c/2)>>8,i=255&e.charCodeAt(c/2),o=c/2+1>8:NaN):(t=255&e.charCodeAt((c-1)/2),(c+1)/2>8,o=255&e.charCodeAt((c+1)/2)):i=o=NaN),c+=3,n=t>>2,s=(3&t)<<4|i>>4,r=(15&i)<<2|o>>6,a=63&o,isNaN(i)?r=a=64:isNaN(o)&&(a=64),l=l+Ge.charAt(n)+Ge.charAt(s)+Ge.charAt(r)+Ge.charAt(a);return l};var Je=t("fireRequest"),Ze=t("dropRequestDueToOptOut"),$e=t("addUseIPToRequest"),Ye=t("addARPToRequest");class Qe{constructor(){this.networkRetryCount=0,this.minDelayFrequency=0}static fireRequest(e,t,o,n){i(this,Je)[Je](e,1,t,o,n)}getDelayFrequency(){if(this.logger.debug("Network retry #"+this.networkRetryCount),this.networkRetryCount<10)return this.logger.debug(this.account.id,"Failure count is "+this.networkRetryCount+". Setting delay frequency to 1s"),this.minDelayFrequency=W,this.minDelayFrequency;if(null==this.account.region)return this.logger.debug(this.account.id,"Setting delay frequency to 1s"),W;{const e=1e3*(Math.floor(10*Math.random())+1);return this.minDelayFrequency+=e,this.minDelayFrequency<6e5?(this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency):(this.minDelayFrequency=W,this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency)}}}Qe.logger=void 0,Qe.device=void 0,Qe.account=void 0,Object.defineProperty(Qe,Je,{value:function(e,t,o,n,s){var r,a;if(i(this,Ze)[Ze]())return void this.logger.debug("req dropped due to optout cookie: "+this.device.gcookie);if(X(this.device.gcookie)||(le.blockRequest=!0),s&&s===K)!X(this.device.gcookie)&&le.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(this.networkRetryCount)),i(this,Je)[Je](e,void 0,o,n)}),this.getDelayFrequency());else if(!X(this.device.gcookie)&&le.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(t)),i(this,Je)[Je](e,t+1,o,n)}),50);if(n?window.isOULInProgress=!0:(X(this.device.gcookie)&&(e=Ve(e,"gc",this.device.gcookie)),e=i(this,Ye)[Ye](e,o)),e=Ve(e,"tries",t),e=i(this,$e)[$e](e),e=Ve(e,"r",(new Date).getTime()),(null===(r=window.clevertap)||void 0===r?void 0:r.hasOwnProperty("plugin"))||(null===(a=window.wizrocket)||void 0===a?void 0:a.hasOwnProperty("plugin"))){const t=window.clevertap.plugin||window.wizrocket.plugin;e=Ve(e,"ct_pl",t)}-1!==e.indexOf("chrome-extension:")&&(e=e.replace("chrome-extension:","https:"));for(var l=document.getElementsByClassName("ct-jp-cb");l[0]&&l[0].parentNode;)l[0].parentNode.removeChild(l[0]);const c=document.createElement("script");c.setAttribute("type","text/javascript"),c.setAttribute("src",e),c.setAttribute("class","ct-jp-cb"),c.setAttribute("rel","nofollow"),c.async=!0,document.getElementsByTagName("head")[0].appendChild(c),this.logger.debug("req snt -> url: "+e)}}),Object.defineProperty(Qe,Ze,{value:function(){return!le.isOptInRequest&&X(this.device.gcookie)&&H(this.device.gcookie)?":OO"===this.device.gcookie.slice(-3):(le.isOptInRequest=!1,!1)}}),Object.defineProperty(Qe,$e,{value:function(e){var t=ae.getMetaProp(_);return"boolean"!=typeof t&&(t=!1),Ve(e,_,t?"true":"false")}}),Object.defineProperty(Qe,Ye,{value:function(e,t){if(!0===t){const t={skipResARP:!0};return Ve(e,"arp",Ke(JSON.stringify(t),this.logger))}return ae._isLocalStorageSupported()&&void 0!==localStorage.getItem(P)&&null!==localStorage.getItem(P)?Ve(e,"arp",Ke(JSON.stringify(ae.readFromLSorCookie(P)),this.logger)):e}});const Xe=()=>{let e={};if(ae._isLocalStorageSupported()){let t=ae.read(y);null!=t?(t=JSON.parse(decodeURIComponent(t).replace(p,'"')),t.hasOwnProperty("global")?e.wp=t:e=t):e={}}return e},et=e=>{if(ae._isLocalStorageSupported()){const t={...Xe(),...e},i=JSON.stringify(t);ae.save(y,encodeURIComponent(i)),tt()}},tt=()=>{if(ae._isLocalStorageSupported()){let i=ae.read(b);if(X(i))try{i=JSON.parse(decodeURIComponent(ae.read(b)));const o=ae.read(w)?JSON.parse(decodeURIComponent(ae.read(w))):{};if(i&&ae._isLocalStorageSupported()){var e={},t=Xe();Object.keys(t).forEach((n=>{const s=i in o&&Object.keys(o[i]).length&&o[i][n]?o[i][n]:{},r=t[n].global,a=ie(),l=t[n][a];if(void 0!==r){const e=Object.keys(r);for(const t in e){let i=[];if(e.hasOwnProperty(t)){let o=0,n=0;const a=e[t];if("tc"===a)continue;void 0!==l&&void 0!==l[a]&&(o=l[a]),void 0!==r&&void 0!==r[a]&&(n=r[a]),i=[a,o,n],s[a]=i}}}e={...e,[n]:s}})),o[i]=e,ae.save(w,encodeURIComponent(JSON.stringify(o)))}}catch(e){console.error("Invalid clevertap Id "+e)}}},it=()=>{const e=JSON.parse(decodeURIComponent(ae.read(b)));let t={};if(ae._isLocalStorageSupported()){let i={};t=Xe();const o=ae.read(w),n=o?decodeURIComponent(o):null,s=n?JSON.parse(n):null,r=e&&null!=o&&s&&s[e]&&s[e].wp?Object.values(s[e].wp):[],a=e&&null!=o&&s&&s[e]&&s[e].wi?Object.values(s[e].wi):[],l=ie();let c=0,d=0;return t.wp&&t.wp[l]&&"undefined"!==t.wp[l].tc&&(c=t.wp[l].tc),t.wi&&t.wi[l]&&"undefined"!==t.wi[l].tc&&(d=t.wi[l].tc),i={wmp:c,wimp:d,tlc:r,witlc:a},i}},ot=(e,t)=>{let{logger:i}=t,o=!1;if(J(e))for(const t in e)if(e.hasOwnProperty(t)){o=!0;let n=e[t];if(null==n){delete e[t];continue}"Gender"!==t||n.match(/^M$|^F$/)||(o=!1,i.error(Pe)),"Employed"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Se)),"Married"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Ie)),"Education"!==t||n.match(/^School$|^College$|^Graduate$/)||(o=!1,i.error(Oe)),"Age"===t&&null!=n&&(Y(n)?e.Age=+n:(o=!1,i.error(_e))),"DOB"===t?(/^\$D_/.test(n)&&11===(n+"").length||Z(n)||(o=!1,i.error(Ee)),Z(n)&&(e[t]=ne(n))):Z(n)&&(e[t]=ne(n)),"Phone"!==t||$(n)||(n.length>8&&"+"===n.charAt(0)?(n=n.substring(1,n.length),Y(n)?e.Phone=+n:(o=!1,i.error(Le+". Removed."))):(o=!1,i.error(Le+". Removed."))),o||delete e[t]}return o},nt=e=>{const t={};t.Name=e.name,null!=e.id&&(t.FBID=e.id+""),"male"===e.gender?t.Gender="M":"female"===e.gender?t.Gender="F":t.Gender="O";null!=e.relationship_status&&(t.Married="N","Married"===e.relationship_status&&(t.Married="Y"));const i=function(e){if(null!=e){let t="",i="";for(let o=0;o0?"Y":"N",null!=e.email&&(t.Email=e.email),null!=e.birthday){const i=e.birthday.split("/");t.DOB=se(i[2]+i[0]+i[1])}return t},st=(e,t)=>{let{logger:i}=t;const o={};if(null!=e.displayName&&(o.Name=e.displayName),null!=e.id&&(o.GPID=e.id+""),null!=e.gender&&("male"===e.gender?o.Gender="M":"female"===e.gender?o.Gender="F":"other"===e.gender&&(o.Gender="O")),null!=e.image&&!1===e.image.isDefault&&(o.Photo=e.image.url.split("?sz")[0]),null!=e.emails)for(let t=0;t{if(ae._isLocalStorageSupported()){if(null==le.globalProfileMap&&(le.globalProfileMap=ae.readFromLSorCookie(x),null==le.globalProfileMap&&(le.globalProfileMap={})),null!=e._custom){const t=e._custom;for(const i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);delete e._custom}for(const i in e)if(e.hasOwnProperty(i)){if(le.globalProfileMap.hasOwnProperty(i)&&!t)continue;le.globalProfileMap[i]=e[i]}null!=le.globalProfileMap._custom&&delete le.globalProfileMap._custom,ae.saveToLSorCookie(x,le.globalProfileMap)}},at=(e,t,i)=>{if(null!=e&&"-1"!==e&&ae._isLocalStorageSupported()){const t=Xe();let o=t.wp[i];null==o&&(o={},t[i]=o),o[e]="dnd",et(t)}if(null!=le.campaignDivMap){const t=le.campaignDivMap[e];null!=t&&(document.getElementById(t).style.display="none","intentPreview"===t&&null!=document.getElementById("intentOpacityDiv")&&(document.getElementById("intentOpacityDiv").style.display="none"))}};var lt=t("logger"),ct=t("request"),dt=t("account"),ht=t("oldValues"),ut=t("isPersonalisationActive"),pt=t("processProfileArray");class gt extends Array{constructor(e,t){let{logger:o,request:n,account:s,isPersonalisationActive:r}=e;super(),Object.defineProperty(this,pt,{value:ft}),Object.defineProperty(this,lt,{writable:!0,value:void 0}),Object.defineProperty(this,ct,{writable:!0,value:void 0}),Object.defineProperty(this,dt,{writable:!0,value:void 0}),Object.defineProperty(this,ht,{writable:!0,value:void 0}),Object.defineProperty(this,ut,{writable:!0,value:void 0}),i(this,lt)[lt]=o,i(this,ct)[ct]=n,i(this,dt)[dt]=s,i(this,ht)[ht]=t,i(this,ut)[ut]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o0)for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];let n,s={};if(null!=o.Site){if(n=o.Site,$(n)||!ot(n,{logger:i(this,lt)[lt]}))return}else if(null!=o.Facebook){const e=o.Facebook;$(e)||e.error||(n=nt(e))}else if(null!=o["Google Plus"]){const e=o["Google Plus"];$(e)||e.error||(n=st(e,{logger:i(this,lt)[lt]}))}if(null!=n&&!$(n)){s.type="profile",null==n.tz&&(n.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),s.profile=n,rt(n,!0),s=i(this,ct)[ct].addSystemDataToObject(s,void 0),i(this,ct)[ct].addFlags(s);const e=Ke(JSON.stringify(s),i(this,lt)[lt]);let t=i(this,dt)[dt].dataPostURL;t=Ve(t,"type",A),t=Ve(t,"d",e),i(this,ct)[ct].saveAndFireRequest(t,le.blockRequest)}}},vt=t("request"),bt=t("logger"),mt=t("account"),yt=t("session"),wt=t("oldValues"),Ct=t("device"),kt=t("processOUL"),xt=t("handleCookieFromCache"),Pt=t("deleteUser"),St=t("processLoginArray");class It extends Array{constructor(e,t){let{request:o,account:n,session:s,logger:r,device:a}=e;super(),Object.defineProperty(this,St,{value:At}),Object.defineProperty(this,Pt,{value:Et}),Object.defineProperty(this,xt,{value:_t}),Object.defineProperty(this,kt,{value:Ot}),Object.defineProperty(this,vt,{writable:!0,value:void 0}),Object.defineProperty(this,bt,{writable:!0,value:void 0}),Object.defineProperty(this,mt,{writable:!0,value:void 0}),Object.defineProperty(this,yt,{writable:!0,value:void 0}),Object.defineProperty(this,wt,{writable:!0,value:void 0}),Object.defineProperty(this,Ct,{writable:!0,value:void 0}),i(this,vt)[vt]=o,i(this,mt)[mt]=n,i(this,yt)[yt]=s,i(this,bt)[bt]=r,i(this,wt)[wt]=t,i(this,Ct)[Ct]=a}clear(){i(this,bt)[bt].debug("clear called. Reset flag has been set."),i(this,Pt)[Pt](),ae.setMetaProp(g,!0)}push(){for(var e=arguments.length,t=new Array(e),o=0;o{let o=ae.readFromLSorCookie(m);const n=ae.readFromLSorCookie(b);let s;if(null==o)o={},s=e;else{s=o.id;let r=!1,a=!1;if(null==s&&(s=e[0],r=!0),null==le.LRU_CACHE&&ae._isLocalStorageSupported()&&(le.LRU_CACHE=new he(100)),r)null!=n&&(le.LRU_CACHE.set(s,n),le.blockRequest=!1);else for(const t in e)if(e.hasOwnProperty(t)){const i=e[t];if(le.LRU_CACHE.cache[i]){s=i,a=!0;break}}if(a){s!==le.LRU_CACHE.getLastKey()?i(this,xt)[xt]():(t=!1,ae.saveToLSorCookie(D,t));const e=le.LRU_CACHE.get(s);le.LRU_CACHE.set(s,e),ae.saveToLSorCookie(b,e),i(this,Ct)[Ct].gcookie=e;const o=le.LRU_CACHE.getSecondLastKey();if(ae.readFromLSorCookie(D)&&-1!==o){const e=le.LRU_CACHE.cache[o];i(this,vt)[vt].unregisterTokenForGuid(e)}}else r?null!=n&&(i(this,Ct)[Ct].gcookie=n,ae.saveToLSorCookie(b,n),t=!1):this.clear(),ae.saveToLSorCookie(D,!1),s=e[0]}o.id=s,ae.saveToLSorCookie(m,o)};if(Array.isArray(e)&&e.length>0)for(const n in e)if(e.hasOwnProperty(n)){const s=e[n];let r,a={};if(null!=s.Site){if(r=s.Site,$(r)||!ot(r,{logger:i(this,bt)[bt]}))return}else if(null!=s.Facebook){const e=s.Facebook;$(e)||e.error||(r=nt(e))}else if(null!=s["Google Plus"]){const e=s["Google Plus"];$(e)&&!e.error&&(r=st(e,{logger:i(this,bt)[bt]}))}if(null!=r&&!$(r)){a.type="profile",null==r.tz&&(r.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),a.profile=r;const e=[];ae._isLocalStorageSupported()&&(r.Identity&&e.push(r.Identity),r.Email&&e.push(r.Email),r.GPID&&e.push("GP:"+r.GPID),r.FBID&&e.push("FB:"+r.FBID),e.length>0&&o(e)),rt(r,!0),a=i(this,vt)[vt].addSystemDataToObject(a,void 0),i(this,vt)[vt].addFlags(a),t&&(a.isOUL=!0);const n=Ke(JSON.stringify(a),i(this,bt)[bt]);let s=i(this,mt)[mt].dataPostURL;s=Ve(s,"type",A),s=Ve(s,"d",n),i(this,vt)[vt].saveAndFireRequest(s,le.blockRequest,t)}}},_t=function(){le.blockRequest=!1,console.debug("Block request is false"),ae._isLocalStorageSupported()&&(delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),ae.removeCookie(y,We()),ae.removeCookie(i(this,yt)[yt].cookieName,le.broadDomain),ae.removeCookie(P,le.broadDomain),i(this,yt)[yt].setSessionCookieObject("")},Et=function(){le.blockRequest=!0,i(this,bt)[bt].debug("Block request is true"),le.globalCache={gcookie:null,REQ_N:0,RESP_N:0},ae._isLocalStorageSupported()&&(delete localStorage.WZRK_G,delete localStorage.WZRK_K,delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),ae.removeCookie(b,le.broadDomain),ae.removeCookie(y,We()),ae.removeCookie(m,We()),ae.removeCookie(i(this,yt)[yt].cookieName,le.broadDomain),ae.removeCookie(P,le.broadDomain),i(this,Ct)[Ct].gcookie=null,i(this,yt)[yt].setSessionCookieObject("")},At=function(e){if(Array.isArray(e)&&e.length>0){const t=e.pop();if(null!=t&&J(t)&&(null!=t.Site&&Object.keys(t.Site).length>0||null!=t.Facebook&&Object.keys(t.Facebook).length>0||null!=t["Google Plus"]&&Object.keys(t["Google Plus"]).length>0)){ae.setInstantDeleteFlagInK();try{i(this,kt)[kt]([t])}catch(e){i(this,bt)[bt].debug(e)}}else i(this,bt)[bt].error("Profile object is in incorrect format")}};class Lt extends HTMLElement{constructor(){super(),this._details=null,this.shadow=null,this.shadow=this.attachShadow({mode:"open"})}get details(){return this._details||""}set details(e){null===this._details&&(this._details=e,this.renderBanner())}renderBanner(){this.shadow.innerHTML=this.getBannerContent(),!1!==this.trackClick&&this.addEventListener("click",(()=>{const e=this.details.onClick;e&&(this.details.window?window.open(e,"_blank"):window.parent.location.href=e),window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId})}getBannerContent(){return'\n \n \n ")}}class Mt extends HTMLElement{constructor(){super(),this._target=null,this._carousel=null,this.shadow=null,this.slides=0,this.previouslySelectedItem=-1,this.selectedItem=1,this.autoSlide=null,this.stopAutoSlideTimeout=null,this.shadow=this.attachShadow({mode:"open"}),void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Lt)}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderCarousel())}get details(){return this.target.display.details}get display(){return this.target.display}renderCarousel(){this.slides=this.details.length,this.shadow.innerHTML=this.getStyles();const e=this.getCarouselContent();this.display.showNavBtns&&e.insertAdjacentHTML("beforeend",this.display.navBtnsHtml),this.display.showNavArrows&&(e.insertAdjacentHTML("beforeend",this.display.leftNavArrowHtml),e.insertAdjacentHTML("beforeend",this.display.rightNavArrowHtml)),this._carousel=e,this.shadow.appendChild(e),this.setupClick(),this.updateSelectedItem(),this.startAutoSlide(),this.setupOnHover(),window.clevertap.renderNotificationViewed({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot})}setupClick(){this._carousel.addEventListener("click",(e=>{const t=e.target.id;if(t.startsWith("carousel__button")){const e=+t.split("-")[1];e!==this.selectedItem&&(this.previouslySelectedItem=this.selectedItem,this.selectedItem=e,this.updateSelectedItem(),this.startAutoSlide())}else if(t.startsWith("carousel__arrow"))t.endsWith("right")?this.goToNext():this.goToPrev(),this.startAutoSlide();else if(t.indexOf("-")>-1){const e=+t.split("-")[1],i=e-1;window.parent.clevertap&&window.clevertap.renderNotificationClicked({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot,wzrk_slideNo:e});const o=this.details[i].onClick;""!==o&&(this.details[i].window?window.open(o,"_blank"):window.location.href=o)}}))}setupOnHover(){this._carousel.addEventListener("mouseenter",(e=>{this.stopAutoSlideTimeout=setTimeout((()=>{this.autoSlide=clearInterval(this.autoSlide)}),500)})),this._carousel.addEventListener("mouseleave",(e=>{clearTimeout(this.stopAutoSlideTimeout),void 0===this.autoSlide&&this.startAutoSlide()}))}getCarouselContent(){const e=document.createElement("div");return e.setAttribute("class","carousel"),this.details.forEach(((t,i)=>{const o=document.createElement("ct-web-personalisation-banner");o.classList.add("carousel__item"),o.trackClick=!1,o.setAttribute("id","carousel__item-".concat(i+1)),o.details=t,e.appendChild(o)})),e}getStyles(){var e,t;return"\n \n ")}updateSelectedItem(){if(-1!==this.previouslySelectedItem){const e=this.shadow.getElementById("carousel__item-".concat(this.previouslySelectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.previouslySelectedItem));e.classList.remove("carousel__item--selected"),t&&t.classList.remove("carousel__button--selected")}const e=this.shadow.getElementById("carousel__item-".concat(this.selectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.selectedItem));e.classList.add("carousel__item--selected"),t&&t.classList.add("carousel__button--selected")}startAutoSlide(){clearInterval(this.autoSlide),this.autoSlide=setInterval((()=>{this.goToNext()}),this.display.sliderTime?1e3*this.display.sliderTime:3e3)}goToNext(){this.goTo(this.selectedItem,(this.selectedItem+1)%this.slides)}goToPrev(){this.goTo(this.selectedItem,this.selectedItem-1)}goTo(e,t){this.previouslySelectedItem=e,this.selectedItem=t,0===t&&(this.selectedItem=this.slides),this.updateSelectedItem()}}class Tt extends HTMLElement{constructor(){super(),this._target=null,this._session=null,this.shadow=null,this.popup=null,this.container=null,this.resizeObserver=null,this.shadow=this.attachShadow({mode:"open"})}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderImageOnlyPopup())}get session(){return this._session||""}set session(e){this._session=e}get msgId(){return this.target.wzrk_id}get pivotId(){return this.target.wzrk_pivot}get onClickUrl(){return this.target.display.onClickUrl}renderImageOnlyPopup(){const e=this.target.wzrk_id.split("_")[0],t=this.session.sessionId;this.shadow.innerHTML=this.getImageOnlyPopupContent(),this.popup=this.shadowRoot.getElementById("imageOnlyPopup"),this.container=this.shadowRoot.getElementById("container"),this.closeIcon=this.shadowRoot.getElementById("close"),this.popup.addEventListener("load",this.updateImageAndContainerWidth()),this.resizeObserver=new ResizeObserver((()=>this.handleResize(this.popup,this.container))),this.resizeObserver.observe(this.popup),this.closeIcon.addEventListener("click",(()=>{if(this.resizeObserver.unobserve(this.popup),document.getElementById("wzrkImageOnlyDiv").style.display="none",this.remove(),null!=e&&"-1"!==e&&ae._isLocalStorageSupported()){const i=Xe();let o=i.wp[t];null==o&&(o={},i[t]=o),o[e]="dnd",et(i)}})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId}),this.onClickUrl&&this.popup.addEventListener("click",(()=>{this.target.display.window?window.open(this.onClickUrl,"_blank"):window.parent.location.href=this.onClickUrl,window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})}))}handleResize(e,t){const i=this.getRenderedImageWidth(e);t.style.setProperty("width","".concat(i,"px"))}getImageOnlyPopupContent(){return"\n ".concat(this.target.msgContent.css,"\n ").concat(this.target.msgContent.html,"\n ")}updateImageAndContainerWidth(){return()=>{const e=this.getRenderedImageWidth(this.popup);this.popup.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("height","auto"),this.container.style.setProperty("position","fixed"),this.popup.style.setProperty("visibility","visible"),this.closeIcon.style.setProperty("visibility","visible"),document.getElementById("wzrkImageOnlyDiv").style.visibility="visible"}}getRenderedImageWidth(e){const t=e.naturalWidth/e.naturalHeight;return e.height*t}}class Rt extends HTMLElement{constructor(e,t){super(),this.wrapper=null,this.snackBar=null,this.shadow=this.attachShadow({mode:"open"}),this.config=e,this.message=t,this.renderMessage(t)}get pivotId(){return this.message.wzrk_pivot}get campaignId(){return this.message.wzrk_id}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}renderMessage(e){switch(this.wrapper=this.createEl("div","messageWrapper"),e.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":{const t=this.prepareBasicMessage(e.msg[0]);this.wrapper.appendChild(t)}}const t=this.createEl("div","timeStamp");if(t.innerHTML="".concat(Wt(e.id.split("_")[1]),""),!e.viewed){const e=this.createEl("span","unreadMarker");t.appendChild(e)}this.wrapper.appendChild(t),this.shadow.appendChild(this.wrapper)}prepareBasicMessage(e){const t=this.createEl("div","message");if(e.imageUrl){const i=this.addImage(e.imageUrl,"mainImg");t.appendChild(i)}const i=this.createEl("div","iconTitleDescWrapper");if(e.iconUrl){const t=this.addImage(e.iconUrl,"iconImg");i.appendChild(t)}const o=this.createEl("div","titleDescWrapper");if(e.title){const t=this.createEl("div","title");t.innerText=e.title,o.appendChild(t)}if(e.description){const t=this.createEl("div","description");t.innerText=e.description,o.appendChild(t)}if((e.title||e.description)&&i.appendChild(o),(e.iconUrl||e.title||e.description)&&t.appendChild(i),e.buttons&&e.buttons.length){const i=this.addButtons(e.buttons);t.appendChild(i)}return t}addButtons(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.createEl("div","buttonsContainer");let i=!1;return e.forEach(((e,o)=>{const n=this.createEl("button","button-".concat(o),"button");n.innerText=e.text,o>0&&(n.style.cssText+="margin-left: 2px;"),"copy"===e.action&&(i=!0),t.appendChild(n)})),i&&this.addSnackbar(t),t}addSnackbar(e){this.snackBar=this.createEl("div","snackbar-".concat(this.campaignId),"snackbar"),this.snackBar.innerHTML=Ht;const t=this.createEl("span","snackbar-msg-".concat(this.campaignId),"snackbar-msg");t.innerText="Copied to clipboard",this.snackBar.appendChild(t),e.appendChild(this.snackBar)}addImage(e,t){const i=this.createEl("div","".concat(t,"Container")),o=this.createEl("img",t);return o.setAttribute("src",e),o.setAttribute("loading","lazy"),i.appendChild(o),i}raiseClickedEvent(e,t){switch(this.message.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":this.raiseClickedForBasicTemplates(e,t)}}raiseClickedForBasicTemplates(e,t){const i=this.message.msg[0],o={msgId:this.campaignId,pivotId:this.pivotId};if("BUTTON"===e.tagName){const t=e.id.split("-")[1],n=i.buttons[t];o.kv={wzrk_c2a:n.text},"url"===n.action?n.openUrlInNewTab?window.open(n.url,"_blank"):window.location=n.url:"copy"===n.action&&(window.focus(),navigator.clipboard.writeText(n.clipboardText),this.snackBar.style.setProperty("display","flex","important"),setTimeout((()=>{this.snackBar.style.setProperty("display","none","important")}),2e3))}else"CT-INBOX-MESSAGE"===e.tagName&&i.onClickUrl&&(i.openUrlInNewTab?window.open(i.onClickUrl,"_blank"):window.location=i.onClickUrl);t?console.log("Notifiction clicked event will be raised at run time with payload ::",o):window.clevertap.renderNotificationClicked(o)}}class jt extends HTMLElement{constructor(e){super(),this.isInboxOpen=!1,this.isInboxFromFlutter=!1,this.selectedCategory=null,this.unviewedMessages={},this.unviewedCounter=0,this.isPreview=!1,this.inboxConfigForPreview={},this.inboxSelector=null,this.inbox=null,this.emptyInboxMsg=null,this.inboxCard=null,this.unviewedBadge=null,this.observer=null,this.selectedCategoryRef=null,this.addClickListenerOnDocument=(()=>e=>{if(e.composedPath().includes(this.inbox)){const t=e.path||e.composedPath&&e.composedPath();if(t.length){const e=t[0].id;if("closeInbox"===e)this.toggleInbox();else if(e.startsWith("category-"))this.prevCategoryRef=this.selectedCategoryRef,this.selectedCategoryRef=t[0],this.updateActiveCategory(t[0].innerText);else{const e=t.filter((e=>{var t;return(null===(t=e.id)||void 0===t?void 0:t.startsWith("button-"))||"CT-INBOX-MESSAGE"===e.tagName}));if(e.length){e[e.length-1].raiseClickedEvent(e[0],this.isPreview)}}}}else(this.inboxSelector.contains(e.target)||this.isInboxOpen)&&(this.isInboxFromFlutter?this.isInboxFromFlutter=!1:this.toggleInbox(e))})(),this.setBadgeStyle=e=>{null!==this.unviewedBadge&&(this.unviewedBadge.innerText=e>9?"9+":e,this.unviewedBadge.style.display=e>0?"flex":"none")},this.logger=e,this.shadow=this.attachShadow({mode:"open"})}get incomingMessages(){return[]}set incomingMessages(e){void 0===e&&(e=[]),e.length>0&&this.inbox&&this.updateInboxMessages(e)}get incomingMessagesForPreview(){return[]}set incomingMessagesForPreview(e){void 0===e&&(e=[]);const t={};e.length>0&&this.inbox&&(this.isPreview=!0,this.unviewedCounter=0,e.forEach((e=>{const i="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=i,t[i]=e,this.unviewedMessages[i]=e,this.unviewedCounter++})),this.buildUIForMessages(t),this.updateUnviewedBadgeCounter())}connectedCallback(){this.init()}init(){this.config=this.isPreview?this.inboxConfigForPreview:ae.readFromLSorCookie(q)||{},0!==Object.keys(this.config).length&&(this.inboxSelector=document.getElementById(this.config.inboxSelector),null!==this.inboxSelector&&(this.config.styles.notificationsBadge?this.addUnviewedBadge():this.unviewedBadge&&this.unviewedBadge.remove(),this.createinbox(),document.removeEventListener("click",this.addClickListenerOnDocument),document.addEventListener("click",this.addClickListenerOnDocument),this.config.categories.length&&this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadow.innerHTML=this.getInboxStyles(),this.shadow.appendChild(this.inbox)))}addMsgsToInboxFromLS(){const e=this.deleteExpiredAndGetUnexpiredMsgs(!1),t=e?Object.keys(e):[];0!==t.length&&(t.forEach((t=>{e[t].viewed||(this.unviewedMessages[t]=e[t],this.unviewedCounter++)})),this.buildUIForMessages(e),this.updateUnviewedBadgeCounter())}deleteExpiredAndGetUnexpiredMsgs(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Nt();const i=Math.floor(Date.now()/1e3);for(const o in t)if(t[o].wzrk_ttl&&t[o].wzrk_ttl>0&&t[o].wzrk_ttl0&&(t=Object.values(t).sort(((e,t)=>t.date-e.date)).reduce(((e,t)=>(e[t.id]=t,e)),{})),Ft(t),t}updateInboxMessages(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.deleteExpiredAndGetUnexpiredMsgs(),i=Date.now(),o={};e.forEach(((e,n)=>{const s="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=s,e.date=i-n,e.viewed=0,t[s]=e,o[s]=e,this.unviewedMessages[s]=e,this.unviewedCounter++})),Ft(t),this.buildUIForMessages(o),this.updateUnviewedBadgeCounter()}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}addUnviewedBadge(){this.unviewedBadge||(this.unviewedBadge=this.createEl("div","unviewedBadge"),this.unviewedBadge.style.cssText="display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ".concat(this.config.styles.notificationsBadge.backgroundColor,"; font-size: 12px; color: ").concat(this.config.styles.notificationsBadge.textColor,"; font-weight: bold; align-items: center; justify-content: center;"),document.body.appendChild(this.unviewedBadge)),this.updateUnviewedBadgePosition(),window.addEventListener("resize",(()=>{this.updateUnviewedBadgePosition()}))}updateUnviewedBadgePosition(){const{top:e,right:t}=this.inboxSelector.getBoundingClientRect();this.unviewedBadge.style.top="".concat(e-8,"px"),this.unviewedBadge.style.left="".concat(t-8,"px")}createinbox(){this.inbox=this.createEl("div","inbox");const e=this.createEl("div","header"),t=this.createEl("div","headerTitle");t.innerText=this.config.title;const i=this.createEl("div","closeInbox");if(i.innerHTML="×",e.appendChild(t),e.appendChild(i),this.inbox.appendChild(e),this.config.categories.length){const e=this.createCategories();this.inbox.appendChild(e)}this.inboxCard=this.createEl("div","inboxCard"),this.inbox.appendChild(this.inboxCard),this.emptyInboxMsg=this.createEl("div","emptyInboxMsg"),this.emptyInboxMsg.innerText="All messages will be displayed here.",this.inboxCard.appendChild(this.emptyInboxMsg);const o={root:this.inboxCard,rootMargin:"0px",threshold:.5};this.observer=new IntersectionObserver(((e,t)=>{this.handleMessageViewed(e)}),o),this.addMsgsToInboxFromLS()}createCategories(){const e=this.createEl("div","categoriesContainer"),t=this.createEl("div","leftArrow");t.innerHTML=Gt,t.children[0].style="transform: rotate(180deg)",t.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(-70,0)})),e.appendChild(t);const i=this.createEl("div","categoriesWrapper");["All",...this.config.categories].forEach(((e,t)=>{const o=this.createEl("div","category-".concat(t),"category");o.innerText=e,0===t&&(this.selectedCategoryRef=o),i.appendChild(o)})),e.appendChild(i);const o=this.createEl("div","rightArrow");o.innerHTML=Gt,o.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(70,0)})),e.appendChild(o);const n={root:e,threshold:.9},s=i.children[0],r=i.children[this.config.categories.length];new IntersectionObserver((e=>{this.categoryObserverCb(t,e[0].intersectionRatio>=.9)}),n).observe(s);return new IntersectionObserver((e=>{this.categoryObserverCb(o,e[0].intersectionRatio>=.9)}),n).observe(r),e}categoryObserverCb(e,t){e&&(e.style.display=t?"none":"flex")}updateActiveCategory(e){this.selectedCategory=e,this.inboxCard.scrollTop=0;let t=0;this.prevCategoryRef&&this.prevCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef.setAttribute("selected","true"),this.inboxCard.childNodes.forEach((e=>{"emptyInboxMsg"!==e.getAttribute("id")&&(e.style.display="All"===this.selectedCategory||e.getAttribute("category")===this.selectedCategory?"block":"none","block"===e.style.display&&t++)})),0===t?(this.emptyInboxMsg.innerText="".concat(e," messages will be displayed here."),this.emptyInboxMsg.style.display="block"):this.emptyInboxMsg.style.display="none"}buildUIForMessages(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!this.isPreview&&this.updateTSForRenderedMsgs(),this.inboxCard.scrollTop=0;const i=null!==(e=this.config.maxMsgsInInbox)&&void 0!==e?e:15,o=this.inboxCard.firstChild,n=Object.values(t).sort(((e,t)=>t.date-e.date)).map((e=>e.id));for(const e of n){const i=new Rt(this.config,t[e]);i.setAttribute("id",t[e].id),i.setAttribute("pivot",t[e].wzrk_pivot),i.setAttribute("part","ct-inbox-message"),this.config.categories.length>0?(i.setAttribute("category",t[e].tags[0]||""),i.style.display="All"===this.selectedCategory||t[e].category===this.selectedCategory?"block":"none"):i.style.display="block",this.inboxCard.insertBefore(i,o),this.observer.observe(i)}let s=this.inboxCard.querySelectorAll("ct-inbox-message").length;for(;s>i;){const e=this.inboxCard.querySelectorAll("ct-inbox-message");e.length>0&&e[e.length-1].remove(),s--}const r=this.inboxCard.querySelectorAll('ct-inbox-message[style*="display: block"]').length;this.emptyInboxMsg.style.display=r?"none":"block"}handleMessageViewed(e){const t=!this.isPreview;this.isInboxOpen&&e.forEach((e=>{e.isIntersecting&&this.unviewedMessages.hasOwnProperty(e.target.id)&&0===e.target.message.viewed&&(e.target.message.viewed=1,t?(window.clevertap.renderNotificationViewed({msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.updateMessageInLS(e.target.id,{...e.target.message,viewed:1}),setTimeout((()=>{e.target.shadowRoot.getElementById("unreadMarker").style.display="none"}),1e3)):console.log("Notifiction viewed event will be raised at run time with payload ::",{msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.unviewedCounter--,this.updateUnviewedBadgeCounter(),delete this.unviewedMessages[e.target.id])}))}updateMessageInLS(e,t){if(!this.isPreview){const i=Nt();i[e]=t,Ft(i)}}toggleInbox(e){this.isInboxOpen=!this.isInboxOpen,this.isInboxFromFlutter=!!(null==e?void 0:e.rect),this.isInboxOpen?(this.inboxCard.scrollTop=0,!this.isPreview&&this.deleteExpiredAndGetUnexpiredMsgs(),this.inbox.style.display="block",this.inbox.style.zIndex="2147483647",this.config.categories.length&&(this.selectedCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef=this.shadowRoot.getElementById("category-0"),this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadowRoot.getElementById("categoriesWrapper").scrollLeft-=this.shadowRoot.getElementById("categoriesWrapper").scrollWidth),this.setInboxPosition(e)):this.inbox.style.display="none"}setInboxPosition(e){const t=window.outerWidth,i=getComputedStyle(le.inbox),o=i.getPropertyValue("--inbox-top"),n=i.getPropertyValue("--inbox-bottom"),s=i.getPropertyValue("--inbox-left"),r=i.getPropertyValue("--inbox-right");if(t>481&&!(o||n||s||r)){const t=Vt(e,this.inbox.clientHeight,this.inbox.clientWidth),i=t.xPos,o=t.yPos;this.inbox.style.top=o+"px",this.inbox.style.left=i+"px"}}updateUnviewedBadgeCounter(){if(this.isPreview)return void this.setBadgeStyle(this.unviewedCounter);let e=0;this.inboxCard.querySelectorAll("ct-inbox-message").forEach((t=>{const i=Nt();i[t.id]&&0===i[t.id].viewed&&e++})),this.setBadgeStyle(e)}updateTSForRenderedMsgs(){this.inboxCard.querySelectorAll("ct-inbox-message").forEach((e=>{const t=e.id.split("_")[1];e.shadow.getElementById("timeStamp").firstChild.innerText=Wt(t)}))}getInboxStyles(){const e=this.config.categories.length?64:16,t={panelBackgroundColor:this.config.styles.panelBackgroundColor,panelBorderColor:this.config.styles.panelBorderColor,headerBackgroundColor:this.config.styles.header.backgroundColor,headerTitleColor:this.config.styles.header.titleColor,closeIconColor:this.config.styles.closeIconColor,categoriesTabColor:this.config.styles.categories.tabColor,categoriesTitleColor:this.config.styles.categories.titleColor,selectedCategoryTabColor:this.config.styles.categories.selectedTab.tabColor,selectedCategoryTitleColor:this.config.styles.categories.selectedTab.titleColor,headerCategoryHeight:36+e};this.config.styles.categories.borderColor&&(t.categoriesBorderColor=this.config.styles.categories.borderColor),this.config.styles.categories.selectedTab.borderColor&&(t.selectedCategoryBorderColor=this.config.styles.categories.selectedTab.borderColor);const i=(e=>{let{panelBackgroundColor:t,panelBorderColor:i,headerBackgroundColor:o,headerTitleColor:n,closeIconColor:s,categoriesTabColor:r,categoriesTitleColor:a,categoriesBorderColor:l,selectedCategoryTabColor:c,selectedCategoryTitleColor:d,selectedCategoryBorderColor:h,headerCategoryHeight:u}=e;return'\n \n ")})(t),o=this.config.styles.cards;return i+(e=>{let{backgroundColor:t,borderColor:i,titleColor:o,descriptionColor:n,buttonColor:s,buttonTextColor:r,unreadMarkerColor:a}=e;return'\n \n ")})({backgroundColor:o.backgroundColor,borderColor:o.borderColor,titleColor:o.titleColor,descriptionColor:o.descriptionColor,buttonColor:o.buttonColor,buttonTextColor:o.buttonTextColor,unreadMarkerColor:o.unreadMarkerColor})}}const Dt=e=>{e.inbox_preview?le.inbox.incomingMessagesForPreview=e.inbox_notifs:le.inbox.incomingMessages=e},zt=e=>{qt(),le.inbox=new jt({logger:e}),document.body.appendChild(le.inbox)},Bt=e=>{const t=ae.readFromLSorCookie(V)||{};if(Object.keys(t).length>0&&Object.keys(t)[0].includes("_")){const i={};return i[e]=t,ae.saveToLSorCookie(V,i),i}return t},Nt=()=>{const e=JSON.parse(decodeURIComponent(ae.read(b)));if(!X(e))return{};const t=Bt(e);return t.hasOwnProperty(e)?t[e]:{}},Ft=e=>{const t=JSON.parse(decodeURIComponent(ae.read(b)));if(!X(t))return;const i={...Bt(t),[t]:e};ae.saveToLSorCookie(V,i)},Ut=e=>new Promise(((t,i)=>{if("complete"===document.readyState)zt(e),t();else{const i=ae.readFromLSorCookie(q)||{},o=()=>{null===le.inbox&&zt(e),t()};window.addEventListener("load",(()=>{if(document.getElementById(i.inboxSelector))o();else{let n=0;if(n<20){const s=setInterval((()=>{document.getElementById(i.inboxSelector)?(o(),clearInterval(s),t()):n>=20&&(clearInterval(s),e.debug("Failed to add inbox")),n++}),500)}}}))}})),qt=()=>{void 0===customElements.get("ct-web-inbox")&&(customElements.define("ct-web-inbox",jt),customElements.define("ct-inbox-message",Rt))},Vt=(e,t,i)=>{const o=document.scrollingElement.scrollLeft,n=document.scrollingElement.scrollTop,s=window.innerWidth+o,r=window.innerHeight+n,a=e.rect||e.target.getBoundingClientRect(),l=a.x+o,c=a.y+n,d=a.left+o,h=a.right+o,u=a.top+n,p=a.bottom,g=a.height,f=a.width;let v,b,m=!1;const y=16;if(p+t<=r){const e=r-(p+t);b=e>=y?p+y:p+e}else if(u-t>=n){const e=u-t;b=e>=y?u-t-y:u-t-e}else m=!0,b=c+g/2-t/2,br&&(b=r-t);if(m){const e=h+i;if(e<=s){v=h+(e+y<=s?y:s-e)}else{const e=d-i;v=e-(e-y>=o?y:e-o)}}else v=l+f/2-i/2,vs&&(v=h-i>=o?h-i:s-i);return{xPos:v,yPos:b}},Wt=e=>{const t=Date.now();let i=Math.floor((t-e)/6e4);return i<5?"Just now":i<60?"".concat(i," minute").concat(i>1?"s":""," ago"):(i=Math.floor(i/60),i<24?"".concat(i," hour").concat(i>1?"s":""," ago"):(i=Math.floor(i/24),"".concat(i," day").concat(i>1?"s":""," ago")))},Kt=()=>Object.keys(ae.readFromLSorCookie(q)||{}).length>0,Gt='\n\n\n',Ht='\n\n\n',Jt=(e,t)=>{document.addEventListener("DOMContentLoaded",(()=>function(e,t){document.body.innerHTML="",Zt=document.createElement("div"),Zt.id="overlayDiv",Zt.style.position="relative",Zt.style.display="flex",document.body.appendChild(Zt);(function(e,t,i){return new Promise(((o,n)=>{var s=document.createElement("script");s.type="module",s.src=e,s.onload=function(){"function"==typeof window.Overlay?(window.Overlay("#overlayDiv",t,i),o()):n(new Error("ContentLayout not found in overlay.js"))},s.onerror=function(e){n(e)},document.head.appendChild(s)}))})("https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js",e,t).then((()=>{console.log("Overlay script loaded successfully.")})).catch((e=>{console.error("Error loading overlay script:",e)})),d=document.createElement("link"),d.rel="stylesheet",d.type="text/css",d.href="https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css",document.head.appendChild(d),o={kitId:"eqj6nom",scriptTimeout:3e3,async:!0},n=document,s=n.documentElement,r=setTimeout((function(){s.className=s.className.replace(/\bwf-loading\b/g,"")+" wf-inactive"}),o.scriptTimeout),a=n.createElement("script"),l=!1,c=n.getElementsByTagName("script")[0],s.className+=" wf-loading",a.src="https://use.typekit.net/"+o.kitId+".js",a.async=!0,a.onload=a.onreadystatechange=function(){if(i=this.readyState,!(l||i&&"complete"!==i&&"loaded"!==i)){l=!0,clearTimeout(r);try{Typekit.load(o)}catch(e){}}},c.parentNode.insertBefore(a,c);var i,o,n,s,r,a,l,c;var d}(e,t)))};let Zt;const $t=(e,t)=>{const i=e.display.details[0],o=Object.keys(i)[0],n=i[o];if(o===window.location.href)for(const i in n){const o=document.querySelector(i);if(o)n[i].html&&(o.outerHTML=n[i].html),t||window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot});else{let o=0;const s=setInterval((()=>{const r=document.querySelector(i);r?(n[i].html&&(r.outerHTML=n[i].html),t||window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot}),clearInterval(s)):(o++,o>=20&&(console.log("No element present on DOM with selector '".concat(i,"'.")),clearInterval(s)))}),500)}}},Yt=(e,t)=>{let{device:i,session:o,request:n,logger:s}=t;const r=i,a=o,l=n,c=s;let d=0;const h=t=>{const i=t.wzrk_id.split("_")[0],o=ie(),n=(e,t,i)=>{let o=0,n=0;null!=e[t]&&(o=e[t]),o++,null!=e.tc&&(n=e.tc),i<0&&n++,e.tc=n,e[t]=o};if(ae._isLocalStorageSupported()){delete sessionStorage.WZRK_CAMP;var s={};const e=Xe();s=3===t.display.wtarget_type&&e.hasOwnProperty("wi")?e.wi:0!==t.display.wtarget_type&&1!==t.display.wtarget_type||!e.hasOwnProperty("wp")?{}:e.wp,e.hasOwnProperty("global")&&(s.wp=e),null==t.display.wmc&&(t.display.wmc=1),null==t.display.wimc&&(t.display.wimc=1);var d=-1;let n=-1,r=-1,l=-1,c=-1,g=-1,f=-1;null!=t.display.efc&&(d=parseInt(t.display.efc,10)),null!=t.display.mdc&&(n=parseInt(t.display.mdc,10)),null!=t.display.tdc&&(r=parseInt(t.display.tdc,10)),null!=t.display.tlc&&(l=parseInt(t.display.tlc,10)),null!=t.display.wmp&&(c=parseInt(t.display.wmp,10)),null!=t.display.wmc&&(g=parseInt(t.display.wmc,10)),null!=t.display.wimc&&(f=parseInt(t.display.wimc,10));var h=s[a.sessionId];if(h){const e=h[i],o=h.tc;if("dnd"===e&&!le.dismissSpamControl)return!1;if(3===t.display.wtarget_type){if(f>0&&o>=f&&d<0)return!1}else if(g>0&&o>=g&&d<0)return!1;if(n>0&&e>=n)return!1}else h={},s[a.sessionId]=h;var u=s[o];if(null!=u){const e=u[i],t=u.tc;if(c>0&&t>=c&&d<0)return!1;if(r>0&&e>=r)return!1}else u={},s[o]=u;var p=s.global;if(null!=p){const e=p[i];if(l>0&&e>=l)return!1}else p={},s.global=p}if(null!=t.display.delay&&t.display.delay>0){const i=t.display.delay;return t.display.delay=0,setTimeout(Yt,1e3*i,e,{device:r,session:a,request:l,logger:c}),!1}n(h,i,d),n(u,i,d),n(p,i,d);let g="wp";3===t.display.wtarget_type&&(g="wi");const f={};f[a.sessionId]=h,f[o]=u,f.global=p,et({[g]:f})},u=()=>{const e=r.getGuid(),t=a.getSessionCookieObject();return"&t=wc&d="+encodeURIComponent(He(e+"|"+t.p+"|"+t.s))},p=(e,t)=>{const i=window.parent[e];"function"==typeof i&&(null!=t.display.kv?i(t.display.kv):i())},g=(e,t,i,o,n)=>{f(t),((e,t,i,o,n)=>{if(""!==e&&null!=e){let o,s;n?o=i:null!==i&&(s=i.getElementsByClassName("jsCT_CTA"),null!=s&&1===s.length&&(o=s[0]));const r=t.display.jsFunc,l=t.display.preview;null==l&&(e+=u()),null!=o&&(o.onclick=()=>{if(null!=r)return null==l&&Qe.fireRequest(e),p(r,t),void at("-1",0,a.sessionId);1===t.display.window?window.open(e,"_blank"):window.location=e})}})(e,t,i,0,n)},f=e=>{const t={type:"event"};t.evtName=R,t.evtData={[T]:e.wzrk_id},e.wzrk_pivot&&(t.evtData={...t.evtData,wzrk_pivot:e.wzrk_pivot}),l.processEvent(t)},v=e=>{var t;void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Lt);const i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,o=document.createElement("ct-web-personalisation-banner");o.msgId=e.wzrk_id,o.pivotId=e.wzrk_pivot,o.divHeight=e.display.divHeight,o.details=e.display.details[0];const n=e.display.divId?document.getElementById(i):document.querySelector(i);n.innerHTML="",n.appendChild(o)},m=e=>{var t;void 0===customElements.get("ct-web-personalisation-carousel")&&customElements.define("ct-web-personalisation-carousel",Mt);const i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,o=document.createElement("ct-web-personalisation-carousel");o.target=e;const n=e.display.divId?document.getElementById(i):document.querySelector(i);n.innerHTML="",n.appendChild(o)},y=e=>{const t=e.wzrk_id.split("_")[0],i=e.display;if(2===i.wtarget_type&&1===e.msgContent.type){const t={};t.msgId=e.wzrk_id,e.wzrk_pivot&&(t.pivotId=e.wzrk_pivot),null!=e.msgContent.kv&&(t.kv=e.msgContent.kv);const i=new CustomEvent("CT_web_native_display",{detail:t});return void document.dispatchEvent(i)}if(1===i.layout)return O(void 0,e);if(3===i.layout){const t="wzrkImageOnlyDiv";if(!1===h(e))return;if(le.dismissSpamControl&&null!=document.getElementById(t)){document.getElementById(t).remove()}if(null!=document.getElementById(t)||null!=document.getElementById("intentPreview"))return;const i=document.createElement("div");return i.id=t,document.body.appendChild(i),void 0===customElements.get("ct-web-popup-imageonly")&&customElements.define("ct-web-popup-imageonly",Tt),(e=>{const t=document.createElement("ct-web-popup-imageonly");t.session=a,t.target=e;const i=document.getElementById("wzrkImageOnlyDiv");i.innerHTML="",i.style.visibility="hidden",i.appendChild(t)})(e)}if(!1===h(e))return;const o="wizParDiv"+i.layout;if(le.dismissSpamControl&&null!=document.getElementById(o)){document.getElementById(o).remove()}if(null!=document.getElementById(o))return;le.campaignDivMap[t]=o;const n=2===i.layout,s=document.createElement("div");s.id=o;const r=window.innerHeight,l=window.innerWidth;let c=!1;if(n)s.setAttribute("style",i.iFrameStyle);else{var d=10;let e=5*l/100,t=d+5*r/100,o=30*l/100+20,n="width:30%;";(/mobile/i.test(navigator.userAgent)||/mini/i.test(navigator.userAgent))&&!1===/iPad/i.test(navigator.userAgent)?(o=85*l/100+20,e=5*l/100,t=5*r/100,n="width:80%;"):("ontouchstart"in window||/tablet/i.test(navigator.userAgent))&&(o=50*l/100+20,e=5*l/100,t=5*r/100,n="width:50%;"),null==i.proto?(c=!0,s.setAttribute("style","display:block;overflow:hidden; bottom:"+t+"px !important;width:"+o+"px !important;right:"+e+"px !important;position:fixed;z-index:2147483647;")):s.setAttribute("style",n+i.iFrameStyle)}document.body.appendChild(s);const u=document.createElement("iframe"),p=!1===i.br?"0":"8";u.frameborder="0px",u.marginheight="0px",u.marginwidth="0px",u.scrolling="no",u.id="wiz-iframe";const f=e.display.onClick;let v,b="";if(""!==f&&null!=f&&(b="cursor:pointer;"),1===e.msgContent.type)v=e.msgContent.html,v=v.replace(/##campaignId##/g,t),v=v.replace(/##campaignId_batchId##/g,e.wzrk_id);else{const i='";let n,s,r,a,l;"dark"===e.display.theme?(n="#2d2d2e",s="#eaeaea",r="#353535",a="#353535",l="#ffffff"):(n="#ffffff",s="#000000",a="#f4f4f4",r="#a5a6a6",l="#ffffff");const c=e.msgContent.title,d=e.msgContent.description;let h="";null!=e.msgContent.imageUrl&&""!==e.msgContent.imageUrl&&(h="");v=i+("
×
"+h+"
"+c+"
")+("
"+d+"
")}u.setAttribute("style","z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;"),s.appendChild(u);const m=(u.contentWindow?u.contentWindow:u.contentDocument.document?u.contentDocument.document:u.contentDocument).document,y=new Event("CT_campaign_rendered");document.dispatchEvent(y),m.open(),m.write(v),i["custom-editor"]&&k(e,m),m.close();const w=()=>{d=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv").scrollHeight,!0===i["custom-editor"]||n||(d+=25),document.getElementById("wiz-iframe").contentDocument.body.style.margin="0px",document.getElementById("wiz-iframe").style.height=d+"px"},C=navigator.userAgent.toLowerCase();if(-1!==C.indexOf("safari"))if(C.indexOf("chrome")>-1)u.onload=()=>{w();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)};else{let t=u.contentDocument||u.contentWindow;t.document&&(t=t.document),w();const i=setInterval((()=>{if("complete"===t.readyState){clearInterval(i),w();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)}}),10)}else u.onload=()=>{w();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)}},k=(e,t)=>{const i=t.createElement("script");i.innerHTML="\n const ct__camapignId = '".concat(e.wzrk_id,"';\n const ct__formatVal = (v) => {\n return v && v.trim().substring(0, 20);\n }\n const ct__parentOrigin = window.parent.origin;\n document.body.addEventListener('click', (event) => {\n const elem = event.target.closest?.('a[wzrk_c2a], button[wzrk_c2a]');\n if (elem) {\n const {innerText, id, name, value, href} = elem;\n const clickAttr = elem.getAttribute('onclick') || elem.getAttribute('click');\n const onclickURL = clickAttr?.match(/(window.open)[(](\"|')(.*)(\"|',)/)?.[3] || clickAttr?.match(/(location.href *= *)(\"|')(.*)(\"|')/)?.[3];\n const props = {innerText, id, name, value};\n let msgCTkv = Object.keys(props).reduce((acc, c) => {\n const formattedVal = ct__formatVal(props[c]);\n formattedVal && (acc['wzrk_click_' + c] = formattedVal);\n return acc;\n }, {});\n if(onclickURL) { msgCTkv['wzrk_click_' + 'url'] = onclickURL; }\n if(href) { msgCTkv['wzrk_click_' + 'c2a'] = href; }\n const notifData = { msgId: ct__camapignId, msgCTkv, pivotId: '").concat(e.wzrk_pivot,"' };\n window.parent.clevertap.renderNotificationClicked(notifData);\n }\n });\n "),t.body.appendChild(i)};let x=!1;const S=e=>{let t=e.display.onClick;if(window.clevertap.hasOwnProperty("notificationCallback")&&void 0!==window.clevertap.notificationCallback&&"function"==typeof window.clevertap.notificationCallback){const i=window.clevertap.notificationCallback;if(!x){const o={};o.msgContent=e.msgContent,o.msgId=e.wzrk_id,e.wzrk_pivot&&(o.pivotId=e.wzrk_pivot),null!=e.display.kv&&(o.kv=e.display.kv),window.clevertap.raiseNotificationClicked=()=>{if(""!==t&&null!=t){const i=e.display.jsFunc;if(t+=u(),null!=i)return Qe.fireRequest(t),void p(i,e);1===e.display.window?window.open(t,"_blank"):window.location=t}},window.clevertap.raiseNotificationViewed=()=>{f(e)},i(o),x=!0}}else if(window.clevertap.popupCurrentWzrkId=e.wzrk_id,y(e),window.clevertap.hasOwnProperty("popupCallbacks")&&void 0!==window.clevertap.popupCallbacks&&"function"==typeof window.clevertap.popupCallbacks[e.wzrk_id]){const t=window.clevertap.popupCallbacks[e.wzrk_id],n={};n.msgContent=e.msgContent,n.msgId=e.wzrk_id,e.wzrk_pivot&&(n.pivotId=e.wzrk_pivot);var i=[];for(var o in e)if(o.startsWith(M)&&o!==T){const t={[o]:e[o]};i.push(t)}i.length>0&&(n.msgCTkv=i),null!=e.display.kv&&(n.kv=e.display.kv),window.clevertap.raisePopupNotificationClicked=t=>{if(!t||!t.msgId)return;const i={type:"event"};if(i.evtName=j,i.evtData={[T]:t.msgId},e.wzrk_pivot&&(i.evtData={...i.evtData,wzrk_pivot:t.pivotId}),t.msgCTkv)for(var o of t.msgCTkv)i.evtData={...i.evtData,...o};l.processEvent(i)},t(n)}};let I;const O=(e,t)=>{let i;if(null!=e&&e.clientY>0)return;if(i=null==t?I:t,le.dismissSpamControl&&0===i.display.wtarget_type&&null!=document.getElementById("intentPreview")&&null!=document.getElementById("intentOpacityDiv")){document.getElementById("intentPreview").remove(),document.getElementById("intentOpacityDiv").remove()}if(null!=document.getElementById("intentPreview")||null!=document.getElementById("wzrkImageOnlyDiv"))return;if(null==i.display.layout&&(/mobile/i.test(navigator.userAgent)||/mini/i.test(navigator.userAgent)||/iPad/i.test(navigator.userAgent)||"ontouchstart"in window||/tablet/i.test(navigator.userAgent)))return;if(!1===h(i))return;const o=i.wzrk_id.split("_")[0];le.campaignDivMap[o]="intentPreview";let n=!1;const s=document.createElement("div");s.id="intentOpacityDiv";const r=i.display.opacity||.7,a="rgba(0,0,0,".concat(r,")");s.setAttribute("style","position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ".concat(a,";")),document.body.appendChild(s);const l=document.createElement("div");l.id="intentPreview",null==i.display.proto?(n=!0,l.setAttribute("style","display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;")):l.setAttribute("style",i.display.iFrameStyle),document.body.appendChild(l);const c=document.createElement("iframe"),d=!1===i.display.br?"0":"8";c.frameborder="0px",c.marginheight="0px",c.marginwidth="0px",c.scrolling="no",c.id="wiz-iframe-intent";const u=i.display.onClick;let p,f="";if(""!==u&&null!=u&&(f="cursor:pointer;"),1===i.msgContent.type)p=i.msgContent.html,p=p.replace(/##campaignId##/g,o),p=p.replace(/##campaignId_batchId##/g,i.wzrk_id);else{const e='";let t,n,s,r;"dark"===i.display.theme?(t="#2d2d2e",n="#eaeaea",s="#353535",r="#ffffff"):(t="#ffffff",n="#000000",s="#a5a6a6",r="#ffffff");const a=i.msgContent.title,l=i.msgContent.description;let c="";null!=i.msgContent.ctaText&&""!==i.msgContent.ctaText&&(c="");let h="";null!=i.msgContent.imageUrl&&""!==i.msgContent.imageUrl&&(h="
+a+
");p=e+("
×
"+a+"
")+("
"+l+"
"+h+c+"
")}c.setAttribute("style","z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;"),l.appendChild(c);const v=(c.contentWindow?c.contentWindow:c.contentDocument.document?c.contentDocument.document:c.contentDocument).document,b=new Event("CT_campaign_rendered");document.dispatchEvent(b),v.open(),v.write(p),i.display["custom-editor"]&&k(i,v),v.close();const m=document.getElementById("wiz-iframe-intent").contentDocument.getElementById("contentDiv");g(u,i,m,0,n)};if(!document.body)return void(d<6&&(d++,setTimeout(Yt,1e3,e,{device:r,session:a,request:l,logger:c})));const _=e=>{Object.keys(e).map((t=>{var i,o;e[t].display.divId?(i=e[t].display.divId,o=document.getElementById(i)):(i=e[t].display.divSelector,o=document.querySelector(i)),null!==o&&(2===e[t].msgContent.type?v(e[t]):m(e[t]),delete e[t])}))};if(null!=e.inapp_notifs){const t={};for(let i=0;i{window.addEventListener("load",(()=>{let t=0;if(t<20){const i=setInterval((()=>{_(e),0!==Object.keys(e).length&&20!==t||(clearInterval(i),e={}),t++}),500)}}))})(t))}const E=()=>{if(e.inbox_preview)Dt(e);else if(e.inbox_notifs){const t=[];for(let i=0;i1&&void 0!==arguments[1]&&arguments[1];const i=ae.readFromLSorCookie(q)||{};t?(le.inbox.inboxConfigForPreview=e,le.inbox.isPreview=!0,le.inbox&&le.inbox.init()):JSON.stringify(i)!==JSON.stringify(e)&&(ae.saveToLSorCookie(q,e),le.inbox&&le.inbox.init())}(e.webInboxSetting),Ut(c).then((()=>{E()})).catch((e=>{}))):E()),e.vars)return void le.variableStore.mergeVariables(e.vars);const A=(e,t)=>{const i=Xe(),o=i[t].global;if(null!=o&&t)for(const i in e)if(e.hasOwnProperty(i)&&(delete o[e[i]],ae.read(w))){const o=JSON.parse(decodeURIComponent(ae.read(w))),n=JSON.parse(decodeURIComponent(ae.read(b)));o[n]&&o[n][t]&&o[n][t][e[i]]&&(delete o[n][t][e[i]],ae.save(w,encodeURIComponent(JSON.stringify(o))))}et(i)};if(ae._isLocalStorageSupported())try{if(null!=e.evpr){const t=e.evpr.events,i=e.evpr.profile,o=e.evpr.expires_in,n=oe();ae.setMetaProp("lsTime",n),ae.setMetaProp("exTs",o),(e=>{if(null!=le.globalEventsMap||(le.globalEventsMap=ae.readFromLSorCookie(C),null!=le.globalEventsMap)){for(const t in e)if(e.hasOwnProperty(t)){const i=le.globalEventsMap[t],o=e[t];null!=le.globalEventsMap[t]?null!=o[0]&&o[0]>i[0]&&(le.globalEventsMap[t]=o):le.globalEventsMap[t]=o}}else le.globalEventsMap=e})(t),ae.saveToLSorCookie(C,le.globalEventsMap),null==le.globalProfileMap?rt(i,!0):rt(i,!1)}null!=e.arp&&(e=>{if(null!=e.skipResARP&&e.skipResARP)return console.debug("Update ARP Request rejected",e),null;const t=!0===e.isOUL;if(ae._isLocalStorageSupported())try{let i=ae.readFromLSorCookie(P);if(null==i||t){i={};for(const t in e)e.hasOwnProperty(t)&&(-1===e[t]?delete i[t]:i[t]=e[t]);ae.saveToLSorCookie(P,i)}}catch(e){console.error("Unable to parse ARP JSON: "+e)}})(e.arp),null!=e.inapp_stale&&e.inapp_stale.length>0&&A(e.inapp_stale,"wp"),null!=e.inbox_stale&&e.inbox_stale.length>0&&A(e.inbox_stale,"wi")}catch(e){c.error("Unable to persist evrp/arp: "+e)}};var Qt=t("isPersonalisationActive");class Xt{constructor(e){let{isPersonalisationActive:t}=e;Object.defineProperty(this,Qt,{writable:!0,value:void 0}),i(this,Qt)[Qt]=t}getTotalVisits(){if(!i(this,Qt)[Qt]())return;let e=ae.getMetaProp("sc");return null==e&&(e=1),e}getLastVisit(){if(!i(this,Qt)[Qt]())return;const e=ae.getMetaProp("ps");return null!=e?new Date(1e3*e):void 0}}const ei=1,ti=2,ii=3,oi=4;var ni=t("logLevel"),si=t("log"),ri=t("isLegacyDebug");class ai{constructor(e){Object.defineProperty(this,ri,{get:ci,set:void 0}),Object.defineProperty(this,si,{value:li}),Object.defineProperty(this,ni,{writable:!0,value:void 0}),this.wzrkError={},i(this,ni)[ni]=null==e?e:ti,this.wzrkError={}}get logLevel(){return i(this,ni)[ni]}set logLevel(e){i(this,ni)[ni]=e}error(e){i(this,ni)[ni]>=ei&&i(this,si)[si]("error",e)}info(e){i(this,ni)[ni]>=ti&&i(this,si)[si]("log",e)}debug(e){(i(this,ni)[ni]>=ii||i(this,ri)[ri])&&i(this,si)[si]("debug",e)}debugPE(e){i(this,ni)[ni]>=oi&&i(this,si)[si]("debug_pe",e)}reportError(e,t){this.wzrkError.c=e,this.wzrkError.d=t,this.error("".concat(Ce," ").concat(e,": ").concat(t))}}var li=function(e,t){if(window.console)try{const i=(new Date).getTime();console[e]("CleverTap [".concat(i,"]: ").concat(t))}catch(e){}},ci=function(){return"undefined"!=typeof sessionStorage&&""===sessionStorage.WZRK_D},di=t("logger"),hi=t("sessionId"),ui=t("isPersonalisationActive");class pi{constructor(e){let{logger:t,isPersonalisationActive:o}=e;Object.defineProperty(this,di,{writable:!0,value:void 0}),Object.defineProperty(this,hi,{writable:!0,value:void 0}),Object.defineProperty(this,ui,{writable:!0,value:void 0}),this.cookieName=void 0,this.scookieObj=void 0,this.sessionId=ae.getMetaProp("cs"),i(this,di)[di]=t,i(this,ui)[ui]=o}get sessionId(){return i(this,hi)[hi]}set sessionId(e){i(this,hi)[hi]=e}getSessionCookieObject(){let e=ae.readCookie(this.cookieName),t={};if(null!=e)if(e=e.replace(p,'"'),t=JSON.parse(e),J(t)){if(void 0!==t.t){const e=t.t;oe()-e>1260&&(t={})}}else t={};return this.scookieObj=t,t}setSessionCookieObject(e){const t=JSON.stringify(e);ae.createBroadCookie(this.cookieName,t,1200,We())}manageSession(e){if(void 0===this.sessionId||this.sessionId!==e){const t=ae.getMetaProp("cs");if(void 0===t)ae.setMetaProp("ps",e),ae.setMetaProp("cs",e),ae.setMetaProp("sc",1);else if(t!==e){ae.setMetaProp("ps",t),ae.setMetaProp("cs",e);let i=ae.getMetaProp("sc");void 0===i&&(i=0),ae.setMetaProp("sc",i+1)}this.sessionId=e}}getTimeElapsed(){if(!i(this,ui)[ui]())return;null!=this.scookieObj&&(this.scookieObj=this.getSessionCookieObject());const e=this.scookieObj.s;if(null!=e){const t=oe();return Math.floor(t-e)}}getPageCount(){if(i(this,ui)[ui]())return null!=this.scookieObj&&(this.scookieObj=this.getSessionCookieObject()),this.scookieObj.p}}let gi=0,fi=0;var vi=t("logger"),bi=t("account"),mi=t("device"),yi=t("session"),wi=t("isPersonalisationActive"),Ci=t("clearCookie"),ki=t("addToLocalEventMap");class xi{constructor(e){let{logger:t,account:o,device:n,session:s,isPersonalisationActive:r}=e;Object.defineProperty(this,ki,{value:Pi}),Object.defineProperty(this,vi,{writable:!0,value:void 0}),Object.defineProperty(this,bi,{writable:!0,value:void 0}),Object.defineProperty(this,mi,{writable:!0,value:void 0}),Object.defineProperty(this,yi,{writable:!0,value:void 0}),Object.defineProperty(this,wi,{writable:!0,value:void 0}),Object.defineProperty(this,Ci,{writable:!0,value:!1}),this.processingBackup=!1,i(this,vi)[vi]=t,i(this,bi)[bi]=o,i(this,mi)[mi]=n,i(this,yi)[yi]=s,i(this,wi)[wi]=r,Qe.logger=t,Qe.device=n,Qe.account=o}processBackupEvents(){const e=ae.readFromLSorCookie(S);if(null!=e){this.processingBackup=!0;for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];void 0===o.fired&&(i(this,vi)[vi].debug("Processing backup event : "+o.q),void 0!==o.q&&Qe.fireRequest(o.q),o.fired=!0)}ae.saveToLSorCookie(S,e),this.processingBackup=!1}}addSystemDataToObject(e,t){void 0===t&&(e=ee(e,i(this,vi)[vi])),$(i(this,vi)[vi].wzrkError)||(e.wzrk_error=i(this,vi)[vi].wzrkError,i(this,vi)[vi].wzrkError={}),e.id=i(this,bi)[bi].id,X(i(this,mi)[mi].gcookie)&&(e.g=i(this,mi)[mi].gcookie);const o=i(this,yi)[yi].getSessionCookieObject();e.s=o.s,e.pg=void 0===o.p?1:o.p;let n=document.location.protocol;return n=n.replace(":",""),e.af={lib:"web-sdk-v1.7.3",protocol:n,...le.flutterVersion},sessionStorage.hasOwnProperty("WZRK_D")&&(e.debug=!0),e}addFlags(e){if(i(this,Ci)[Ci]=ae.getAndClearMetaProp(g),void 0!==i(this,Ci)[Ci]&&i(this,Ci)[Ci]&&(e.rc=!0,i(this,vi)[vi].debug("reset cookie sent in request and cleared from meta for future requests.")),i(this,wi)[wi]()){const t=ae.getMetaProp("lsTime"),i=ae.getMetaProp("exTs");if(void 0===t||void 0===i)return void(e.dsync=!0);t+i{if(e.ok)return e.json();throw e})).then((e=>(i(this,vi)[vi].debug("Sync data successful",e),e))).catch((e=>{throw i(this,vi)[vi].debug("Error in syncing variables",e),e}))}}var Pi=function(e){if(ae._isLocalStorageSupported()){void 0===le.globalEventsMap&&(le.globalEventsMap=ae.readFromLSorCookie(C),void 0===le.globalEventsMap&&(le.globalEventsMap={}));const t=oe();let i=le.globalEventsMap[e];void 0!==i?(i[2]=t,i[0]++):(i=[],i.push(1),i.push(t),i.push(t)),le.globalEventsMap[e]=i,ae.saveToLSorCookie(C,le.globalEventsMap)}},Si=t("request"),Ii=t("account"),Oi=t("oldValues"),_i=t("logger"),Ei=t("processPrivacyArray");class Ai extends Array{constructor(e,t){let{request:o,account:n,logger:s}=e;super(),Object.defineProperty(this,Ei,{value:Li}),Object.defineProperty(this,Si,{writable:!0,value:void 0}),Object.defineProperty(this,Ii,{writable:!0,value:void 0}),Object.defineProperty(this,Oi,{writable:!0,value:void 0}),Object.defineProperty(this,_i,{writable:!0,value:void 0}),i(this,_i)[_i]=s,i(this,Si)[Si]=o,i(this,Ii)[Ii]=n,i(this,Oi)[Oi]=t}push(){for(var e=arguments.length,t=new Array(e),o=0;o0?le.privacyArray:t):le.privacyArray.push(...t),0}_processOldValues(){i(this,Oi)[Oi]&&i(this,Ei)[Ei](i(this,Oi)[Oi]),i(this,Oi)[Oi]=null}}var Li=function(e){if(Array.isArray(e)&&e.length>0){const o=e.reduce(((e,t)=>({...e,...t})),{});let n={};const s={};var t=!1;if(o.hasOwnProperty(O)&&"boolean"==typeof(t=o.optOut)&&(s.ct_optout=t,le.isOptInRequest=!t),o.hasOwnProperty(_)){const e=o.useIP,t="boolean"==typeof e&&e;ae.setMetaProp(_,t)}if(!$(s)){n.type="profile",n.profile=s,n=i(this,Si)[Si].addSystemDataToObject(n,void 0);const o=Ke(JSON.stringify(n),i(this,_i)[_i]);let r=i(this,Ii)[Ii].dataPostURL;r=Ve(r,"type",A),r=Ve(r,"d",o),r=Ve(r,O,t?"true":"false"),i(this,Si)[Si].saveAndFireRequest(r,le.blockRequest),e.splice(0,e.length)}}},Mi=t("oldValues"),Ti=t("logger"),Ri=t("request"),ji=t("account"),Di=t("wizAlertJSPath"),zi=t("fcmPublicKey"),Bi=t("setUpWebPush"),Ni=t("setUpWebPushNotifications"),Fi=t("setApplicationServerKey"),Ui=t("setUpSafariNotifications"),qi=t("setUpChromeFirefoxNotifications"),Vi=t("addWizAlertJS"),Wi=t("removeWizAlertJS"),Ki=t("handleNotificationRegistration");class Gi extends Array{constructor(e,t){let{logger:o,session:n,request:s,account:r}=e;super(),Object.defineProperty(this,Ki,{value:eo}),Object.defineProperty(this,Wi,{value:Xi}),Object.defineProperty(this,Vi,{value:Qi}),Object.defineProperty(this,qi,{value:Yi}),Object.defineProperty(this,Ui,{value:$i}),Object.defineProperty(this,Fi,{value:Zi}),Object.defineProperty(this,Ni,{value:Ji}),Object.defineProperty(this,Bi,{value:Hi}),Object.defineProperty(this,Mi,{writable:!0,value:void 0}),Object.defineProperty(this,Ti,{writable:!0,value:void 0}),Object.defineProperty(this,Ri,{writable:!0,value:void 0}),Object.defineProperty(this,ji,{writable:!0,value:void 0}),Object.defineProperty(this,Di,{writable:!0,value:void 0}),Object.defineProperty(this,zi,{writable:!0,value:void 0}),i(this,Di)[Di]="https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js",i(this,zi)[zi]=null,i(this,Mi)[Mi]=t,i(this,Ti)[Ti]=o,i(this,Ri)[Ri]=s,i(this,ji)[ji]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o0?i(this,Ki)[Ki](e):null==le.webPushEnabled&&e.length>0?(le.notifApi.notifEnabledFromApi=!0,le.notifApi.displayArgs=e.slice()):!1===le.webPushEnabled&&e.length>0&&i(this,Ti)[Ti].error("Make sure push notifications are fully enabled and integrated")},Ji=function(e,t,o,n){-1!==navigator.userAgent.indexOf("Chrome")||-1!==navigator.userAgent.indexOf("Firefox")?i(this,qi)[qi](e,t):-1!==navigator.userAgent.indexOf("Safari")&&i(this,Ui)[Ui](e,o,n)},Zi=function(e){i(this,zi)[zi]=e},$i=function(e,t,o){void 0===t&&i(this,Ti)[Ti].error("Ensure that APNS Web Push ID is supplied"),void 0===o&&i(this,Ti)[Ti].error("Ensure that APNS Web Push service path is supplied"),"safari"in window&&"pushNotification"in window.safari&&window.safari.pushNotification.requestPermission(o,t,{},(e=>{if("granted"===e.permission){const t=JSON.parse(JSON.stringify(e));t.endpoint=e.deviceToken,t.browser="Safari",ae.saveToLSorCookie(z,t),i(this,Ri)[Ri].registerToken(t),i(this,Ti)[Ti].info("Safari Web Push registered. Device Token: "+e.deviceToken)}else"denied"===e.permission&&i(this,Ti)[Ti].info("Error subscribing to Safari web push")}))},Yi=function(e,t){let o="";"serviceWorker"in navigator&&navigator.serviceWorker.register(t).then((e=>{if("undefined"!=typeof __wzrk_account_id)return new Promise((t=>setTimeout((()=>t(e)),5e3)));o=e.scope;return/^(\.?)(\/?)([^/]*).js$/.test(t)?navigator.serviceWorker.ready:-1!==navigator.userAgent.indexOf("Chrome")?new Promise((t=>setTimeout((()=>t(e)),5e3))):navigator.serviceWorker.getRegistrations()})).then((t=>{-1!==navigator.userAgent.indexOf("Firefox")&&Array.isArray(t)&&(t=t.filter((e=>e.scope===o))[0]);const n={userVisibleOnly:!0};null!=i(this,zi)[zi]&&(n.applicationServerKey=(e=>{let t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),i=window.atob(t),o=[];for(let e=0;e{i(this,Ti)[Ti].info("Service Worker registered. Endpoint: "+t.endpoint);const o=JSON.parse(JSON.stringify(t));-1!==navigator.userAgent.indexOf("Chrome")?(o.endpoint=o.endpoint.split("/").pop(),o.browser="Chrome"):-1!==navigator.userAgent.indexOf("Firefox")&&(o.endpoint=o.endpoint.split("/").pop(),o.browser="Firefox"),ae.saveToLSorCookie(z,o),i(this,Ri)[Ri].registerToken(o),void 0!==e&&"function"==typeof e&&e()})).catch((e=>{i(this,Ti)[Ti].error("Error subscribing: "+e),t.pushManager.getSubscription().then((e=>{null!==e&&e.unsubscribe().then((e=>{i(this,Ti)[Ti].info("Unsubscription successful")})).catch((e=>{i(this,Ti)[Ti].error("Error unsubscribing: "+e)}))}))}))})).catch((e=>{i(this,Ti)[Ti].error("error registering service worker: "+e)}))},Qi=function(){const e=document.createElement("script");return e.setAttribute("type","text/javascript"),e.setAttribute("id","wzrk-alert-js"),e.setAttribute("src",i(this,Di)[Di]),document.getElementsByTagName("body")[0].appendChild(e),e},Xi=function(){const e=document.getElementById("wzrk-alert-js");e.parentNode.removeChild(e)},eo=function(e){let t,o,n,s,r,a,l,c,d,h,u,p,g,f,v;if(1===e.length){if(J(e[0])){const i=e[0];t=i.titleText,o=i.bodyText,n=i.okButtonText,s=i.rejectButtonText,r=i.okButtonColor,a=i.skipDialog,l=i.askAgainTimeInSeconds,c=i.okCallback,d=i.rejectCallback,h=i.subscriptionCallback,u=i.serviceWorkerPath,p=i.httpsPopupPath,g=i.httpsIframePath,f=i.apnsWebPushId,v=i.apnsWebPushServiceUrl}}else t=e[0],o=e[1],n=e[2],s=e[3],r=e[4],a=e[5],l=e[6];if(null==a&&(a=!1),null==u&&(u="/clevertap_sw.js"),void 0===navigator.serviceWorker)return;const b=null!=p&&null!=g;if("https:"!==window.location.protocol&&"localhost"!==document.location.hostname&&!b)return void i(this,Ti)[Ti].error("Make sure you are https or localhost to register for notifications");if(-1!==navigator.userAgent.indexOf("Chrome")){const e=navigator.userAgent.match(/Chrome\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}else if(-1!==navigator.userAgent.indexOf("Firefox")){const e=navigator.userAgent.match(/Firefox\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}else{if(-1===navigator.userAgent.indexOf("Safari"))return;{const e=navigator.userAgent.match(/Safari\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}}if(!b){if(null==Notification)return;if("granted"===Notification.permission)return void i(this,Ni)[Ni](h,u,f,v);if("denied"===Notification.permission)return;if(a)return void i(this,Ni)[Ni](h,u,f,v)}if(!(t&&o&&n&&s))return void i(this,Ti)[Ti].error("Missing input parameters; please specify title, body, ok button and cancel button text");null!=r&&r.match(/^#[a-f\d]{6}$/i)||(r="#f28046");const m=(new Date).getTime()/1e3;if(null==ae.getMetaProp("notif_last_time"))ae.setMetaProp("notif_last_time",m);else{if(null==l&&(l=604800),m-ae.getMetaProp("notif_last_time"){if(null!=e.data){let a={};try{a=JSON.parse(e.data)}catch(e){return}null!=a.state&&"ct"===a.from&&"not"===a.state&&(i(this,Vi)[Vi]().onload=()=>{window.wzrkPermissionPopup.wizAlert({title:t,body:o,confirmButtonText:n,confirmButtonColor:r,rejectButtonText:s},(e=>{e?("function"==typeof c&&c(),window.open(p)):"function"==typeof d&&d(),i(this,Wi)[Wi]()}))})}}),!1)}else i(this,Vi)[Vi]().onload=()=>{window.wzrkPermissionPopup.wizAlert({title:t,body:o,confirmButtonText:n,confirmButtonColor:r,rejectButtonText:s},(e=>{e?("function"==typeof c&&c(),i(this,Ni)[Ni](h,u,f,v)):"function"==typeof d&&d(),i(this,Wi)[Wi]()}))}},to=t("variableStore");class io{constructor(e){let{variableStore:t}=e;Object.defineProperty(this,to,{writable:!0,value:void 0}),this.name=null,this.defaultValue=null,this.value=null,this.type=null,this.hadStarted=!1,this.valueChangedCallbacks=[],i(this,to)[to]=t}getValue(){return this.value}getdefaultValue(){return this.defaultValue}static define(e,t,i){if(!e||"string"!=typeof e)return console.error("Empty or invalid name parameter provided."),null;if(e.startsWith(".")||e.endsWith("."))return console.error("Variable name starts or ends with a `.` which is not allowed: "+e),null;const o=typeof t;if("string"!==o&&"number"!==o&&"boolean"!==o)return console.error("Only primitive types (string, number, boolean) are accepted as value"),null;const n=i.getVariable(e);if(n)return n;const s=new io({variableStore:i});try{s.name=e,s.defaultValue=t,s.value=t,s.type=o,i.registerVariable(s),s.update(t)}catch(e){console.error(e)}return s}update(e){const t=this.value;this.value=e,null===e&&null===t||null!==e&&e===t&&this.hadStarted||i(this,to)[to].hasVarsRequestCompleted()&&(this.hadStarted=!0,this.triggerValueChanged())}triggerValueChanged(){this.valueChangedCallbacks.forEach((e=>{e(this)}))}addValueChangedCallback(e){e?(this.valueChangedCallbacks.push(e),i(this,to)[to].hasVarsRequestCompleted()&&e(this)):console.log("Invalid callback parameter provided.")}removeValueChangedCallback(e){const t=this.valueChangedCallbacks.indexOf(e);-1!==t&&this.valueChangedCallbacks.splice(t,1)}clearStartFlag(){this.hadStarted=!1}}var oo=t("logger"),no=t("account"),so=t("request"),ro=t("event"),ao=t("variables"),lo=t("remoteVariables"),co=t("fetchCallback"),ho=t("variablesChangedCallbacks"),uo=t("oneTimeVariablesChangedCallbacks"),po=t("hasVarsRequestCompleted"),go=t("runVariablesChangedCallback");class fo{constructor(e){let{logger:t,request:o,account:n,event:s}=e;Object.defineProperty(this,go,{value:vo}),Object.defineProperty(this,oo,{writable:!0,value:void 0}),Object.defineProperty(this,no,{writable:!0,value:void 0}),Object.defineProperty(this,so,{writable:!0,value:void 0}),Object.defineProperty(this,ro,{writable:!0,value:void 0}),Object.defineProperty(this,ao,{writable:!0,value:void 0}),Object.defineProperty(this,lo,{writable:!0,value:void 0}),Object.defineProperty(this,co,{writable:!0,value:void 0}),Object.defineProperty(this,ho,{writable:!0,value:void 0}),Object.defineProperty(this,uo,{writable:!0,value:void 0}),Object.defineProperty(this,po,{writable:!0,value:!1}),i(this,oo)[oo]=t,i(this,no)[no]=n,i(this,so)[so]=o,i(this,ro)[ro]=s,i(this,ao)[ao]={},i(this,lo)[lo]={},i(this,ho)[ho]=[],i(this,uo)[uo]=[],le.variableStore=this}registerVariable(e){const{name:t}=e;i(this,ao)[ao][t]=e,console.log("registerVariable",i(this,ao)[ao])}getVariable(e){return i(this,ao)[ao][e]}hasVarsRequestCompleted(){return i(this,po)[po]}syncVariables(e,t){if(!i(this,no)[no].token){const e="Account token is missing.";return i(this,oo)[oo].error(e),Promise.reject(new Error(e))}const o={type:"varsPayload",vars:{}};for(const e in i(this,ao)[ao])o.vars[e]={defaultValue:i(this,ao)[ao][e].defaultValue,type:i(this,ao)[ao][e].type};if(0===Object.keys(o.vars).length){const e="No variables are defined.";return i(this,oo)[oo].error(e),Promise.reject(new Error(e))}let n={};n=i(this,so)[so].addSystemDataToObject(n,void 0),n.tk=i(this,no)[no].token,n.type="meta";const s=JSON.stringify([n,o]),r=i(this,no)[no].dataPostPEURL;return i(this,so)[so].post(r,s).then((t=>(e&&"function"==typeof e&&e(t),t))).catch((e=>{throw t&&"function"==typeof t&&t(e),400===e.status?i(this,oo)[oo].error("Invalid sync payload or clear the existing draft"):401===e.status?i(this,oo)[oo].error("This is not a test profile"):i(this,oo)[oo].error("Sync variable failed"),e}))}fetchVariables(e){i(this,ro)[ro].push(K,{t:4}),e&&"function"==typeof e&&(i(this,co)[co]=e)}mergeVariables(e){console.log("msg vars is ",e),i(this,po)[po]=!0,ae.saveToLSorCookie("WZRK_PE",e),i(this,lo)[lo]=e;for(const t in i(this,ao)[ao])e.hasOwnProperty(t)&&i(this,ao)[ao][t].update(e[t]);i(this,co)[co]&&i(this,co)[co](),i(this,go)[go]()}addVariablesChangedCallback(e){e&&"function"==typeof e?(i(this,ho)[ho].push(e),this.hasVarsRequestCompleted()&&e()):i(this,oo)[oo].error("callback is not a function")}addOneTimeVariablesChangedCallback(e){e&&"function"==typeof e&&(this.hasVarsRequestCompleted()?e():i(this,uo)[uo].push(e))}removeVariablesChangedCallback(e){const t=i(this,ho)[ho].indexOf(e);-1!==t&&i(this,ho)[ho].splice(t,1)}removeOneTimeVariablesChangedCallback(e){const t=i(this,uo)[uo].indexOf(e);-1!==t&&i(this,uo)[uo].splice(t,1)}}var vo=function(){for(var e of i(this,ho)[ho])e();for(var t of i(this,uo)[uo])t();i(this,uo)[uo].length=0},bo=t("logger"),mo=t("api"),yo=t("onloadcalled"),wo=t("device"),Co=t("session"),ko=t("account"),xo=t("request"),Po=t("variableStore"),So=t("isSpa"),Io=t("previousUrl"),Oo=t("boundCheckPageChanged"),_o=t("dismissSpamControl"),Eo=t("processOldValues"),Ao=t("debounce"),Lo=t("checkPageChanged"),Mo=t("handleMessageEvent"),To=t("pingRequest"),Ro=t("isPingContinuous"),jo=t("overrideDSyncFlag");var Do=function(){this.onUserLogin._processOldValues(),this.privacy._processOldValues(),this.event._processOldValues(),this.profile._processOldValues(),this.notifications._processOldValues()},zo=function(e){let t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300;return function(){clearTimeout(t),t=setTimeout(e,i)}},Bo=function(){i(this,Ao)[Ao]((()=>{i(this,Io)[Io]!==location.href&&this.pageChanged()}))()},No=function(e){var t;e.data&&e.data.message&&("Dashboard"===e.data.message&&e.data.url?Jt(e.data.url,null!==(t=e.data.variant)&&void 0!==t?t:null):"Overlay"===e.data.message&&$t(e.data,!0))},Fo=function(){let e=i(this,ko)[ko].dataPostURL,t={};t=i(this,xo)[xo].addSystemDataToObject(t,void 0),e=Ve(e,"type","ping"),e=Ve(e,"d",Ke(JSON.stringify(t),i(this,bo)[bo])),i(this,xo)[xo].saveAndFireRequest(e,le.blockRequest)},Uo=function(){return void 0!==window.wzrk_d&&"continuous"===window.wzrk_d.ping},qo=function(e){this._isPersonalisationActive()&&(e.dsync=!0)};const Vo=new class{get spa(){return i(this,So)[So]}set spa(e){const t=!0===e;i(this,So)[So]!==t&&1===i(this,yo)[yo]&&(t?document.addEventListener("click",i(this,Oo)[Oo]):document.removeEventListener("click",i(this,Oo)[Oo])),i(this,So)[So]=t}get dismissSpamControl(){return i(this,_o)[_o]}set dismissSpamControl(e){const t=!0===e;i(this,_o)[_o]=t,le.dismissSpamControl=t}constructor(){var e,t,o,n,s;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.defineProperty(this,jo,{value:qo}),Object.defineProperty(this,Ro,{value:Uo}),Object.defineProperty(this,To,{value:Fo}),Object.defineProperty(this,Mo,{value:No}),Object.defineProperty(this,Lo,{value:Bo}),Object.defineProperty(this,Ao,{value:zo}),Object.defineProperty(this,Eo,{value:Do}),Object.defineProperty(this,bo,{writable:!0,value:void 0}),Object.defineProperty(this,mo,{writable:!0,value:void 0}),Object.defineProperty(this,yo,{writable:!0,value:void 0}),Object.defineProperty(this,wo,{writable:!0,value:void 0}),Object.defineProperty(this,Co,{writable:!0,value:void 0}),Object.defineProperty(this,ko,{writable:!0,value:void 0}),Object.defineProperty(this,xo,{writable:!0,value:void 0}),Object.defineProperty(this,Po,{writable:!0,value:void 0}),Object.defineProperty(this,So,{writable:!0,value:void 0}),Object.defineProperty(this,Io,{writable:!0,value:void 0}),Object.defineProperty(this,Oo,{writable:!0,value:i(this,Lo)[Lo].bind(this)}),Object.defineProperty(this,_o,{writable:!0,value:void 0}),this.enablePersonalization=void 0,this.popupCallbacks={},this.popupCurrentWzrkId="",i(this,yo)[yo]=0,this._isPersonalisationActive=this._isPersonalisationActive.bind(this),this.raiseNotificationClicked=()=>{},i(this,bo)[bo]=new ai(ti),i(this,ko)[ko]=new d(null===(e=r.account)||void 0===e?void 0:e[0],r.region||(null===(t=r.account)||void 0===t?void 0:t[1]),r.targetDomain||(null===(o=r.account)||void 0===o?void 0:o[2]),r.token||(null===(n=r.account)||void 0===n?void 0:n[3])),i(this,wo)[wo]=new ye({logger:i(this,bo)[bo]}),i(this,_o)[_o]=r.dismissSpamControl||!1,i(this,Co)[Co]=new pi({logger:i(this,bo)[bo],isPersonalisationActive:this._isPersonalisationActive}),i(this,xo)[xo]=new xi({logger:i(this,bo)[bo],account:i(this,ko)[ko],device:i(this,wo)[wo],session:i(this,Co)[Co],isPersonalisationActive:this._isPersonalisationActive}),this.enablePersonalization=r.enablePersonalization||!1,this.event=new Fe({logger:i(this,bo)[bo],request:i(this,xo)[xo],isPersonalisationActive:this._isPersonalisationActive},r.event),this.profile=new gt({logger:i(this,bo)[bo],request:i(this,xo)[xo],account:i(this,ko)[ko],isPersonalisationActive:this._isPersonalisationActive},r.profile),this.onUserLogin=new It({request:i(this,xo)[xo],account:i(this,ko)[ko],session:i(this,Co)[Co],logger:i(this,bo)[bo],device:i(this,wo)[wo]},r.onUserLogin),this.privacy=new Ai({request:i(this,xo)[xo],account:i(this,ko)[ko],logger:i(this,bo)[bo]},r.privacy),this.notifications=new Gi({logger:i(this,bo)[bo],request:i(this,xo)[xo],account:i(this,ko)[ko]},r.notifications),i(this,Po)[Po]=new fo({logger:i(this,bo)[bo],request:i(this,xo)[xo],account:i(this,ko)[ko],event:this.event}),i(this,mo)[mo]=new be({logger:i(this,bo)[bo],request:i(this,xo)[xo],device:i(this,wo)[wo],session:i(this,Co)[Co]}),this.spa=r.spa,this.dismissSpamControl=r.dismissSpamControl,this.user=new Xt({isPersonalisationActive:this._isPersonalisationActive}),this.session={getTimeElapsed:()=>i(this,Co)[Co].getTimeElapsed(),getPageCount:()=>i(this,Co)[Co].getPageCount()},this.logout=()=>{i(this,bo)[bo].debug("logout called"),ae.setInstantDeleteFlagInK()},this.clear=()=>{this.onUserLogin.clear()},this.getCleverTapID=()=>i(this,wo)[wo].getGuid(),this.getAccountID=()=>i(this,ko)[ko].id,this.getSCDomain=()=>i(this,ko)[ko].finalTargetDomain,this.setLibrary=(e,t)=>{le.flutterVersion={[e]:t}},this.setSCSDKVersion=e=>{i(this,ko)[ko].scSDKVersion=e;const t={};t.af={scv:"sc-sdk-v"+i(this,ko)[ko].scSDKVersion};let o=i(this,ko)[ko].dataPostURL;o=Ve(o,"type","page"),o=Ve(o,"d",Ke(JSON.stringify(t),i(this,bo)[bo])),i(this,xo)[xo].saveAndFireRequest(o,le.blockRequest)},Kt()&&(qt(),Ut(i(this,bo)[bo])),this.getInboxMessageCount=()=>{const e=Nt();return Object.keys(e).length},this.getInboxMessageUnreadCount=()=>{if(le.inbox)return le.inbox.unviewedCounter;i(this,bo)[bo].debug("No unread messages")},this.getAllInboxMessages=()=>Nt(),this.getUnreadInboxMessages=()=>{if(le.inbox)return le.inbox.unviewedMessages;i(this,bo)[bo].debug("No unread messages")},this.getInboxMessageForId=e=>{const t=Nt();if((null!==e||""!==e)&&t.hasOwnProperty(e))return t[e];i(this,bo)[bo].error("No message available for message Id "+e)},this.deleteInboxMessage=e=>{const t=Nt();if(null===e&&""===e||!t.hasOwnProperty(e))i(this,bo)[bo].error("No message available for message Id "+e);else{const i=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);0===t[e].viewed&&(le.inbox.unviewedCounter--,delete le.inbox.unviewedMessages[e],document.getElementById("unviewedBadge").innerText=le.inbox.unviewedCounter,document.getElementById("unviewedBadge").style.display=le.inbox.unviewedCounter>0?"flex":"none"),i&&i.remove(),delete t[e],Ft(t)}},this.markReadInboxMessage=e=>{const t=le.inbox.unviewedMessages,o=Nt();if(null===e&&""===e||!t.hasOwnProperty(e))i(this,bo)[bo].error("No message available for message Id "+e);else{const t=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);if(null!==t&&(t.shadowRoot.getElementById("unreadMarker").style.display="none"),o[e].viewed=1,document.getElementById("unviewedBadge")){var n=parseInt(document.getElementById("unviewedBadge").innerText)-1;document.getElementById("unviewedBadge").innerText=n,document.getElementById("unviewedBadge").style.display=n>0?"flex":"none"}window.clevertap.renderNotificationViewed({msgId:o[e].wzrk_id,pivotId:o[e].pivotId}),le.inbox.unviewedCounter--,delete le.inbox.unviewedMessages[e],Ft(o)}},this.markReadInboxMessagesForIds=e=>{if(Array.isArray(e))for(var t=0;t{const e=le.inbox.unviewedMessages,t=Nt();if(Object.keys(e).length>0){Object.keys(e).forEach((e=>{const i=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);null!==i&&(i.shadowRoot.getElementById("unreadMarker").style.display="none"),t[e].viewed=1,window.clevertap.renderNotificationViewed({msgId:t[e].wzrk_id,pivotId:t[e].wzrk_pivot})})),document.getElementById("unviewedBadge").innerText=0,document.getElementById("unviewedBadge").style.display="none",Ft(t),le.inbox.unviewedCounter=0,le.inbox.unviewedMessages={}}else i(this,bo)[bo].debug("All messages are already read")},this.toggleInbox=e=>{var t;return null===(t=le.inbox)||void 0===t?void 0:t.toggleInbox(e)},this.renderNotificationViewed=e=>{a(R,e)},this.renderNotificationClicked=e=>{a(j,e)};const a=(e,t)=>{if(!t||!t.msgId)return;const o={type:"event"};if(o.evtName=e,o.evtData={[T]:t.msgId},t.pivotId&&(o.evtData={...o.evtData,wzrk_pivot:t.pivotId}),t.wzrk_slideNo&&(o.evtData={...o.evtData,wzrk_slideNo:t.wzrk_slideNo}),t.kv&&null!==t.kv&&void 0!==t.kv)for(const e in t.kv)e.startsWith(M)&&(o.evtData={...o.evtData,[e]:t.kv[e]});if(t.msgCTkv&&null!==t.msgCTkv&&void 0!==t.msgCTkv)for(const e in t.msgCTkv)e.startsWith(M)&&(o.evtData={...o.evtData,[e]:t.msgCTkv[e]});i(this,xo)[xo].processEvent(o)};this.setLogLevel=e=>{i(this,bo)[bo].logLevel=Number(e),3===e?sessionStorage.WZRK_D="":delete sessionStorage.WZRK_D},this.handleIncrementValue=(e,t)=>{this.profile._handleIncrementDecrementValue(e,t,B)},this.handleDecrementValue=(e,t)=>{this.profile._handleIncrementDecrementValue(e,t,"$decr")},this.setMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueSet(e,t,"$set"):console.error("setMultiValuesForKey should be called with a value of type array")},this.addMultiValueForKey=(e,t)=>{"string"==typeof t||"number"==typeof t?this.profile._handleMultiValueAdd(e,t,N):console.error("addMultiValueForKey should be called with a value of type string or number.")},this.addMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueAdd(e,t,N):console.error("addMultiValuesForKey should be called with a value of type array.")},this.removeMultiValueForKey=(e,t)=>{"string"==typeof t||"number"==typeof t?this.profile._handleMultiValueRemove(e,t,F):console.error("removeMultiValueForKey should be called with a value of type string or number.")},this.removeMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueRemove(e,t,F):console.error("removeMultiValuesForKey should be called with a value of type array.")},this.removeValueForKey=e=>{this.profile._handleMultiValueDelete(e,U)};const l=(e,t,o)=>{((e,t,i,o,n)=>{const s=qe(location.href),r=s.e,a=s.p,l=s.page_type;if(void 0!==r){const s={};s.id=o.id,s.unsubGroups=le.unsubGroups,le.updatedCategoryLong&&(s.cUsY=le.updatedCategoryLong);let c=o.emailURL;i&&(c=Ve(c,"fetchGroups",i)),t&&(c=Ve(c,"encoded",t)),c=Ve(c,"e",r),c=Ve(c,"d",Ke(JSON.stringify(s),n)),a&&(c=Ve(c,"p",a)),"-1"!==e&&(c=Ve(c,"sub",e)),l&&(le.globalUnsubscribe=l===I,c=Ve(c,"page_type",l)),Qe.fireRequest(c)}})(e,t,o,i(this,ko)[ko],i(this,bo)[bo])};function c(e){var t=e.coords.latitude,i=e.coords.longitude;le.location={Latitude:t,Longitude:i},this.sendLocationData({Latitude:t,Longitude:i})}function h(e){switch(e.code){case e.PERMISSION_DENIED:console.log("User denied the request for Geolocation.");break;case e.POSITION_UNAVAILABLE:console.log("Location information is unavailable.");break;case e.TIMEOUT:console.log("The request to get user location timed out.");break;case e.UNKNOWN_ERROR:console.log("An unknown error occurred.")}}this.getLocation=function(e,t){if(e&&"number"!=typeof e||t&&"number"!=typeof t)console.log("Latitude and Longitude must be of number type");else if(e&&t){if(e<=-90||e>90)return void console.log("A vaid latitude must range between -90 and 90");if(t<=-180||t>180)return void console.log("A valid longitude must range between -180 and 180");le.location={Latitude:e,Longitude:t},this.sendLocationData({Latitude:e,Longitude:t})}else navigator.geolocation?navigator.geolocation.getCurrentPosition(c.bind(this),h):console.log("Geolocation is not supported by this browser.")};const u=i(this,mo)[mo];u.logout=this.logout,u.clear=this.clear,u.closeIframe=(e,t)=>{at(e,0,i(this,Co)[Co].sessionId)},u.enableWebPush=(e,t)=>{this.notifications._enableWebPush(e,t)},u.tr=e=>{Yt(e,{device:i(this,wo)[wo],session:i(this,Co)[Co],request:i(this,xo)[xo],logger:i(this,bo)[bo]})},u.setEnum=e=>{((e,t)=>{if(H(e)||Q(e))return"$E_"+e;t.error(Ae)})(e,i(this,bo)[bo])},u.is_onloadcalled=()=>1===i(this,yo)[yo],u.subEmail=e=>{l("1",e)},u.getEmail=(e,t)=>{l("-1",e,t)},u.unSubEmail=e=>{l("0",e)},u.unsubEmailGroups=e=>{le.unsubGroups=[];const t=document.getElementsByClassName("ct-unsub-group-input-item");for(let e=0;e{le.unsubGroups=e},u.getSubscriptionGroups=()=>le.unsubGroups,u.changeSubscriptionGroups=(e,t)=>{u.setSubscriptionGroups(t),l("2",e)},u.isGlobalUnsubscribe=()=>le.globalUnsubscribe,u.setIsGlobalUnsubscribe=e=>{le.globalUnsubscribe=e},u.setUpdatedCategoryLong=e=>{e.cUsY&&(le.updatedCategoryLong=e.cUsY)},window.$CLTP_WR=window.$WZRK_WR=u,(null===(s=r.account)||void 0===s?void 0:s[0].id)&&this.init()}init(e,t,o,n){if(1===i(this,yo)[yo])return;if(ae.removeCookie("WZRK_P",window.location.hostname),!i(this,ko)[ko].id){if(!e)return void i(this,bo)[bo].error(ke);i(this,ko)[ko].id=e}i(this,Co)[Co].cookieName="WZRK_S_"+i(this,ko)[ko].id,t&&(i(this,ko)[ko].region=t),o&&(i(this,ko)[ko].targetDomain=o),n&&(i(this,ko)[ko].token=n);const s=location.href,r=qe(s.toLowerCase());if(void 0!==r.e&&"0"==r.wzrk_ex)return;le.isPrivacyArrPushed=!0,le.privacyArray.length>0&&this.privacy.push(le.privacyArray),i(this,Eo)[Eo](),this.pageChanged();const a=setInterval((()=>{i(this,wo)[wo].gcookie&&(clearInterval(a),i(this,xo)[xo].processBackupEvents())}),3e3);i(this,So)[So]?document.addEventListener("click",i(this,Oo)[Oo]):document.removeEventListener("click",i(this,Oo)[Oo]),i(this,yo)[yo]=1}pageChanged(){const e=window.location.search;if("?ctBuilder"===e)return console.log("open in visual builder mode"),window.addEventListener("message",i(this,Mo)[Mo],!1),void window.postMessage("builder","*");if("?ctBuilderPreview"===e)return window.addEventListener("message",i(this,Mo)[Mo],!1),void window.postMessage("preview","*");const t=window.location.href,o=qe(t.toLowerCase()),n=i(this,Co)[Co].getSessionCookieObject();let s=void 0===n.p?0:n.p;n.p=++s,i(this,Co)[Co].setSessionCookieObject(n);let r={},a=(e=>{if(""===e)return"";var t=document.createElement("a");return t.href=e,t.hostname})(document.referrer);if(window.location.hostname!==a){const e=120;""!==a&&(a=a.length>e?a.substring(0,e):a,r.referrer=a);let t=o.utm_source||o.wzrk_source;void 0!==t&&(t=t.length>e?t.substring(0,e):t,r.us=t);let i=o.utm_medium||o.wzrk_medium;void 0!==i&&(i=i.length>e?i.substring(0,e):i,r.um=i);let n=o.utm_campaign||o.wzrk_campaign;if(void 0!==n&&(n=n.length>e?n.substring(0,e):n,r.uc=n),void 0!==o.wzrk_medium){const e=o.wzrk_medium;e.match(/^email$|^social$|^search$/)&&(r.wm=e)}}r=i(this,xo)[xo].addSystemDataToObject(r,void 0),r.cpg=t,r.WZRK_CAMP=it();let l=i(this,ko)[ko].dataPostURL;i(this,xo)[xo].addFlags(r),1===parseInt(r.pg)&&i(this,jo)[jo](r),l=Ve(l,"type","page"),l=Ve(l,"d",Ke(JSON.stringify(r),i(this,bo)[bo])),i(this,xo)[xo].saveAndFireRequest(l,le.blockRequest),1===parseInt(r.pg)&&this.event.push(K,{t:4}),i(this,Io)[Io]=t,setTimeout((()=>{s<=3&&i(this,To)[To](),i(this,Ro)[Ro]()&&setInterval((()=>{i(this,To)[To]()}),3e5)}),12e4)}_isPersonalisationActive(){return ae._isLocalStorageSupported()&&this.enablePersonalization}set popupCallback(e){this.popupCallbacks[this.popupCurrentWzrkId]=e}sendLocationData(e){let t={af:{}};const o={};if(t.type="profile",null==o.tz&&(o.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),t.profile=o,e){Object.keys(e).forEach((i=>{t.af[i]=e[i]}))}le.location&&(t.af={...t.af,...le.location}),t=i(this,xo)[xo].addSystemDataToObject(t,!0),i(this,xo)[xo].addFlags(t);const n=Ke(JSON.stringify(t),i(this,bo)[bo]);let s=i(this,ko)[ko].dataPostURL;s=Ve(s,"type",A),s=Ve(s,"d",n),i(this,xo)[xo].saveAndFireRequest(s,le.blockRequest)}setOffline(e){"boolean"==typeof e?(le.offline=e,e||i(this,xo)[xo].processBackupEvents()):console.error("setOffline should be called with a value of type boolean")}defineVariable(e,t){return io.define(e,t,i(this,Po)[Po])}syncVariables(e,t){if(4===i(this,bo)[bo].logLevel)return i(this,Po)[Po].syncVariables(e,t);{const e="App log level is not set to 4";return i(this,bo)[bo].error(e),Promise.reject(new Error(e))}}fetchVariables(e){i(this,Po)[Po].fetchVariables(e)}addVariablesChangedCallback(e){i(this,Po)[Po].addVariablesChangedCallback(e)}addOneTimeVariablesChangedCallback(e){i(this,Po)[Po].addOneTimeVariablesChangedCallback(e)}}(window.clevertap);return window.clevertap=window.wizrocket=Vo,Vo})); diff --git a/src/clevertap.js b/src/clevertap.js index 743f1a87..1d8ef5e8 100644 --- a/src/clevertap.js +++ b/src/clevertap.js @@ -679,12 +679,12 @@ export default class CleverTap { // open in visual builder mode console.log('open in visual builder mode') window.addEventListener('message', this.#handleMessageEvent, false) - window.postMessage('builder') + window.postMessage('builder', '*') return } if (search === '?ctBuilderPreview') { window.addEventListener('message', this.#handleMessageEvent, false) - window.postMessage('preview') + window.postMessage('preview', '*') return } From de9ad79aadc76c8593746914f45c074d69596c75 Mon Sep 17 00:00:00 2001 From: KambleSonam Date: Fri, 10 May 2024 11:15:42 +0530 Subject: [PATCH 05/19] postMessage update --- clevertap.js | 13 +++++++++++-- clevertap.js.map | 2 +- clevertap.min.js | 2 +- src/clevertap.js | 10 ++++++++-- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/clevertap.js b/clevertap.js index 379e3cfe..d916d549 100644 --- a/clevertap.js +++ b/clevertap.js @@ -8157,18 +8157,27 @@ pageChanged() { const search = window.location.search; + const parentWindow = window.opener; if (search === '?ctBuilder') { // open in visual builder mode console.log('open in visual builder mode'); window.addEventListener('message', _classPrivateFieldLooseBase(this, _handleMessageEvent)[_handleMessageEvent], false); - window.postMessage('builder', '*'); + + if (parentWindow) { + parentWindow.postMessage('builder', '*'); + } + return; } if (search === '?ctBuilderPreview') { window.addEventListener('message', _classPrivateFieldLooseBase(this, _handleMessageEvent)[_handleMessageEvent], false); - window.postMessage('preview', '*'); + + if (parentWindow) { + parentWindow.postMessage('preview', '*'); + } + return; } diff --git a/clevertap.js.map b/clevertap.js.map index ee2bfe24..81ca4706 100644 --- a/clevertap.js.map +++ b/clevertap.js.map @@ -1 +1 @@ -{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/modules/visualBuilder/pageBuilder.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/notification.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {}\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n // Initialize array\n var array = []\n\n // Check if globalProfileMap is null, initialize if needed\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n // Check if the value to be set is either string or number\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = $ct.globalProfileMap[propKey]\n array.push(typeof propVal === 'number' ? propVal : propVal.toLowerCase())\n } else {\n $ct.globalProfileMap[propKey] = propVal\n }\n } else {\n // Check if propVal is an array\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = Array.isArray($ct.globalProfileMap[propKey]) ? $ct.globalProfileMap[propKey] : [$ct.globalProfileMap[propKey]]\n }\n\n // Check for case-sensitive inputs and filter the same ones\n for (var i = 0; i < propVal.length; i++) {\n if (typeof propVal[i] === 'number' && !array.includes(propVal[i])) {\n array.push(propVal[i])\n } else if (typeof propVal[i] === 'string' && !array.includes(propVal[i].toLowerCase())) {\n array.push(propVal[i].toLowerCase())\n } else if ((typeof propVal[i] === 'number' && array.includes(propVal[i])) || (typeof propVal[i] === 'string' && array.includes(propVal[i].toLowerCase()))) {\n console.error('Values already included')\n } else {\n console.error('Array supports only string or number type values')\n }\n }\n\n // Update globalProfileMap with the array\n $ct.globalProfileMap[propKey] = array\n }\n\n // Save to local storage or cookie\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Call the sendMultiValueData function\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n var index = $ct.globalProfileMap[propKey].indexOf(propVal)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n } else {\n for (var k = 0; k < propVal.length; k++) {\n var idx = $ct.globalProfileMap[propKey].indexOf(propVal[k])\n if (idx !== -1) {\n $ct.globalProfileMap[propKey].splice(idx, 1)\n }\n }\n }\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n // console.log('Raise notification clicked event for ', item)\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","export const initialiseCTBuilder = (url, variant) => {\n document.addEventListener('DOMContentLoaded', () => onContentLoad(url, variant))\n}\n\nlet container\n\nfunction onContentLoad (url, variant) {\n document.body.innerHTML = ''\n container = document.createElement('div')\n container.id = 'overlayDiv'\n container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form\n container.style.display = 'flex'\n document.body.appendChild(container)\n const overlayPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js'\n loadOverlayScript(overlayPath, url, variant)\n .then(() => {\n console.log('Overlay script loaded successfully.')\n })\n .catch((error) => {\n console.error('Error loading overlay script:', error)\n })\n loadCSS()\n loadTypeKit()\n}\n\nfunction loadCSS () {\n var link = document.createElement('link')\n link.rel = 'stylesheet'\n link.type = 'text/css'\n link.href = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css'\n document.head.appendChild(link)\n}\n\nfunction loadOverlayScript (overlayPath, url, variant) {\n return new Promise((resolve, reject) => {\n var script = document.createElement('script')\n script.type = 'module'\n script.src = overlayPath\n script.onload = function () {\n if (typeof window.Overlay === 'function') {\n window.Overlay('#overlayDiv', url, variant)\n resolve()\n } else {\n reject(new Error('ContentLayout not found in overlay.js'))\n }\n }\n script.onerror = function (error) {\n reject(error)\n }\n document.head.appendChild(script)\n })\n}\n\nfunction loadTypeKit () {\n var config = {\n kitId: 'eqj6nom',\n scriptTimeout: 3000,\n async: true\n }\n\n var d = document\n var h = d.documentElement\n var t = setTimeout(function () {\n h.className = h.className.replace(/\\bwf-loading\\b/g, '') + ' wf-inactive'\n // $(document).trigger(\"TypeKitReady\");\n }, config.scriptTimeout)\n var tk = d.createElement('script')\n var f = false\n var s = d.getElementsByTagName('script')[0]\n var a\n\n h.className += ' wf-loading'\n tk.src = 'https://use.typekit.net/' + config.kitId + '.js'\n tk.async = true\n tk.onload = tk.onreadystatechange = function () {\n a = this.readyState\n if (f || (a && a !== 'complete' && a !== 'loaded')) return\n f = true\n clearTimeout(t)\n try {\n // eslint-disable-next-line no-undef\n Typekit.load(config)\n } catch (e) {}\n }\n\n s.parentNode.insertBefore(tk, s)\n}\n\nexport const renderVisualBuilder = (targetingMsgJson, isPreview) => {\n const details = targetingMsgJson.display.details[0]\n const siteUrl = Object.keys(details)[0]\n const selectors = details[siteUrl]\n\n if (siteUrl === window.location.href) {\n for (const selector in selectors) {\n const element = document.querySelector(selector)\n if (element) {\n if (selectors[selector].html) {\n element.outerHTML = selectors[selector].html\n } else {\n // Update json data\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n } else {\n let count = 0\n const intervalId = setInterval(() => {\n const retryElement = document.querySelector(selector)\n if (retryElement) {\n if (selectors[selector].html) {\n retryElement.outerHTML = selectors[selector].html\n } else {\n // Update json data\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n clearInterval(intervalId)\n } else {\n count++\n if (count >= 20) {\n console.log(`No element present on DOM with selector '${selector}'.`)\n clearInterval(intervalId)\n }\n }\n }, 500)\n }\n }\n }\n}\n// function addOverlayScript (overlayPath) {\n// const scriptTag = document.createElement('script')\n// scriptTag.setAttribute('type', 'text/javascript')\n// scriptTag.setAttribute('id', 'wzrk-alert-js')\n// scriptTag.setAttribute('src', overlayPath)\n// document.getElementsByTagName('body')[0].appendChild(scriptTag)\n// return scriptTag\n// }\n","import {\n addToLocalProfileMap,\n arp,\n getCampaignObject,\n saveCampaignObject,\n closeIframe\n} from './clevertap'\n\nimport {\n CAMP_COOKIE_NAME,\n DISPLAY,\n GLOBAL,\n EV_COOKIE,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n WZRK_PREFIX,\n WZRK_ID,\n CAMP_COOKIE_G,\n GCOOKIE_NAME\n} from './constants'\n\nimport {\n getNow,\n getToday\n} from './datetime'\n\nimport {\n compressToBase64\n} from './encoder'\n\nimport { StorageManager, $ct } from './storage'\nimport RequestDispatcher from './requestDispatcher'\nimport { CTWebPersonalisationBanner } from './web-personalisation/banner'\nimport { CTWebPersonalisationCarousel } from './web-personalisation/carousel'\nimport { CTWebPopupImageOnly } from './web-popupImageonly/popupImageonly'\nimport { checkAndRegisterWebInboxElements, initializeWebInbox, processWebInboxSettings, hasWebInboxSettingsInLS, processInboxNotifs } from '../modules/web-inbox/helper'\nimport { renderVisualBuilder } from '../modules/visualBuilder/pageBuilder'\n\nconst _tr = (msg, {\n device,\n session,\n request,\n logger\n}) => {\n const _device = device\n const _session = session\n const _request = request\n const _logger = logger\n let _wizCounter = 0\n\n // msg = {\n // arp: {\n // j_n: 'Zw==',\n // i_n: 'Y2NmewICAw==',\n // d_ts: 0,\n // dh: 0,\n // v: 1,\n // j_s: '{ }',\n // id: 'WWW-WWW-WWRZ',\n // e_ts: 0,\n // r_ts: 1649748826,\n // rc_w: 60,\n // rc_n: 5\n // },\n // inapp_notifs: [\n // {\n // msgContent: {\n // templateType: 'point-and-click',\n // type: 4\n // },\n // display: {\n // divId: 'hero-banner',\n // details: [{\n // 'http://localhost:3000/': {\n // '.heroDi1v': {\n // html: 'Hello Sonam'\n // },\n // '#selector_2': {\n // html: '

Hello Sonam

'\n // },\n // '.heroDiv2': {\n // json: {\n // name: 'Sonam',\n // identity: 1234\n // }\n // }\n // }\n // }],\n // wtarget_type: 2,\n // wmc: 1,\n // ff: 'Desktop'\n // },\n // wzrk_id: '1655316906_20220620',\n // wzrk_pivot: 'wzrk_default'\n // }\n // ]\n // }\n // Campaign House keeping\n const doCampHouseKeeping = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const today = getToday()\n\n const incrCount = (obj, campaignId, excludeFromFreqCaps) => {\n let currentCount = 0\n let totalCount = 0\n if (obj[campaignId] != null) {\n currentCount = obj[campaignId]\n }\n currentCount++\n if (obj.tc != null) {\n totalCount = obj.tc\n }\n // if exclude from caps then dont add to total counts\n if (excludeFromFreqCaps < 0) {\n totalCount++\n }\n\n obj.tc = totalCount\n obj[campaignId] = currentCount\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n delete sessionStorage[CAMP_COOKIE_NAME]\n var campTypeObj = {}\n const campObj = getCampaignObject()\n if (targetingMsgJson.display.wtarget_type === 3 && campObj.hasOwnProperty('wi')) {\n campTypeObj = campObj.wi\n } else if ((targetingMsgJson.display.wtarget_type === 0 || targetingMsgJson.display.wtarget_type === 1) && campObj.hasOwnProperty('wp')) {\n campTypeObj = campObj.wp\n } else {\n campTypeObj = {}\n }\n if (campObj.hasOwnProperty('global')) {\n campTypeObj.wp = campObj\n }\n // global session limit. default is 1\n if (targetingMsgJson[DISPLAY].wmc == null) {\n targetingMsgJson[DISPLAY].wmc = 1\n }\n\n // global session limit for web inbox. default is 1\n if (targetingMsgJson[DISPLAY].wimc == null) {\n targetingMsgJson[DISPLAY].wimc = 1\n }\n\n var excludeFromFreqCaps = -1 // efc - Exclude from frequency caps\n let campaignSessionLimit = -1 // mdc - Once per session\n let campaignDailyLimit = -1 // tdc - Once per day\n let campaignTotalLimit = -1 // tlc - Once per user for the duration of campaign\n let totalDailyLimit = -1\n let totalSessionLimit = -1 // wmc - Web Popup Global Session Limit\n let totalInboxSessionLimit = -1 // wimc - Web Inbox Global Session Limit\n\n if (targetingMsgJson[DISPLAY].efc != null) { // exclude from frequency cap\n excludeFromFreqCaps = parseInt(targetingMsgJson[DISPLAY].efc, 10)\n }\n if (targetingMsgJson[DISPLAY].mdc != null) { // Campaign Session Limit\n campaignSessionLimit = parseInt(targetingMsgJson[DISPLAY].mdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tdc != null) { // No of web popups in a day per campaign\n campaignDailyLimit = parseInt(targetingMsgJson[DISPLAY].tdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tlc != null) { // Total lifetime count\n campaignTotalLimit = parseInt(targetingMsgJson[DISPLAY].tlc, 10)\n }\n if (targetingMsgJson[DISPLAY].wmp != null) { // No of campaigns per day\n totalDailyLimit = parseInt(targetingMsgJson[DISPLAY].wmp, 10)\n }\n if (targetingMsgJson[DISPLAY].wmc != null) { // No of campaigns per session\n totalSessionLimit = parseInt(targetingMsgJson[DISPLAY].wmc, 10)\n }\n\n if (targetingMsgJson[DISPLAY].wimc != null) { // No of inbox campaigns per session\n totalInboxSessionLimit = parseInt(targetingMsgJson[DISPLAY].wimc, 10)\n }\n // session level capping\n var sessionObj = campTypeObj[_session.sessionId]\n if (sessionObj) {\n const campaignSessionCount = sessionObj[campaignId]\n const totalSessionCount = sessionObj.tc\n // dnd\n if (campaignSessionCount === 'dnd' && !$ct.dismissSpamControl) {\n return false\n }\n\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n // Inbox session\n if (totalInboxSessionLimit > 0 && totalSessionCount >= totalInboxSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n } else {\n // session\n if (totalSessionLimit > 0 && totalSessionCount >= totalSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n }\n\n // campaign session\n if (campaignSessionLimit > 0 && campaignSessionCount >= campaignSessionLimit) {\n return false\n }\n } else {\n sessionObj = {}\n campTypeObj[_session.sessionId] = sessionObj\n }\n\n // daily level capping\n var dailyObj = campTypeObj[today]\n if (dailyObj != null) {\n const campaignDailyCount = dailyObj[campaignId]\n const totalDailyCount = dailyObj.tc\n // daily\n if (totalDailyLimit > 0 && totalDailyCount >= totalDailyLimit && excludeFromFreqCaps < 0) {\n return false\n }\n // campaign daily\n if (campaignDailyLimit > 0 && campaignDailyCount >= campaignDailyLimit) {\n return false\n }\n } else {\n dailyObj = {}\n campTypeObj[today] = dailyObj\n }\n\n var globalObj = campTypeObj[GLOBAL]\n if (globalObj != null) {\n const campaignTotalCount = globalObj[campaignId]\n // campaign total\n if (campaignTotalLimit > 0 && campaignTotalCount >= campaignTotalLimit) {\n return false\n }\n } else {\n globalObj = {}\n campTypeObj[GLOBAL] = globalObj\n }\n }\n // delay\n if (targetingMsgJson[DISPLAY].delay != null && targetingMsgJson[DISPLAY].delay > 0) {\n const delay = targetingMsgJson[DISPLAY].delay\n targetingMsgJson[DISPLAY].delay = 0\n setTimeout(_tr, delay * 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n return false\n }\n\n incrCount(sessionObj, campaignId, excludeFromFreqCaps)\n incrCount(dailyObj, campaignId, excludeFromFreqCaps)\n incrCount(globalObj, campaignId, excludeFromFreqCaps)\n\n let campKey = 'wp'\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n campKey = 'wi'\n }\n // get ride of stale sessions and day entries\n const newCampObj = {}\n newCampObj[_session.sessionId] = sessionObj\n newCampObj[today] = dailyObj\n newCampObj[GLOBAL] = globalObj\n saveCampaignObject({ [campKey]: newCampObj })\n }\n\n const getCookieParams = () => {\n const gcookie = _device.getGuid()\n const scookieObj = _session.getSessionCookieObject()\n return '&t=wc&d=' + encodeURIComponent(compressToBase64(gcookie + '|' + scookieObj.p + '|' + scookieObj.s))\n }\n\n const setupClickEvent = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n if (onClick !== '' && onClick != null) {\n let ctaElement\n let jsCTAElements\n if (isLegacy) {\n ctaElement = contentDiv\n } else if (contentDiv !== null) {\n jsCTAElements = contentDiv.getElementsByClassName('jsCT_CTA')\n if (jsCTAElements != null && jsCTAElements.length === 1) {\n ctaElement = jsCTAElements[0]\n }\n }\n const jsFunc = targetingMsgJson.display.jsFunc\n const isPreview = targetingMsgJson.display.preview\n if (isPreview == null) {\n onClick += getCookieParams()\n }\n\n if (ctaElement != null) {\n ctaElement.onclick = () => {\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n if (isPreview == null) {\n RequestDispatcher.fireRequest(onClick)\n }\n invokeExternalJs(jsFunc, targetingMsgJson)\n // close iframe. using -1 for no campaignId\n closeIframe('-1', divId, _session.sessionId)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n }\n }\n\n const invokeExternalJs = (jsFunc, targetingMsgJson) => {\n const func = window.parent[jsFunc]\n if (typeof func === 'function') {\n if (targetingMsgJson.display.kv != null) {\n func(targetingMsgJson.display.kv)\n } else {\n func()\n }\n }\n }\n\n const setupClickUrl = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n incrementImpression(targetingMsgJson)\n setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy)\n }\n\n const incrementImpression = (targetingMsgJson) => {\n const data = {}\n data.type = 'event'\n data.evtName = NOTIFICATION_VIEWED\n data.evtData = { [WZRK_ID]: targetingMsgJson.wzrk_id }\n if (targetingMsgJson.wzrk_pivot) {\n data.evtData = { ...data.evtData, wzrk_pivot: targetingMsgJson.wzrk_pivot }\n }\n _request.processEvent(data)\n }\n\n const renderPersonalisationBanner = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const bannerEl = document.createElement('ct-web-personalisation-banner')\n bannerEl.msgId = targetingMsgJson.wzrk_id\n bannerEl.pivotId = targetingMsgJson.wzrk_pivot\n bannerEl.divHeight = targetingMsgJson.display.divHeight\n bannerEl.details = targetingMsgJson.display.details[0]\n const containerEl = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n containerEl.innerHTML = ''\n containerEl.appendChild(bannerEl)\n }\n\n const renderPersonalisationCarousel = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-carousel') === undefined) {\n customElements.define('ct-web-personalisation-carousel', CTWebPersonalisationCarousel)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const carousel = document.createElement('ct-web-personalisation-carousel')\n carousel.target = targetingMsgJson\n const container = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n container.innerHTML = ''\n container.appendChild(carousel)\n }\n\n const renderPopUpImageOnly = (targetingMsgJson) => {\n const divId = 'wzrkImageOnlyDiv'\n const popupImageOnly = document.createElement('ct-web-popup-imageonly')\n popupImageOnly.session = _session\n popupImageOnly.target = targetingMsgJson\n const containerEl = document.getElementById(divId)\n containerEl.innerHTML = ''\n containerEl.style.visibility = 'hidden'\n containerEl.appendChild(popupImageOnly)\n }\n\n const renderFooterNotification = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const displayObj = targetingMsgJson.display\n\n if (displayObj.wtarget_type === 2) { // Handling Web Native display\n // Logic for kv pair data\n if (targetingMsgJson.msgContent.type === 1) {\n const inaObj = {}\n\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.msgContent.kv != null) {\n inaObj.kv = targetingMsgJson.msgContent.kv\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n return\n }\n }\n if (displayObj.layout === 1) { // Handling Web Exit Intent\n return showExitIntent(undefined, targetingMsgJson)\n }\n if (displayObj.layout === 3) { // Handling Web Popup Image Only\n const divId = 'wzrkImageOnlyDiv'\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById(divId) != null || document.getElementById('intentPreview') != null) {\n return\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n document.body.appendChild(msgDiv)\n if (customElements.get('ct-web-popup-imageonly') === undefined) {\n customElements.define('ct-web-popup-imageonly', CTWebPopupImageOnly)\n }\n return renderPopUpImageOnly(targetingMsgJson)\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const divId = 'wizParDiv' + displayObj.layout\n\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n if (document.getElementById(divId) != null) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = divId\n const isBanner = displayObj.layout === 2\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n const viewHeight = window.innerHeight\n const viewWidth = window.innerWidth\n let legacy = false\n\n if (!isBanner) {\n const marginBottom = viewHeight * 5 / 100\n var contentHeight = 10\n let right = viewWidth * 5 / 100\n let bottomPosition = contentHeight + marginBottom\n let width = viewWidth * 30 / 100 + 20\n let widthPerct = 'width:30%;'\n // for small devices - mobile phones\n if ((/mobile/i.test(navigator.userAgent) || (/mini/i.test(navigator.userAgent))) && /iPad/i.test(navigator.userAgent) === false) {\n width = viewWidth * 85 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:80%;'\n // medium devices - tablets\n } else if ('ontouchstart' in window || (/tablet/i.test(navigator.userAgent))) {\n width = viewWidth * 50 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:50%;'\n }\n // legacy footer notif\n if (displayObj.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden; bottom:' + bottomPosition + 'px !important;width:' + width + 'px !important;right:' + right + 'px !important;position:fixed;z-index:2147483647;')\n } else {\n msgDiv.setAttribute('style', widthPerct + displayObj.iFrameStyle)\n }\n } else {\n msgDiv.setAttribute('style', displayObj.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n\n const borderRadius = displayObj.br === false ? '0' : '8'\n\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, leftTd, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n leftTd = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n leftTd = '#f4f4f4'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"\"\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'\" + divId + \"');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"\" +\n // \"\"+\n '' + imageTd + \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
'\n html = css + title + body\n }\n\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n const ifrm = (iframe.contentWindow) ? iframe.contentWindow : (iframe.contentDocument.document) ? iframe.contentDocument.document : iframe.contentDocument\n const doc = ifrm.document\n\n // Dispatch event for popup box/banner close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n doc.open()\n doc.write(html)\n\n if (displayObj['custom-editor']) {\n appendScriptForCustomEvent(targetingMsgJson, doc)\n }\n doc.close()\n\n const adjustIFrameHeight = () => {\n // adjust iframe and body height of html inside correctly\n contentHeight = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv').scrollHeight\n if (displayObj['custom-editor'] !== true && !isBanner) {\n contentHeight += 25\n }\n document.getElementById('wiz-iframe').contentDocument.body.style.margin = '0px'\n document.getElementById('wiz-iframe').style.height = contentHeight + 'px'\n }\n\n const ua = navigator.userAgent.toLowerCase()\n if (ua.indexOf('safari') !== -1) {\n if (ua.indexOf('chrome') > -1) {\n iframe.onload = () => {\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n } else {\n let inDoc = iframe.contentDocument || iframe.contentWindow\n if (inDoc.document) inDoc = inDoc.document\n // safari iphone 7+ needs this.\n adjustIFrameHeight()\n const _timer = setInterval(() => {\n if (inDoc.readyState === 'complete') {\n clearInterval(_timer)\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }, 10)\n }\n } else {\n iframe.onload = () => {\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }\n }\n\n const appendScriptForCustomEvent = (targetingMsgJson, doc) => {\n const script = doc.createElement('script')\n script.innerHTML = `\n const ct__camapignId = '${targetingMsgJson.wzrk_id}';\n const ct__formatVal = (v) => {\n return v && v.trim().substring(0, 20);\n }\n const ct__parentOrigin = window.parent.origin;\n document.body.addEventListener('click', (event) => {\n const elem = event.target.closest?.('a[wzrk_c2a], button[wzrk_c2a]');\n if (elem) {\n const {innerText, id, name, value, href} = elem;\n const clickAttr = elem.getAttribute('onclick') || elem.getAttribute('click');\n const onclickURL = clickAttr?.match(/(window.open)[(\\](\\\"|')(.*)(\\\"|',)/)?.[3] || clickAttr?.match(/(location.href *= *)(\\\"|')(.*)(\\\"|')/)?.[3];\n const props = {innerText, id, name, value};\n let msgCTkv = Object.keys(props).reduce((acc, c) => {\n const formattedVal = ct__formatVal(props[c]);\n formattedVal && (acc['wzrk_click_' + c] = formattedVal);\n return acc;\n }, {});\n if(onclickURL) { msgCTkv['wzrk_click_' + 'url'] = onclickURL; }\n if(href) { msgCTkv['wzrk_click_' + 'c2a'] = href; }\n const notifData = { msgId: ct__camapignId, msgCTkv, pivotId: '${targetingMsgJson.wzrk_pivot}' };\n window.parent.clevertap.renderNotificationClicked(notifData);\n }\n });\n `\n doc.body.appendChild(script)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe-intent'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n const ifrm = (iframe.contentWindow) ? iframe.contentWindow : (iframe.contentDocument.document) ? iframe.contentDocument.document : iframe.contentDocument\n const doc = ifrm.document\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n doc.open()\n doc.write(html)\n if (targetingMsgJson.display['custom-editor']) {\n appendScriptForCustomEvent(targetingMsgJson, doc)\n }\n doc.close()\n\n const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n this.#logger.error('Error subscribing: ' + error)\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\n// import { initialiseCTBuilder } from './modules/visualBuilder/pageBuilder'\nimport { initialiseCTBuilder, renderVisualBuilder } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token) {\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n #handleMessageEvent (event) {\n if (event.data && event.data.message) {\n if (event.data.message === 'Dashboard' && event.data.url) {\n initialiseCTBuilder(event.data.url, event.data.variant ?? null)\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n }\n }\n\n pageChanged () {\n const search = window.location.search\n if (search === '?ctBuilder') {\n // open in visual builder mode\n console.log('open in visual builder mode')\n window.addEventListener('message', this.#handleMessageEvent, false)\n window.postMessage('builder', '*')\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', this.#handleMessageEvent, false)\n window.postMessage('preview', '*')\n return\n }\n\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","constructor","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","dataPostPEURL","dataPostURL","recorderURL","emailURL","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","save","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","read","data","getItem","parse","e","remove","removeItem","removeCookie","name","domain","cookieStr","document","cookie","createCookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","readCookie","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","saveToLSorCookie","property","location","hostname","$ct","globalCache","readFromLSorCookie","trim","err","createBroadCookie","broadDomain","domainParts","testBroadDomain","testCookieName","tempCookie","getMetaProp","metaObj","setMetaProp","wzrkMetaObj","getAndClearMetaProp","setInstantDeleteFlagInK","k","flag","backupEvent","reqNo","backupArr","q","debug","removeBackup","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","get","item","saveCacheToLS","set","allKeys","objToArray","index","temp","getKey","getSecondLastKey","keysArr","getLastKey","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","s","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","sessionObj","getSessionCookieObject","kIdFromLS","guidFromLRUCache","lastK","lastGUID","unregisterTokenForGuid","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","_processOldValues","getDetails","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","fireRequest","skipARP","sendOULFlag","getDelayFrequency","account","randomDelay","random","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","ProfileHandler","profilesArr","getAttribute","propName","_handleIncrementDecrementValue","command","tz","profile","addSystemDataToObject","addFlags","compressedData","saveAndFireRequest","_handleMultiValueSet","arrayVal","array","toLowerCase","sendMultiValueData","_handleMultiValueAdd","propKey","propVal","_handleMultiValueRemove","_handleMultiValueDelete","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","clear","addToK","ids","g","kId","anonymousUser","foundInCache","gFromCache","Identity","cookieName","loginArr","pop","processProfile","CTWebPersonalisationBanner","HTMLElement","_details","shadow","attachShadow","mode","details","renderBanner","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","target","renderCarousel","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","button","setInterval","sliderTime","goTo","prev","cur","CTWebPopupImageOnly","_session","popup","container","resizeObserver","renderImageOnlyPopup","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","Message","config","message","wrapper","snackBar","renderMessage","createEl","part","_el","msg","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","raiseClickedEvent","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","contains","setBadgeStyle","msgCount","incomingMessages","msgs","updateInboxMessages","incomingMessagesForPreview","previewMsgs","now","buildUIForMessages","updateUnviewedBadgeCounter","connectedCallback","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","addMsgsToInboxFromLS","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","deleteMsgsFromUI","getInboxMessages","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","top","right","getBoundingClientRect","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","inbox_notifs","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","initialiseCTBuilder","variant","onContentLoad","position","overlayPath","loadOverlayScript","then","catch","loadCSS","loadTypeKit","link","rel","head","script","src","onload","Overlay","Error","onerror","kitId","scriptTimeout","h","documentElement","className","tk","onreadystatechange","Typekit","load","renderVisualBuilder","targetingMsgJson","siteUrl","selectors","selector","element","querySelector","outerHTML","intervalId","retryElement","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","onclick","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","inaObj","kvPairsEvent","CustomEvent","dispatchEvent","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","pointerCss","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","ifrm","contentWindow","contentDocument","doc","closeCampaign","Event","write","appendScriptForCustomEvent","close","adjustIFrameHeight","scrollHeight","margin","ua","inDoc","_timer","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","getTotalVisits","visitCount","getLastVisit","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","info","debugPE","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","getTimeElapsed","sessionStart","getPageCount","seqNo","requestTime","RequestManager","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","post","fetch","method","headers","response","ok","json","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","_enableWebPush","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","skipDialog","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","getValue","getdefaultValue","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","addValueChangedCallback","removeValueChangedCallback","clearStartFlag","VariableStore","syncVariables","onSyncSuccess","onSyncFailure","meta","r","status","fetchVariables","onFetchCallback","addVariablesChangedCallback","callback","addOneTimeVariablesChangedCallback","removeVariablesChangedCallback","removeOneTimeVariablesChangedCallback","callBack","CleverTap","spa","isSpa","bind","enablePersonalization","_isPersonalisationActive","ReqestManager","onUserLogin","privacy","notifications","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","handleDecrementValue","setMultiValuesForKey","addMultiValueForKey","addMultiValuesForKey","removeMultiValueForKey","removeMultiValuesForKey","removeValueForKey","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","sendLocationData","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","elements","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","postMessage","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","setOffline","arg","defineVariable","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;EAAO,MAAMA,aAAa,GAAG,oBAAtB;EACA,MAAMC,eAAe,GAAG,QAAxB;EACA,MAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;ECAQ,MAAMC,OAAN,CAAc;EAO3BC,EAAAA,WAAW,GAAsE;EAAA,QAApE;EAAEC,MAAAA;EAAF,KAAoE,uEAA3D,EAA2D;EAAA,QAAvDC,MAAuD,uEAA9C,EAA8C;EAAA,QAA1CC,YAA0C,uEAA3BP,aAA2B;EAAA,QAAZQ,KAAY,uEAAJ,EAAI;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,aALvE;EAKuE;EAAA;EAAA;EAAA,aAJjER;EAIiE;EAAA;EAAA;EAAA,aAHjE;EAGiE;EAAA;EAAA;EAAA,aAFxE;EAEwE;EAC/E,SAAKK,EAAL,GAAUA,EAAV;;EACA,QAAIC,MAAJ,EAAY;EACV,WAAKA,MAAL,GAAcA,MAAd;EACD;;EACD,QAAIC,YAAJ,EAAkB;EAChB,WAAKA,YAAL,GAAoBA,YAApB;EACD;;EACD,QAAIC,KAAJ,EAAW;EACT,WAAKA,KAAL,GAAaA,KAAb;EACD;EACF;;EAED,MAAIH,EAAJ,GAAU;EACR,uCAAO,IAAP;EACD;;EAED,MAA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AAQ,OAAOrC,MAAM,CAACqqC,MAAd,KAAyB,WAAzB,IAAwCrqC,MAAM,CAACqqC,MAAP,CAAcC,IAAd,KAAuB,YAAvE;EACD;;yDAMmBlsC,MAAM;EACxB,MAAI,KAAKqlC,wBAAL,EAAJ,EAAqC;EACnCrlC,IAAAA,IAAI,CAAC+9B,KAAL,GAAa,IAAb;EACD;EACF;;QCtxBGruB,SAAS,GAAG,IAAIy8B,SAAJ,CAAcvqC,MAAM,CAAC8N,SAArB;EAElB9N,MAAM,CAAC8N,SAAP,GAAmB9N,MAAM,CAAC+N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/modules/visualBuilder/pageBuilder.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/notification.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {}\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n // Initialize array\n var array = []\n\n // Check if globalProfileMap is null, initialize if needed\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n // Check if the value to be set is either string or number\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = $ct.globalProfileMap[propKey]\n array.push(typeof propVal === 'number' ? propVal : propVal.toLowerCase())\n } else {\n $ct.globalProfileMap[propKey] = propVal\n }\n } else {\n // Check if propVal is an array\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = Array.isArray($ct.globalProfileMap[propKey]) ? $ct.globalProfileMap[propKey] : [$ct.globalProfileMap[propKey]]\n }\n\n // Check for case-sensitive inputs and filter the same ones\n for (var i = 0; i < propVal.length; i++) {\n if (typeof propVal[i] === 'number' && !array.includes(propVal[i])) {\n array.push(propVal[i])\n } else if (typeof propVal[i] === 'string' && !array.includes(propVal[i].toLowerCase())) {\n array.push(propVal[i].toLowerCase())\n } else if ((typeof propVal[i] === 'number' && array.includes(propVal[i])) || (typeof propVal[i] === 'string' && array.includes(propVal[i].toLowerCase()))) {\n console.error('Values already included')\n } else {\n console.error('Array supports only string or number type values')\n }\n }\n\n // Update globalProfileMap with the array\n $ct.globalProfileMap[propKey] = array\n }\n\n // Save to local storage or cookie\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Call the sendMultiValueData function\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n var index = $ct.globalProfileMap[propKey].indexOf(propVal)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n } else {\n for (var k = 0; k < propVal.length; k++) {\n var idx = $ct.globalProfileMap[propKey].indexOf(propVal[k])\n if (idx !== -1) {\n $ct.globalProfileMap[propKey].splice(idx, 1)\n }\n }\n }\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n // console.log('Raise notification clicked event for ', item)\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","export const initialiseCTBuilder = (url, variant) => {\n document.addEventListener('DOMContentLoaded', () => onContentLoad(url, variant))\n}\n\nlet container\n\nfunction onContentLoad (url, variant) {\n document.body.innerHTML = ''\n container = document.createElement('div')\n container.id = 'overlayDiv'\n container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form\n container.style.display = 'flex'\n document.body.appendChild(container)\n const overlayPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js'\n loadOverlayScript(overlayPath, url, variant)\n .then(() => {\n console.log('Overlay script loaded successfully.')\n })\n .catch((error) => {\n console.error('Error loading overlay script:', error)\n })\n loadCSS()\n loadTypeKit()\n}\n\nfunction loadCSS () {\n var link = document.createElement('link')\n link.rel = 'stylesheet'\n link.type = 'text/css'\n link.href = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css'\n document.head.appendChild(link)\n}\n\nfunction loadOverlayScript (overlayPath, url, variant) {\n return new Promise((resolve, reject) => {\n var script = document.createElement('script')\n script.type = 'module'\n script.src = overlayPath\n script.onload = function () {\n if (typeof window.Overlay === 'function') {\n window.Overlay('#overlayDiv', url, variant)\n resolve()\n } else {\n reject(new Error('ContentLayout not found in overlay.js'))\n }\n }\n script.onerror = function (error) {\n reject(error)\n }\n document.head.appendChild(script)\n })\n}\n\nfunction loadTypeKit () {\n var config = {\n kitId: 'eqj6nom',\n scriptTimeout: 3000,\n async: true\n }\n\n var d = document\n var h = d.documentElement\n var t = setTimeout(function () {\n h.className = h.className.replace(/\\bwf-loading\\b/g, '') + ' wf-inactive'\n // $(document).trigger(\"TypeKitReady\");\n }, config.scriptTimeout)\n var tk = d.createElement('script')\n var f = false\n var s = d.getElementsByTagName('script')[0]\n var a\n\n h.className += ' wf-loading'\n tk.src = 'https://use.typekit.net/' + config.kitId + '.js'\n tk.async = true\n tk.onload = tk.onreadystatechange = function () {\n a = this.readyState\n if (f || (a && a !== 'complete' && a !== 'loaded')) return\n f = true\n clearTimeout(t)\n try {\n // eslint-disable-next-line no-undef\n Typekit.load(config)\n } catch (e) {}\n }\n\n s.parentNode.insertBefore(tk, s)\n}\n\nexport const renderVisualBuilder = (targetingMsgJson, isPreview) => {\n const details = targetingMsgJson.display.details[0]\n const siteUrl = Object.keys(details)[0]\n const selectors = details[siteUrl]\n\n if (siteUrl === window.location.href) {\n for (const selector in selectors) {\n const element = document.querySelector(selector)\n if (element) {\n if (selectors[selector].html) {\n element.outerHTML = selectors[selector].html\n } else {\n // Update json data\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n } else {\n let count = 0\n const intervalId = setInterval(() => {\n const retryElement = document.querySelector(selector)\n if (retryElement) {\n if (selectors[selector].html) {\n retryElement.outerHTML = selectors[selector].html\n } else {\n // Update json data\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n clearInterval(intervalId)\n } else {\n count++\n if (count >= 20) {\n console.log(`No element present on DOM with selector '${selector}'.`)\n clearInterval(intervalId)\n }\n }\n }, 500)\n }\n }\n }\n}\n// function addOverlayScript (overlayPath) {\n// const scriptTag = document.createElement('script')\n// scriptTag.setAttribute('type', 'text/javascript')\n// scriptTag.setAttribute('id', 'wzrk-alert-js')\n// scriptTag.setAttribute('src', overlayPath)\n// document.getElementsByTagName('body')[0].appendChild(scriptTag)\n// return scriptTag\n// }\n","import {\n addToLocalProfileMap,\n arp,\n getCampaignObject,\n saveCampaignObject,\n closeIframe\n} from './clevertap'\n\nimport {\n CAMP_COOKIE_NAME,\n DISPLAY,\n GLOBAL,\n EV_COOKIE,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n WZRK_PREFIX,\n WZRK_ID,\n CAMP_COOKIE_G,\n GCOOKIE_NAME\n} from './constants'\n\nimport {\n getNow,\n getToday\n} from './datetime'\n\nimport {\n compressToBase64\n} from './encoder'\n\nimport { StorageManager, $ct } from './storage'\nimport RequestDispatcher from './requestDispatcher'\nimport { CTWebPersonalisationBanner } from './web-personalisation/banner'\nimport { CTWebPersonalisationCarousel } from './web-personalisation/carousel'\nimport { CTWebPopupImageOnly } from './web-popupImageonly/popupImageonly'\nimport { checkAndRegisterWebInboxElements, initializeWebInbox, processWebInboxSettings, hasWebInboxSettingsInLS, processInboxNotifs } from '../modules/web-inbox/helper'\nimport { renderVisualBuilder } from '../modules/visualBuilder/pageBuilder'\n\nconst _tr = (msg, {\n device,\n session,\n request,\n logger\n}) => {\n const _device = device\n const _session = session\n const _request = request\n const _logger = logger\n let _wizCounter = 0\n\n // msg = {\n // arp: {\n // j_n: 'Zw==',\n // i_n: 'Y2NmewICAw==',\n // d_ts: 0,\n // dh: 0,\n // v: 1,\n // j_s: '{ }',\n // id: 'WWW-WWW-WWRZ',\n // e_ts: 0,\n // r_ts: 1649748826,\n // rc_w: 60,\n // rc_n: 5\n // },\n // inapp_notifs: [\n // {\n // msgContent: {\n // templateType: 'point-and-click',\n // type: 4\n // },\n // display: {\n // divId: 'hero-banner',\n // details: [{\n // 'http://localhost:3000/': {\n // '.heroDi1v': {\n // html: 'Hello Sonam'\n // },\n // '#selector_2': {\n // html: '

Hello Sonam

'\n // },\n // '.heroDiv2': {\n // json: {\n // name: 'Sonam',\n // identity: 1234\n // }\n // }\n // }\n // }],\n // wtarget_type: 2,\n // wmc: 1,\n // ff: 'Desktop'\n // },\n // wzrk_id: '1655316906_20220620',\n // wzrk_pivot: 'wzrk_default'\n // }\n // ]\n // }\n // Campaign House keeping\n const doCampHouseKeeping = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const today = getToday()\n\n const incrCount = (obj, campaignId, excludeFromFreqCaps) => {\n let currentCount = 0\n let totalCount = 0\n if (obj[campaignId] != null) {\n currentCount = obj[campaignId]\n }\n currentCount++\n if (obj.tc != null) {\n totalCount = obj.tc\n }\n // if exclude from caps then dont add to total counts\n if (excludeFromFreqCaps < 0) {\n totalCount++\n }\n\n obj.tc = totalCount\n obj[campaignId] = currentCount\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n delete sessionStorage[CAMP_COOKIE_NAME]\n var campTypeObj = {}\n const campObj = getCampaignObject()\n if (targetingMsgJson.display.wtarget_type === 3 && campObj.hasOwnProperty('wi')) {\n campTypeObj = campObj.wi\n } else if ((targetingMsgJson.display.wtarget_type === 0 || targetingMsgJson.display.wtarget_type === 1) && campObj.hasOwnProperty('wp')) {\n campTypeObj = campObj.wp\n } else {\n campTypeObj = {}\n }\n if (campObj.hasOwnProperty('global')) {\n campTypeObj.wp = campObj\n }\n // global session limit. default is 1\n if (targetingMsgJson[DISPLAY].wmc == null) {\n targetingMsgJson[DISPLAY].wmc = 1\n }\n\n // global session limit for web inbox. default is 1\n if (targetingMsgJson[DISPLAY].wimc == null) {\n targetingMsgJson[DISPLAY].wimc = 1\n }\n\n var excludeFromFreqCaps = -1 // efc - Exclude from frequency caps\n let campaignSessionLimit = -1 // mdc - Once per session\n let campaignDailyLimit = -1 // tdc - Once per day\n let campaignTotalLimit = -1 // tlc - Once per user for the duration of campaign\n let totalDailyLimit = -1\n let totalSessionLimit = -1 // wmc - Web Popup Global Session Limit\n let totalInboxSessionLimit = -1 // wimc - Web Inbox Global Session Limit\n\n if (targetingMsgJson[DISPLAY].efc != null) { // exclude from frequency cap\n excludeFromFreqCaps = parseInt(targetingMsgJson[DISPLAY].efc, 10)\n }\n if (targetingMsgJson[DISPLAY].mdc != null) { // Campaign Session Limit\n campaignSessionLimit = parseInt(targetingMsgJson[DISPLAY].mdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tdc != null) { // No of web popups in a day per campaign\n campaignDailyLimit = parseInt(targetingMsgJson[DISPLAY].tdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tlc != null) { // Total lifetime count\n campaignTotalLimit = parseInt(targetingMsgJson[DISPLAY].tlc, 10)\n }\n if (targetingMsgJson[DISPLAY].wmp != null) { // No of campaigns per day\n totalDailyLimit = parseInt(targetingMsgJson[DISPLAY].wmp, 10)\n }\n if (targetingMsgJson[DISPLAY].wmc != null) { // No of campaigns per session\n totalSessionLimit = parseInt(targetingMsgJson[DISPLAY].wmc, 10)\n }\n\n if (targetingMsgJson[DISPLAY].wimc != null) { // No of inbox campaigns per session\n totalInboxSessionLimit = parseInt(targetingMsgJson[DISPLAY].wimc, 10)\n }\n // session level capping\n var sessionObj = campTypeObj[_session.sessionId]\n if (sessionObj) {\n const campaignSessionCount = sessionObj[campaignId]\n const totalSessionCount = sessionObj.tc\n // dnd\n if (campaignSessionCount === 'dnd' && !$ct.dismissSpamControl) {\n return false\n }\n\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n // Inbox session\n if (totalInboxSessionLimit > 0 && totalSessionCount >= totalInboxSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n } else {\n // session\n if (totalSessionLimit > 0 && totalSessionCount >= totalSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n }\n\n // campaign session\n if (campaignSessionLimit > 0 && campaignSessionCount >= campaignSessionLimit) {\n return false\n }\n } else {\n sessionObj = {}\n campTypeObj[_session.sessionId] = sessionObj\n }\n\n // daily level capping\n var dailyObj = campTypeObj[today]\n if (dailyObj != null) {\n const campaignDailyCount = dailyObj[campaignId]\n const totalDailyCount = dailyObj.tc\n // daily\n if (totalDailyLimit > 0 && totalDailyCount >= totalDailyLimit && excludeFromFreqCaps < 0) {\n return false\n }\n // campaign daily\n if (campaignDailyLimit > 0 && campaignDailyCount >= campaignDailyLimit) {\n return false\n }\n } else {\n dailyObj = {}\n campTypeObj[today] = dailyObj\n }\n\n var globalObj = campTypeObj[GLOBAL]\n if (globalObj != null) {\n const campaignTotalCount = globalObj[campaignId]\n // campaign total\n if (campaignTotalLimit > 0 && campaignTotalCount >= campaignTotalLimit) {\n return false\n }\n } else {\n globalObj = {}\n campTypeObj[GLOBAL] = globalObj\n }\n }\n // delay\n if (targetingMsgJson[DISPLAY].delay != null && targetingMsgJson[DISPLAY].delay > 0) {\n const delay = targetingMsgJson[DISPLAY].delay\n targetingMsgJson[DISPLAY].delay = 0\n setTimeout(_tr, delay * 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n return false\n }\n\n incrCount(sessionObj, campaignId, excludeFromFreqCaps)\n incrCount(dailyObj, campaignId, excludeFromFreqCaps)\n incrCount(globalObj, campaignId, excludeFromFreqCaps)\n\n let campKey = 'wp'\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n campKey = 'wi'\n }\n // get ride of stale sessions and day entries\n const newCampObj = {}\n newCampObj[_session.sessionId] = sessionObj\n newCampObj[today] = dailyObj\n newCampObj[GLOBAL] = globalObj\n saveCampaignObject({ [campKey]: newCampObj })\n }\n\n const getCookieParams = () => {\n const gcookie = _device.getGuid()\n const scookieObj = _session.getSessionCookieObject()\n return '&t=wc&d=' + encodeURIComponent(compressToBase64(gcookie + '|' + scookieObj.p + '|' + scookieObj.s))\n }\n\n const setupClickEvent = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n if (onClick !== '' && onClick != null) {\n let ctaElement\n let jsCTAElements\n if (isLegacy) {\n ctaElement = contentDiv\n } else if (contentDiv !== null) {\n jsCTAElements = contentDiv.getElementsByClassName('jsCT_CTA')\n if (jsCTAElements != null && jsCTAElements.length === 1) {\n ctaElement = jsCTAElements[0]\n }\n }\n const jsFunc = targetingMsgJson.display.jsFunc\n const isPreview = targetingMsgJson.display.preview\n if (isPreview == null) {\n onClick += getCookieParams()\n }\n\n if (ctaElement != null) {\n ctaElement.onclick = () => {\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n if (isPreview == null) {\n RequestDispatcher.fireRequest(onClick)\n }\n invokeExternalJs(jsFunc, targetingMsgJson)\n // close iframe. using -1 for no campaignId\n closeIframe('-1', divId, _session.sessionId)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n }\n }\n\n const invokeExternalJs = (jsFunc, targetingMsgJson) => {\n const func = window.parent[jsFunc]\n if (typeof func === 'function') {\n if (targetingMsgJson.display.kv != null) {\n func(targetingMsgJson.display.kv)\n } else {\n func()\n }\n }\n }\n\n const setupClickUrl = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n incrementImpression(targetingMsgJson)\n setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy)\n }\n\n const incrementImpression = (targetingMsgJson) => {\n const data = {}\n data.type = 'event'\n data.evtName = NOTIFICATION_VIEWED\n data.evtData = { [WZRK_ID]: targetingMsgJson.wzrk_id }\n if (targetingMsgJson.wzrk_pivot) {\n data.evtData = { ...data.evtData, wzrk_pivot: targetingMsgJson.wzrk_pivot }\n }\n _request.processEvent(data)\n }\n\n const renderPersonalisationBanner = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const bannerEl = document.createElement('ct-web-personalisation-banner')\n bannerEl.msgId = targetingMsgJson.wzrk_id\n bannerEl.pivotId = targetingMsgJson.wzrk_pivot\n bannerEl.divHeight = targetingMsgJson.display.divHeight\n bannerEl.details = targetingMsgJson.display.details[0]\n const containerEl = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n containerEl.innerHTML = ''\n containerEl.appendChild(bannerEl)\n }\n\n const renderPersonalisationCarousel = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-carousel') === undefined) {\n customElements.define('ct-web-personalisation-carousel', CTWebPersonalisationCarousel)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const carousel = document.createElement('ct-web-personalisation-carousel')\n carousel.target = targetingMsgJson\n const container = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n container.innerHTML = ''\n container.appendChild(carousel)\n }\n\n const renderPopUpImageOnly = (targetingMsgJson) => {\n const divId = 'wzrkImageOnlyDiv'\n const popupImageOnly = document.createElement('ct-web-popup-imageonly')\n popupImageOnly.session = _session\n popupImageOnly.target = targetingMsgJson\n const containerEl = document.getElementById(divId)\n containerEl.innerHTML = ''\n containerEl.style.visibility = 'hidden'\n containerEl.appendChild(popupImageOnly)\n }\n\n const renderFooterNotification = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const displayObj = targetingMsgJson.display\n\n if (displayObj.wtarget_type === 2) { // Handling Web Native display\n // Logic for kv pair data\n if (targetingMsgJson.msgContent.type === 1) {\n const inaObj = {}\n\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.msgContent.kv != null) {\n inaObj.kv = targetingMsgJson.msgContent.kv\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n return\n }\n }\n if (displayObj.layout === 1) { // Handling Web Exit Intent\n return showExitIntent(undefined, targetingMsgJson)\n }\n if (displayObj.layout === 3) { // Handling Web Popup Image Only\n const divId = 'wzrkImageOnlyDiv'\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById(divId) != null || document.getElementById('intentPreview') != null) {\n return\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n document.body.appendChild(msgDiv)\n if (customElements.get('ct-web-popup-imageonly') === undefined) {\n customElements.define('ct-web-popup-imageonly', CTWebPopupImageOnly)\n }\n return renderPopUpImageOnly(targetingMsgJson)\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const divId = 'wizParDiv' + displayObj.layout\n\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n if (document.getElementById(divId) != null) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = divId\n const isBanner = displayObj.layout === 2\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n const viewHeight = window.innerHeight\n const viewWidth = window.innerWidth\n let legacy = false\n\n if (!isBanner) {\n const marginBottom = viewHeight * 5 / 100\n var contentHeight = 10\n let right = viewWidth * 5 / 100\n let bottomPosition = contentHeight + marginBottom\n let width = viewWidth * 30 / 100 + 20\n let widthPerct = 'width:30%;'\n // for small devices - mobile phones\n if ((/mobile/i.test(navigator.userAgent) || (/mini/i.test(navigator.userAgent))) && /iPad/i.test(navigator.userAgent) === false) {\n width = viewWidth * 85 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:80%;'\n // medium devices - tablets\n } else if ('ontouchstart' in window || (/tablet/i.test(navigator.userAgent))) {\n width = viewWidth * 50 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:50%;'\n }\n // legacy footer notif\n if (displayObj.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden; bottom:' + bottomPosition + 'px !important;width:' + width + 'px !important;right:' + right + 'px !important;position:fixed;z-index:2147483647;')\n } else {\n msgDiv.setAttribute('style', widthPerct + displayObj.iFrameStyle)\n }\n } else {\n msgDiv.setAttribute('style', displayObj.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n\n const borderRadius = displayObj.br === false ? '0' : '8'\n\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, leftTd, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n leftTd = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n leftTd = '#f4f4f4'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"\"\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'\" + divId + \"');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"\" +\n // \"\"+\n '' + imageTd + \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
'\n html = css + title + body\n }\n\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n const ifrm = (iframe.contentWindow) ? iframe.contentWindow : (iframe.contentDocument.document) ? iframe.contentDocument.document : iframe.contentDocument\n const doc = ifrm.document\n\n // Dispatch event for popup box/banner close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n doc.open()\n doc.write(html)\n\n if (displayObj['custom-editor']) {\n appendScriptForCustomEvent(targetingMsgJson, doc)\n }\n doc.close()\n\n const adjustIFrameHeight = () => {\n // adjust iframe and body height of html inside correctly\n contentHeight = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv').scrollHeight\n if (displayObj['custom-editor'] !== true && !isBanner) {\n contentHeight += 25\n }\n document.getElementById('wiz-iframe').contentDocument.body.style.margin = '0px'\n document.getElementById('wiz-iframe').style.height = contentHeight + 'px'\n }\n\n const ua = navigator.userAgent.toLowerCase()\n if (ua.indexOf('safari') !== -1) {\n if (ua.indexOf('chrome') > -1) {\n iframe.onload = () => {\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n } else {\n let inDoc = iframe.contentDocument || iframe.contentWindow\n if (inDoc.document) inDoc = inDoc.document\n // safari iphone 7+ needs this.\n adjustIFrameHeight()\n const _timer = setInterval(() => {\n if (inDoc.readyState === 'complete') {\n clearInterval(_timer)\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }, 10)\n }\n } else {\n iframe.onload = () => {\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }\n }\n\n const appendScriptForCustomEvent = (targetingMsgJson, doc) => {\n const script = doc.createElement('script')\n script.innerHTML = `\n const ct__camapignId = '${targetingMsgJson.wzrk_id}';\n const ct__formatVal = (v) => {\n return v && v.trim().substring(0, 20);\n }\n const ct__parentOrigin = window.parent.origin;\n document.body.addEventListener('click', (event) => {\n const elem = event.target.closest?.('a[wzrk_c2a], button[wzrk_c2a]');\n if (elem) {\n const {innerText, id, name, value, href} = elem;\n const clickAttr = elem.getAttribute('onclick') || elem.getAttribute('click');\n const onclickURL = clickAttr?.match(/(window.open)[(\\](\\\"|')(.*)(\\\"|',)/)?.[3] || clickAttr?.match(/(location.href *= *)(\\\"|')(.*)(\\\"|')/)?.[3];\n const props = {innerText, id, name, value};\n let msgCTkv = Object.keys(props).reduce((acc, c) => {\n const formattedVal = ct__formatVal(props[c]);\n formattedVal && (acc['wzrk_click_' + c] = formattedVal);\n return acc;\n }, {});\n if(onclickURL) { msgCTkv['wzrk_click_' + 'url'] = onclickURL; }\n if(href) { msgCTkv['wzrk_click_' + 'c2a'] = href; }\n const notifData = { msgId: ct__camapignId, msgCTkv, pivotId: '${targetingMsgJson.wzrk_pivot}' };\n window.parent.clevertap.renderNotificationClicked(notifData);\n }\n });\n `\n doc.body.appendChild(script)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe-intent'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n const ifrm = (iframe.contentWindow) ? iframe.contentWindow : (iframe.contentDocument.document) ? iframe.contentDocument.document : iframe.contentDocument\n const doc = ifrm.document\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n doc.open()\n doc.write(html)\n if (targetingMsgJson.display['custom-editor']) {\n appendScriptForCustomEvent(targetingMsgJson, doc)\n }\n doc.close()\n\n const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n this.#logger.error('Error subscribing: ' + error)\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\n// import { initialiseCTBuilder } from './modules/visualBuilder/pageBuilder'\nimport { initialiseCTBuilder, renderVisualBuilder } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token) {\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n #handleMessageEvent (event) {\n if (event.data && event.data.message) {\n if (event.data.message === 'Dashboard' && event.data.url) {\n initialiseCTBuilder(event.data.url, event.data.variant ?? null)\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n }\n }\n\n pageChanged () {\n const search = window.location.search\n const parentWindow = window.opener\n\n if (search === '?ctBuilder') {\n // open in visual builder mode\n console.log('open in visual builder mode')\n window.addEventListener('message', this.#handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('builder', '*')\n }\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', this.#handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('preview', '*')\n }\n return\n }\n\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","constructor","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","dataPostPEURL","dataPostURL","recorderURL","emailURL","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","save","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","read","data","getItem","parse","e","remove","removeItem","removeCookie","name","domain","cookieStr","document","cookie","createCookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","readCookie","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","saveToLSorCookie","property","location","hostname","$ct","globalCache","readFromLSorCookie","trim","err","createBroadCookie","broadDomain","domainParts","testBroadDomain","testCookieName","tempCookie","getMetaProp","metaObj","setMetaProp","wzrkMetaObj","getAndClearMetaProp","setInstantDeleteFlagInK","k","flag","backupEvent","reqNo","backupArr","q","debug","removeBackup","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","get","item","saveCacheToLS","set","allKeys","objToArray","index","temp","getKey","getSecondLastKey","keysArr","getLastKey","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","s","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","sessionObj","getSessionCookieObject","kIdFromLS","guidFromLRUCache","lastK","lastGUID","unregisterTokenForGuid","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","_processOldValues","getDetails","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","fireRequest","skipARP","sendOULFlag","getDelayFrequency","account","randomDelay","random","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","ProfileHandler","profilesArr","getAttribute","propName","_handleIncrementDecrementValue","command","tz","profile","addSystemDataToObject","addFlags","compressedData","saveAndFireRequest","_handleMultiValueSet","arrayVal","array","toLowerCase","sendMultiValueData","_handleMultiValueAdd","propKey","propVal","_handleMultiValueRemove","_handleMultiValueDelete","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","clear","addToK","ids","g","kId","anonymousUser","foundInCache","gFromCache","Identity","cookieName","loginArr","pop","processProfile","CTWebPersonalisationBanner","HTMLElement","_details","shadow","attachShadow","mode","details","renderBanner","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","target","renderCarousel","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","button","setInterval","sliderTime","goTo","prev","cur","CTWebPopupImageOnly","_session","popup","container","resizeObserver","renderImageOnlyPopup","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","Message","config","message","wrapper","snackBar","renderMessage","createEl","part","_el","msg","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","raiseClickedEvent","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","contains","setBadgeStyle","msgCount","incomingMessages","msgs","updateInboxMessages","incomingMessagesForPreview","previewMsgs","now","buildUIForMessages","updateUnviewedBadgeCounter","connectedCallback","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","addMsgsToInboxFromLS","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","deleteMsgsFromUI","getInboxMessages","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","top","right","getBoundingClientRect","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","inbox_notifs","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","initialiseCTBuilder","variant","onContentLoad","position","overlayPath","loadOverlayScript","then","catch","loadCSS","loadTypeKit","link","rel","head","script","src","onload","Overlay","Error","onerror","kitId","scriptTimeout","h","documentElement","className","tk","onreadystatechange","Typekit","load","renderVisualBuilder","targetingMsgJson","siteUrl","selectors","selector","element","querySelector","outerHTML","intervalId","retryElement","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","onclick","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","inaObj","kvPairsEvent","CustomEvent","dispatchEvent","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","pointerCss","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","ifrm","contentWindow","contentDocument","doc","closeCampaign","Event","write","appendScriptForCustomEvent","close","adjustIFrameHeight","scrollHeight","margin","ua","inDoc","_timer","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","getTotalVisits","visitCount","getLastVisit","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","info","debugPE","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","getTimeElapsed","sessionStart","getPageCount","seqNo","requestTime","RequestManager","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","post","fetch","method","headers","response","ok","json","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","_enableWebPush","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","skipDialog","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","getValue","getdefaultValue","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","addValueChangedCallback","removeValueChangedCallback","clearStartFlag","VariableStore","syncVariables","onSyncSuccess","onSyncFailure","meta","r","status","fetchVariables","onFetchCallback","addVariablesChangedCallback","callback","addOneTimeVariablesChangedCallback","removeVariablesChangedCallback","removeOneTimeVariablesChangedCallback","callBack","CleverTap","spa","isSpa","bind","enablePersonalization","_isPersonalisationActive","ReqestManager","onUserLogin","privacy","notifications","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","handleDecrementValue","setMultiValuesForKey","addMultiValueForKey","addMultiValuesForKey","removeMultiValueForKey","removeMultiValuesForKey","removeValueForKey","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","sendLocationData","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","elements","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","parentWindow","opener","postMessage","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","setOffline","arg","defineVariable","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;EAAO,MAAMA,aAAa,GAAG,oBAAtB;EACA,MAAMC,eAAe,GAAG,QAAxB;EACA,MAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;ECAQ,MAAMC,OAAN,CAAc;EAO3BC,EAAAA,WAAW,GAAsE;EAAA,QAApE;EAAEC,MAAAA;EAAF,KAAoE,uEAA3D,EAA2D;EAAA,QAAvDC,MAAuD,uEAA9C,EAA8C;EAAA,QAA1CC,YAA0C,uEAA3BP,aAA2B;EAAA,QAAZQ,KAAY,uEAAJ,EAAI;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,aALvE;EAKuE;EAAA;EAAA;EAAA,aAJjER;EAIiE;EAAA;EAAA;EAAA,aAHjE;EAGiE;EAAA;EAAA;EAAA,aAFxE;EAEwE;EAC/E,SAAKK,EAAL,GAAUA,EAAV;;EACA,QAAIC,MAAJ,EAAY;EACV,WAAKA,MAAL,GAAcA,MAAd;EACD;;EACD,QAAIC,YAAJ,EAAkB;EAChB,WAAKA,YAAL,GAAoBA,YAApB;EACD;;EACD,QAAIC,KAAJ,EAAW;EACT,WAAKA,KAAL,GAAaA,KAAb;EACD;EACF;;EAED,MAAIH,EAAJ,GAAU;EACR,uCAAO,IAAP;EACD;;EAED,MAAIA,EAAJ,CAAQI,SAAR,EAAmB;EACjB,gEAAkBA,SAAlB;EACD;;EAED,MAAIH,MAAJ,GAAc;EACZ,uCAAO,IAAP;EACD;;EAED,MAAIA,MAAJ,CAAYA,MAAZ,EAAoB;EAClB,0DAAeA,MAAf;EACD;;EA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L,GAAa,IAAb;EACD;EACF;;QC5xBGruB,SAAS,GAAG,IAAI28B,SAAJ,CAAczqC,MAAM,CAAC8N,SAArB;EAElB9N,MAAM,CAAC8N,SAAP,GAAmB9N,MAAM,CAAC+N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file diff --git a/clevertap.min.js b/clevertap.min.js index c15bba48..b0d84795 100644 --- a/clevertap.min.js +++ b/clevertap.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).clevertap=t()}(this,(function(){"use strict";var e=0;function t(t){return"__private_"+e+++"_"+t}function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}const o="clevertap-prod.com",n="https:";var s=t("accountId"),r=t("region"),a=t("targetDomain"),l=t("dcSdkversion"),c=t("token");class d{constructor(){let{id:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";Object.defineProperty(this,s,{writable:!0,value:void 0}),Object.defineProperty(this,r,{writable:!0,value:""}),Object.defineProperty(this,a,{writable:!0,value:o}),Object.defineProperty(this,l,{writable:!0,value:""}),Object.defineProperty(this,c,{writable:!0,value:""}),this.id=e,t&&(this.region=t),i&&(this.targetDomain=i),n&&(this.token=n)}get id(){return i(this,s)[s]}set id(e){i(this,s)[s]=e}get region(){return i(this,r)[r]}set region(e){i(this,r)[r]=e}get dcSDKVersion(){return i(this,l)[l]}set dcSDKVersion(e){i(this,l)[l]=e}get targetDomain(){return i(this,a)[a]}set targetDomain(e){i(this,a)[a]=e}get token(){return i(this,c)[c]}set token(e){i(this,c)[c]=e}get finalTargetDomain(){return this.region?"".concat(this.region,".").concat(this.targetDomain):this.targetDomain===o?"".concat("eu1",".").concat(this.targetDomain):this.targetDomain}get dataPostPEURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/defineVars")}get dataPostURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/a?t=96")}get recorderURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/r?r=1")}get emailURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/e?r=1")}}const h=new RegExp("^\\s+|\\.|:|\\$|'|\"|\\\\|\\s+$","g"),u=new RegExp("^\\s+|'|\"|\\\\|\\s+$","g"),p=new RegExp("'","g"),g="clear",f="Charged ID",v="WZRK_CHARGED_ID",b="WZRK_G",m="WZRK_K",y="WZRK_CAMP",w="WZRK_CAMP_G",C="WZRK_EV",k="WZRK_META",x="WZRK_PR",P="WZRK_ARP",S="WZRK_L",I="global",O="optOut",_="useIP",E="WZRK_X",A="push",L=31536e3,M="wzrk_",T="wzrk_id",R="Notification Viewed",j="Notification Clicked",D="WZRK_FPU",z="WZRK_PSD",B="$incr",N="$add",F="$remove",U="$delete",q="WZRK_INBOX_CONFIG",V="WZRK_INBOX",W=1e3,K="wzrk_fetch",G=["Stayed","UTM Visited","App Launched","Notification Sent",R,j],H=e=>"string"==typeof e||e instanceof String,J=e=>"[object Object]"===Object.prototype.toString.call(e),Z=e=>"object"==typeof e&&e instanceof Date,$=e=>{for(const t in e)if(e.hasOwnProperty(t))return!1;return!0},Y=e=>!isNaN(parseFloat(e))&&isFinite(e),Q=e=>/^-?[\d.]+(?:e-?\d+)?$/.test(e)&&"number"==typeof e,X=e=>null!=e&&"undefined"!==e,ee=(e,t)=>{if("object"!=typeof e){let i;return H(e)?(i=te(e,u),i.length>1024&&(i=i.substring(0,1024),t.reportError(521,i+"... length exceeded 1024 chars. Trimmed."))):i=e,i}for(const i in e)if(e.hasOwnProperty(i)){const o=ee(e[i],t);let n;n=te(i,h),n.length>1024&&(n=n.substring(0,1024),t.reportError(520,n+"... length exceeded 1024 chars. Trimmed.")),delete e[i],e[n]=o}return e},te=(e,t)=>e.replace(t,""),ie=()=>{const e=new Date;return e.getFullYear()+""+e.getMonth()+e.getDay()},oe=()=>Math.floor((new Date).getTime()/1e3),ne=e=>"$D_"+Math.round(e.getTime()/1e3),se=e=>{if(re(e))return"$D_"+e},re=e=>{const t=/^(\d{4})(\d{2})(\d{2})$/.exec(e);if(null==t)return!1;const i=t[3],o=t[2]-1,n=t[1],s=new Date(n,o,i);return s.getDate()==i&&s.getMonth()==o&&s.getFullYear()==n};class ae{static save(e,t){return!(!e||!t)&&(this._isLocalStorageSupported()?(localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),!0):void 0)}static read(e){if(!e)return!1;let t=null;if(this._isLocalStorageSupported()&&(t=localStorage.getItem(e)),null!=t)try{t=JSON.parse(t)}catch(e){}return t}static remove(e){return!!e&&(this._isLocalStorageSupported()?(localStorage.removeItem(e),!0):void 0)}static removeCookie(e,t){let i=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";t&&(i=i+" domain="+t+"; path=/"),document.cookie=i}static createCookie(e,t,i,o){let n="",s="";if(i){const e=new Date;e.setTime(e.getTime()+1e3*i),n="; expires="+e.toGMTString()}o&&(s="; domain="+o),t=encodeURIComponent(t),document.cookie=e+"="+t+n+s+"; path=/"}static readCookie(e){const t=e+"=",i=document.cookie.split(";");for(let e=0;e=0;o--){if(a=0===o?r[o]+a:"."+r[o]+a,this.readCookie(e)){var n="test_"+e+o;if(this.createCookie(n,t,10,a),!this.readCookie(n))continue;this.removeCookie(n,a)}this.createCookie(e,t,i,a);if(this.readCookie(e)==t){s=a,le.broadDomain=s;break}}}else this.createCookie(e,t,i,s)}else this.createCookie(e,t,i,o)}static getMetaProp(e){const t=this.readFromLSorCookie(k);if(null!=t)return t[e]}static setMetaProp(e,t){if(this._isLocalStorageSupported()){let i=this.readFromLSorCookie(k);null==i&&(i={}),void 0===t?delete i[e]:i[e]=t,this.saveToLSorCookie(k,i)}}static getAndClearMetaProp(e){const t=this.getMetaProp(e);return this.setMetaProp(e,void 0),t}static setInstantDeleteFlagInK(){let e=this.readFromLSorCookie(m);null==e&&(e={}),e.flag=!0,this.saveToLSorCookie(m,e)}static backupEvent(e,t,i){let o=this.readFromLSorCookie(S);void 0===o&&(o={}),o[t]={q:e},this.saveToLSorCookie(S,o),i.debug("stored in ".concat(S," reqNo : ").concat(t," -> ").concat(e))}static removeBackup(e,t){const i=this.readFromLSorCookie(S);null!=i&&void 0!==i[e]&&(t.debug("del event: ".concat(e," data-> ").concat(i[e].q)),delete i[e],this.saveToLSorCookie(S,i))}}const le={globalCache:{gcookie:null,REQ_N:0,RESP_N:0},LRU_CACHE:null,globalProfileMap:void 0,globalEventsMap:void 0,blockRequest:!1,isOptInRequest:!1,broadDomain:null,webPushEnabled:null,campaignDivMap:{},currentSessionId:null,wiz_counter:0,notifApi:{notifEnabledFromApi:!1},unsubGroups:[],updatedCategoryLong:null,inbox:null,isPrivacyArrPushed:!1,privacyArray:[],offline:!1,location:null,dismissSpamControl:!1,globalUnsubscribe:!0,flutterVersion:null,variableStore:{}};var ce=t("keyOrder"),de=t("deleteFromObject");class he{constructor(e){Object.defineProperty(this,de,{value:ue}),Object.defineProperty(this,ce,{writable:!0,value:void 0}),this.max=e;let t=ae.readFromLSorCookie(E);if(t){const e={};i(this,ce)[ce]=[],t=t.cache;for(const o in t)t.hasOwnProperty(o)&&(e[t[o][0]]=t[o][1],i(this,ce)[ce].push(t[o][0]));this.cache=e}else this.cache={},i(this,ce)[ce]=[]}get(e){const t=this.cache[e];return t&&(this.cache=i(this,de)[de](e,this.cache),this.cache[e]=t,i(this,ce)[ce].push(e)),this.saveCacheToLS(this.cache),t}set(e,t){const o=this.cache[e],n=i(this,ce)[ce];null!=o?this.cache=i(this,de)[de](e,this.cache):n.length===this.max&&(this.cache=i(this,de)[de](n[0],this.cache)),this.cache[e]=t,i(this,ce)[ce][i(this,ce)[ce]-1]!==e&&i(this,ce)[ce].push(e),this.saveCacheToLS(this.cache)}saveCacheToLS(e){const t=[],o=i(this,ce)[ce];for(const i in o)if(o.hasOwnProperty(i)){const n=[];n.push(o[i]),n.push(e[o[i]]),t.push(n)}ae.saveToLSorCookie(E,{cache:t})}getKey(e){if(null===e)return null;const t=i(this,ce)[ce];for(const i in t)if(t.hasOwnProperty(i)&&this.cache[t[i]]===e)return t[i];return null}getSecondLastKey(){const e=i(this,ce)[ce];return null!=e&&e.length>1?e[e.length-2]:-1}getLastKey(){const e=i(this,ce)[ce].length;if(e)return i(this,ce)[ce][e-1]}}var ue=function(e,t){const o=JSON.parse(JSON.stringify(i(this,ce)[ce])),n={};let s;for(const i in o)o.hasOwnProperty(i)&&(o[i]!==e?n[o[i]]=t[o[i]]:s=i);return o.splice(s,1),i(this,ce)[ce]=JSON.parse(JSON.stringify(o)),n},pe=t("logger"),ge=t("request"),fe=t("device"),ve=t("session");class be{constructor(e){let{logger:t,request:o,device:n,session:s}=e;Object.defineProperty(this,pe,{writable:!0,value:void 0}),Object.defineProperty(this,ge,{writable:!0,value:void 0}),Object.defineProperty(this,fe,{writable:!0,value:void 0}),Object.defineProperty(this,ve,{writable:!0,value:void 0}),i(this,pe)[pe]=t,i(this,ge)[ge]=o,i(this,fe)[fe]=n,i(this,ve)[ve]=s}s(e,t,o,n,s){let r=!1,a=!1;if(window.isOULInProgress&&(o||"undefined"!==n&&n===window.oulReqN)&&(window.isOULInProgress=!1,r=!0),void 0===n&&(n=0),ae.removeBackup(n,i(this,pe)[pe]),n>le.globalCache.REQ_N)return;if(X(i(this,fe)[fe].gcookie)||e&&(a=!0),!X(i(this,fe)[fe].gcookie)||o||"boolean"==typeof s){const n=i(this,ve)[ve].getSessionCookieObject();if(window.isOULInProgress||n.s&&t{if(J(e)){for(var t in e)if(e.hasOwnProperty(t)){if(J(e[t])||Array.isArray(e[t]))return!1;Z(e[t])&&(e[t]=ne(e[t]))}return!0}return!1},Re=(e,t)=>{if(J(e)){for(var i in e)if(e.hasOwnProperty(i))if("Items"===i){if(!Array.isArray(e[i]))return!1;for(var o in e[i].length>50&&t.reportError(522,"Charged Items exceed 50 limit. Actual count: "+e[i].length),e[i])if(e[i].hasOwnProperty(o)&&(!J(e[i][o])||!Te(e[i][o])))return!1}else{if(J(e[i])||Array.isArray(e[i]))return!1;Z(e[i])&&(e[i]=ne(e[i]))}if(H(e[f])||Q(e[f])){const i=e[f]+"";if(void 0===Me&&(Me=ae.readFromLSorCookie(v)),void 0!==Me&&Me.trim()===i.trim())return t.error("Duplicate charged Id - Dropped"+e),!1;Me=i,ae.saveToLSorCookie(v,i)}return!0}return!1};var je=t("logger"),De=t("oldValues"),ze=t("request"),Be=t("isPersonalisationActive"),Ne=t("processEventArray");class Fe extends Array{constructor(e,t){let{logger:o,request:n,isPersonalisationActive:s}=e;super(),Object.defineProperty(this,Ne,{value:Ue}),Object.defineProperty(this,je,{writable:!0,value:void 0}),Object.defineProperty(this,De,{writable:!0,value:void 0}),Object.defineProperty(this,ze,{writable:!0,value:void 0}),Object.defineProperty(this,Be,{writable:!0,value:void 0}),i(this,je)[je]=o,i(this,De)[De]=t,i(this,ze)[ze]=n,i(this,Be)[Be]=s}push(){for(var e=arguments.length,t=new Array(e),o=0;o0;){var t=e.shift();if(!H(t)){i(this,je)[je].error(xe);continue}if(t.length>1024&&(t=t.substring(0,1024),i(this,je)[je].reportError(510,t+"... length exceeded 1024 chars. Trimmed.")),G.includes(t)){i(this,je)[je].reportError(513,t+" is a restricted system event. It cannot be used as an event name.");continue}const o={type:"event"};if(o.evtName=te(t,h),0!==e.length){const n=e.shift();if(J(n)){if("Charged"===t){if(!Re(n,i(this,je)[je])){i(this,je)[je].reportError(511,"Charged event structure invalid. Not sent.");continue}}else if(!Te(n)){i(this,je)[je].reportError(512,t+" event structure invalid. Not sent.");continue}o.evtData=n}else e.unshift(n)}i(this,ze)[ze].processEvent(o)}};const qe=e=>{const t={},i=e.indexOf("?");if(i>1){const o=e.substring(i+1);let n;const s=/\+/g,r=/([^&=]+)=?([^&]*)/g,a=function(e){let t=e.replace(s," ");try{t=decodeURIComponent(t)}catch(e){}return t};for(n=r.exec(o);n;)t[a(n[1])]=a(n[2]),n=r.exec(o)}return t},Ve=(e,t,i)=>e+"&"+t+"="+encodeURIComponent(i),We=()=>window.location.hostname,Ke=(e,t)=>(t&&"function"==typeof t.debug&&t.debug("dobj:"+e),He(e)),Ge=(()=>{let e="",t=0;for(t=0;t<=25;t++)e+=String.fromCharCode(t+65);for(t=0;t<=25;t++)e+=String.fromCharCode(t+97);for(t=0;t<10;t++)e+=t;return e+"+/="})(),He=e=>{if(null==e)return"";var t,i,o,n,s,r,a,l="",c=0;for(e=(e=>{if(null==e)return"";let t,i,o,n={},s={},r="",a="",l="",c=2,d=3,h=2,u="",p=0,g=0,f=String.fromCharCode;for(o=0;o>=1}else{for(i=1,t=0;t>=1}c--,0==c&&(c=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;c--,0==c&&(c=Math.pow(2,h),h++),n[a]=d++,l=String(r)}if(""!==l){if(Object.prototype.hasOwnProperty.call(s,l)){if(l.charCodeAt(0)<256){for(t=0;t>=1}else{for(i=1,t=0;t>=1}c--,0==c&&(c=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;c--,0==c&&(c=Math.pow(2,h),h++)}for(i=2,t=0;t>=1;for(;;){if(p<<=1,15==g){u+=f(p);break}g++}return u})(e);c<2*e.length;)c%2==0?(t=e.charCodeAt(c/2)>>8,i=255&e.charCodeAt(c/2),o=c/2+1>8:NaN):(t=255&e.charCodeAt((c-1)/2),(c+1)/2>8,o=255&e.charCodeAt((c+1)/2)):i=o=NaN),c+=3,n=t>>2,s=(3&t)<<4|i>>4,r=(15&i)<<2|o>>6,a=63&o,isNaN(i)?r=a=64:isNaN(o)&&(a=64),l=l+Ge.charAt(n)+Ge.charAt(s)+Ge.charAt(r)+Ge.charAt(a);return l};var Je=t("fireRequest"),Ze=t("dropRequestDueToOptOut"),$e=t("addUseIPToRequest"),Ye=t("addARPToRequest");class Qe{constructor(){this.networkRetryCount=0,this.minDelayFrequency=0}static fireRequest(e,t,o,n){i(this,Je)[Je](e,1,t,o,n)}getDelayFrequency(){if(this.logger.debug("Network retry #"+this.networkRetryCount),this.networkRetryCount<10)return this.logger.debug(this.account.id,"Failure count is "+this.networkRetryCount+". Setting delay frequency to 1s"),this.minDelayFrequency=W,this.minDelayFrequency;if(null==this.account.region)return this.logger.debug(this.account.id,"Setting delay frequency to 1s"),W;{const e=1e3*(Math.floor(10*Math.random())+1);return this.minDelayFrequency+=e,this.minDelayFrequency<6e5?(this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency):(this.minDelayFrequency=W,this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency)}}}Qe.logger=void 0,Qe.device=void 0,Qe.account=void 0,Object.defineProperty(Qe,Je,{value:function(e,t,o,n,s){var r,a;if(i(this,Ze)[Ze]())return void this.logger.debug("req dropped due to optout cookie: "+this.device.gcookie);if(X(this.device.gcookie)||(le.blockRequest=!0),s&&s===K)!X(this.device.gcookie)&&le.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(this.networkRetryCount)),i(this,Je)[Je](e,void 0,o,n)}),this.getDelayFrequency());else if(!X(this.device.gcookie)&&le.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(t)),i(this,Je)[Je](e,t+1,o,n)}),50);if(n?window.isOULInProgress=!0:(X(this.device.gcookie)&&(e=Ve(e,"gc",this.device.gcookie)),e=i(this,Ye)[Ye](e,o)),e=Ve(e,"tries",t),e=i(this,$e)[$e](e),e=Ve(e,"r",(new Date).getTime()),(null===(r=window.clevertap)||void 0===r?void 0:r.hasOwnProperty("plugin"))||(null===(a=window.wizrocket)||void 0===a?void 0:a.hasOwnProperty("plugin"))){const t=window.clevertap.plugin||window.wizrocket.plugin;e=Ve(e,"ct_pl",t)}-1!==e.indexOf("chrome-extension:")&&(e=e.replace("chrome-extension:","https:"));for(var l=document.getElementsByClassName("ct-jp-cb");l[0]&&l[0].parentNode;)l[0].parentNode.removeChild(l[0]);const c=document.createElement("script");c.setAttribute("type","text/javascript"),c.setAttribute("src",e),c.setAttribute("class","ct-jp-cb"),c.setAttribute("rel","nofollow"),c.async=!0,document.getElementsByTagName("head")[0].appendChild(c),this.logger.debug("req snt -> url: "+e)}}),Object.defineProperty(Qe,Ze,{value:function(){return!le.isOptInRequest&&X(this.device.gcookie)&&H(this.device.gcookie)?":OO"===this.device.gcookie.slice(-3):(le.isOptInRequest=!1,!1)}}),Object.defineProperty(Qe,$e,{value:function(e){var t=ae.getMetaProp(_);return"boolean"!=typeof t&&(t=!1),Ve(e,_,t?"true":"false")}}),Object.defineProperty(Qe,Ye,{value:function(e,t){if(!0===t){const t={skipResARP:!0};return Ve(e,"arp",Ke(JSON.stringify(t),this.logger))}return ae._isLocalStorageSupported()&&void 0!==localStorage.getItem(P)&&null!==localStorage.getItem(P)?Ve(e,"arp",Ke(JSON.stringify(ae.readFromLSorCookie(P)),this.logger)):e}});const Xe=()=>{let e={};if(ae._isLocalStorageSupported()){let t=ae.read(y);null!=t?(t=JSON.parse(decodeURIComponent(t).replace(p,'"')),t.hasOwnProperty("global")?e.wp=t:e=t):e={}}return e},et=e=>{if(ae._isLocalStorageSupported()){const t={...Xe(),...e},i=JSON.stringify(t);ae.save(y,encodeURIComponent(i)),tt()}},tt=()=>{if(ae._isLocalStorageSupported()){let i=ae.read(b);if(X(i))try{i=JSON.parse(decodeURIComponent(ae.read(b)));const o=ae.read(w)?JSON.parse(decodeURIComponent(ae.read(w))):{};if(i&&ae._isLocalStorageSupported()){var e={},t=Xe();Object.keys(t).forEach((n=>{const s=i in o&&Object.keys(o[i]).length&&o[i][n]?o[i][n]:{},r=t[n].global,a=ie(),l=t[n][a];if(void 0!==r){const e=Object.keys(r);for(const t in e){let i=[];if(e.hasOwnProperty(t)){let o=0,n=0;const a=e[t];if("tc"===a)continue;void 0!==l&&void 0!==l[a]&&(o=l[a]),void 0!==r&&void 0!==r[a]&&(n=r[a]),i=[a,o,n],s[a]=i}}}e={...e,[n]:s}})),o[i]=e,ae.save(w,encodeURIComponent(JSON.stringify(o)))}}catch(e){console.error("Invalid clevertap Id "+e)}}},it=()=>{const e=JSON.parse(decodeURIComponent(ae.read(b)));let t={};if(ae._isLocalStorageSupported()){let i={};t=Xe();const o=ae.read(w),n=o?decodeURIComponent(o):null,s=n?JSON.parse(n):null,r=e&&null!=o&&s&&s[e]&&s[e].wp?Object.values(s[e].wp):[],a=e&&null!=o&&s&&s[e]&&s[e].wi?Object.values(s[e].wi):[],l=ie();let c=0,d=0;return t.wp&&t.wp[l]&&"undefined"!==t.wp[l].tc&&(c=t.wp[l].tc),t.wi&&t.wi[l]&&"undefined"!==t.wi[l].tc&&(d=t.wi[l].tc),i={wmp:c,wimp:d,tlc:r,witlc:a},i}},ot=(e,t)=>{let{logger:i}=t,o=!1;if(J(e))for(const t in e)if(e.hasOwnProperty(t)){o=!0;let n=e[t];if(null==n){delete e[t];continue}"Gender"!==t||n.match(/^M$|^F$/)||(o=!1,i.error(Pe)),"Employed"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Se)),"Married"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Ie)),"Education"!==t||n.match(/^School$|^College$|^Graduate$/)||(o=!1,i.error(Oe)),"Age"===t&&null!=n&&(Y(n)?e.Age=+n:(o=!1,i.error(_e))),"DOB"===t?(/^\$D_/.test(n)&&11===(n+"").length||Z(n)||(o=!1,i.error(Ee)),Z(n)&&(e[t]=ne(n))):Z(n)&&(e[t]=ne(n)),"Phone"!==t||$(n)||(n.length>8&&"+"===n.charAt(0)?(n=n.substring(1,n.length),Y(n)?e.Phone=+n:(o=!1,i.error(Le+". Removed."))):(o=!1,i.error(Le+". Removed."))),o||delete e[t]}return o},nt=e=>{const t={};t.Name=e.name,null!=e.id&&(t.FBID=e.id+""),"male"===e.gender?t.Gender="M":"female"===e.gender?t.Gender="F":t.Gender="O";null!=e.relationship_status&&(t.Married="N","Married"===e.relationship_status&&(t.Married="Y"));const i=function(e){if(null!=e){let t="",i="";for(let o=0;o0?"Y":"N",null!=e.email&&(t.Email=e.email),null!=e.birthday){const i=e.birthday.split("/");t.DOB=se(i[2]+i[0]+i[1])}return t},st=(e,t)=>{let{logger:i}=t;const o={};if(null!=e.displayName&&(o.Name=e.displayName),null!=e.id&&(o.GPID=e.id+""),null!=e.gender&&("male"===e.gender?o.Gender="M":"female"===e.gender?o.Gender="F":"other"===e.gender&&(o.Gender="O")),null!=e.image&&!1===e.image.isDefault&&(o.Photo=e.image.url.split("?sz")[0]),null!=e.emails)for(let t=0;t{if(ae._isLocalStorageSupported()){if(null==le.globalProfileMap&&(le.globalProfileMap=ae.readFromLSorCookie(x),null==le.globalProfileMap&&(le.globalProfileMap={})),null!=e._custom){const t=e._custom;for(const i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);delete e._custom}for(const i in e)if(e.hasOwnProperty(i)){if(le.globalProfileMap.hasOwnProperty(i)&&!t)continue;le.globalProfileMap[i]=e[i]}null!=le.globalProfileMap._custom&&delete le.globalProfileMap._custom,ae.saveToLSorCookie(x,le.globalProfileMap)}},at=(e,t,i)=>{if(null!=e&&"-1"!==e&&ae._isLocalStorageSupported()){const t=Xe();let o=t.wp[i];null==o&&(o={},t[i]=o),o[e]="dnd",et(t)}if(null!=le.campaignDivMap){const t=le.campaignDivMap[e];null!=t&&(document.getElementById(t).style.display="none","intentPreview"===t&&null!=document.getElementById("intentOpacityDiv")&&(document.getElementById("intentOpacityDiv").style.display="none"))}};var lt=t("logger"),ct=t("request"),dt=t("account"),ht=t("oldValues"),ut=t("isPersonalisationActive"),pt=t("processProfileArray");class gt extends Array{constructor(e,t){let{logger:o,request:n,account:s,isPersonalisationActive:r}=e;super(),Object.defineProperty(this,pt,{value:ft}),Object.defineProperty(this,lt,{writable:!0,value:void 0}),Object.defineProperty(this,ct,{writable:!0,value:void 0}),Object.defineProperty(this,dt,{writable:!0,value:void 0}),Object.defineProperty(this,ht,{writable:!0,value:void 0}),Object.defineProperty(this,ut,{writable:!0,value:void 0}),i(this,lt)[lt]=o,i(this,ct)[ct]=n,i(this,dt)[dt]=s,i(this,ht)[ht]=t,i(this,ut)[ut]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o0)for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];let n,s={};if(null!=o.Site){if(n=o.Site,$(n)||!ot(n,{logger:i(this,lt)[lt]}))return}else if(null!=o.Facebook){const e=o.Facebook;$(e)||e.error||(n=nt(e))}else if(null!=o["Google Plus"]){const e=o["Google Plus"];$(e)||e.error||(n=st(e,{logger:i(this,lt)[lt]}))}if(null!=n&&!$(n)){s.type="profile",null==n.tz&&(n.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),s.profile=n,rt(n,!0),s=i(this,ct)[ct].addSystemDataToObject(s,void 0),i(this,ct)[ct].addFlags(s);const e=Ke(JSON.stringify(s),i(this,lt)[lt]);let t=i(this,dt)[dt].dataPostURL;t=Ve(t,"type",A),t=Ve(t,"d",e),i(this,ct)[ct].saveAndFireRequest(t,le.blockRequest)}}},vt=t("request"),bt=t("logger"),mt=t("account"),yt=t("session"),wt=t("oldValues"),Ct=t("device"),kt=t("processOUL"),xt=t("handleCookieFromCache"),Pt=t("deleteUser"),St=t("processLoginArray");class It extends Array{constructor(e,t){let{request:o,account:n,session:s,logger:r,device:a}=e;super(),Object.defineProperty(this,St,{value:At}),Object.defineProperty(this,Pt,{value:Et}),Object.defineProperty(this,xt,{value:_t}),Object.defineProperty(this,kt,{value:Ot}),Object.defineProperty(this,vt,{writable:!0,value:void 0}),Object.defineProperty(this,bt,{writable:!0,value:void 0}),Object.defineProperty(this,mt,{writable:!0,value:void 0}),Object.defineProperty(this,yt,{writable:!0,value:void 0}),Object.defineProperty(this,wt,{writable:!0,value:void 0}),Object.defineProperty(this,Ct,{writable:!0,value:void 0}),i(this,vt)[vt]=o,i(this,mt)[mt]=n,i(this,yt)[yt]=s,i(this,bt)[bt]=r,i(this,wt)[wt]=t,i(this,Ct)[Ct]=a}clear(){i(this,bt)[bt].debug("clear called. Reset flag has been set."),i(this,Pt)[Pt](),ae.setMetaProp(g,!0)}push(){for(var e=arguments.length,t=new Array(e),o=0;o{let o=ae.readFromLSorCookie(m);const n=ae.readFromLSorCookie(b);let s;if(null==o)o={},s=e;else{s=o.id;let r=!1,a=!1;if(null==s&&(s=e[0],r=!0),null==le.LRU_CACHE&&ae._isLocalStorageSupported()&&(le.LRU_CACHE=new he(100)),r)null!=n&&(le.LRU_CACHE.set(s,n),le.blockRequest=!1);else for(const t in e)if(e.hasOwnProperty(t)){const i=e[t];if(le.LRU_CACHE.cache[i]){s=i,a=!0;break}}if(a){s!==le.LRU_CACHE.getLastKey()?i(this,xt)[xt]():(t=!1,ae.saveToLSorCookie(D,t));const e=le.LRU_CACHE.get(s);le.LRU_CACHE.set(s,e),ae.saveToLSorCookie(b,e),i(this,Ct)[Ct].gcookie=e;const o=le.LRU_CACHE.getSecondLastKey();if(ae.readFromLSorCookie(D)&&-1!==o){const e=le.LRU_CACHE.cache[o];i(this,vt)[vt].unregisterTokenForGuid(e)}}else r?null!=n&&(i(this,Ct)[Ct].gcookie=n,ae.saveToLSorCookie(b,n),t=!1):this.clear(),ae.saveToLSorCookie(D,!1),s=e[0]}o.id=s,ae.saveToLSorCookie(m,o)};if(Array.isArray(e)&&e.length>0)for(const n in e)if(e.hasOwnProperty(n)){const s=e[n];let r,a={};if(null!=s.Site){if(r=s.Site,$(r)||!ot(r,{logger:i(this,bt)[bt]}))return}else if(null!=s.Facebook){const e=s.Facebook;$(e)||e.error||(r=nt(e))}else if(null!=s["Google Plus"]){const e=s["Google Plus"];$(e)&&!e.error&&(r=st(e,{logger:i(this,bt)[bt]}))}if(null!=r&&!$(r)){a.type="profile",null==r.tz&&(r.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),a.profile=r;const e=[];ae._isLocalStorageSupported()&&(r.Identity&&e.push(r.Identity),r.Email&&e.push(r.Email),r.GPID&&e.push("GP:"+r.GPID),r.FBID&&e.push("FB:"+r.FBID),e.length>0&&o(e)),rt(r,!0),a=i(this,vt)[vt].addSystemDataToObject(a,void 0),i(this,vt)[vt].addFlags(a),t&&(a.isOUL=!0);const n=Ke(JSON.stringify(a),i(this,bt)[bt]);let s=i(this,mt)[mt].dataPostURL;s=Ve(s,"type",A),s=Ve(s,"d",n),i(this,vt)[vt].saveAndFireRequest(s,le.blockRequest,t)}}},_t=function(){le.blockRequest=!1,console.debug("Block request is false"),ae._isLocalStorageSupported()&&(delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),ae.removeCookie(y,We()),ae.removeCookie(i(this,yt)[yt].cookieName,le.broadDomain),ae.removeCookie(P,le.broadDomain),i(this,yt)[yt].setSessionCookieObject("")},Et=function(){le.blockRequest=!0,i(this,bt)[bt].debug("Block request is true"),le.globalCache={gcookie:null,REQ_N:0,RESP_N:0},ae._isLocalStorageSupported()&&(delete localStorage.WZRK_G,delete localStorage.WZRK_K,delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),ae.removeCookie(b,le.broadDomain),ae.removeCookie(y,We()),ae.removeCookie(m,We()),ae.removeCookie(i(this,yt)[yt].cookieName,le.broadDomain),ae.removeCookie(P,le.broadDomain),i(this,Ct)[Ct].gcookie=null,i(this,yt)[yt].setSessionCookieObject("")},At=function(e){if(Array.isArray(e)&&e.length>0){const t=e.pop();if(null!=t&&J(t)&&(null!=t.Site&&Object.keys(t.Site).length>0||null!=t.Facebook&&Object.keys(t.Facebook).length>0||null!=t["Google Plus"]&&Object.keys(t["Google Plus"]).length>0)){ae.setInstantDeleteFlagInK();try{i(this,kt)[kt]([t])}catch(e){i(this,bt)[bt].debug(e)}}else i(this,bt)[bt].error("Profile object is in incorrect format")}};class Lt extends HTMLElement{constructor(){super(),this._details=null,this.shadow=null,this.shadow=this.attachShadow({mode:"open"})}get details(){return this._details||""}set details(e){null===this._details&&(this._details=e,this.renderBanner())}renderBanner(){this.shadow.innerHTML=this.getBannerContent(),!1!==this.trackClick&&this.addEventListener("click",(()=>{const e=this.details.onClick;e&&(this.details.window?window.open(e,"_blank"):window.parent.location.href=e),window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId})}getBannerContent(){return'\n \n \n ")}}class Mt extends HTMLElement{constructor(){super(),this._target=null,this._carousel=null,this.shadow=null,this.slides=0,this.previouslySelectedItem=-1,this.selectedItem=1,this.autoSlide=null,this.stopAutoSlideTimeout=null,this.shadow=this.attachShadow({mode:"open"}),void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Lt)}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderCarousel())}get details(){return this.target.display.details}get display(){return this.target.display}renderCarousel(){this.slides=this.details.length,this.shadow.innerHTML=this.getStyles();const e=this.getCarouselContent();this.display.showNavBtns&&e.insertAdjacentHTML("beforeend",this.display.navBtnsHtml),this.display.showNavArrows&&(e.insertAdjacentHTML("beforeend",this.display.leftNavArrowHtml),e.insertAdjacentHTML("beforeend",this.display.rightNavArrowHtml)),this._carousel=e,this.shadow.appendChild(e),this.setupClick(),this.updateSelectedItem(),this.startAutoSlide(),this.setupOnHover(),window.clevertap.renderNotificationViewed({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot})}setupClick(){this._carousel.addEventListener("click",(e=>{const t=e.target.id;if(t.startsWith("carousel__button")){const e=+t.split("-")[1];e!==this.selectedItem&&(this.previouslySelectedItem=this.selectedItem,this.selectedItem=e,this.updateSelectedItem(),this.startAutoSlide())}else if(t.startsWith("carousel__arrow"))t.endsWith("right")?this.goToNext():this.goToPrev(),this.startAutoSlide();else if(t.indexOf("-")>-1){const e=+t.split("-")[1],i=e-1;window.parent.clevertap&&window.clevertap.renderNotificationClicked({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot,wzrk_slideNo:e});const o=this.details[i].onClick;""!==o&&(this.details[i].window?window.open(o,"_blank"):window.location.href=o)}}))}setupOnHover(){this._carousel.addEventListener("mouseenter",(e=>{this.stopAutoSlideTimeout=setTimeout((()=>{this.autoSlide=clearInterval(this.autoSlide)}),500)})),this._carousel.addEventListener("mouseleave",(e=>{clearTimeout(this.stopAutoSlideTimeout),void 0===this.autoSlide&&this.startAutoSlide()}))}getCarouselContent(){const e=document.createElement("div");return e.setAttribute("class","carousel"),this.details.forEach(((t,i)=>{const o=document.createElement("ct-web-personalisation-banner");o.classList.add("carousel__item"),o.trackClick=!1,o.setAttribute("id","carousel__item-".concat(i+1)),o.details=t,e.appendChild(o)})),e}getStyles(){var e,t;return"\n \n ")}updateSelectedItem(){if(-1!==this.previouslySelectedItem){const e=this.shadow.getElementById("carousel__item-".concat(this.previouslySelectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.previouslySelectedItem));e.classList.remove("carousel__item--selected"),t&&t.classList.remove("carousel__button--selected")}const e=this.shadow.getElementById("carousel__item-".concat(this.selectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.selectedItem));e.classList.add("carousel__item--selected"),t&&t.classList.add("carousel__button--selected")}startAutoSlide(){clearInterval(this.autoSlide),this.autoSlide=setInterval((()=>{this.goToNext()}),this.display.sliderTime?1e3*this.display.sliderTime:3e3)}goToNext(){this.goTo(this.selectedItem,(this.selectedItem+1)%this.slides)}goToPrev(){this.goTo(this.selectedItem,this.selectedItem-1)}goTo(e,t){this.previouslySelectedItem=e,this.selectedItem=t,0===t&&(this.selectedItem=this.slides),this.updateSelectedItem()}}class Tt extends HTMLElement{constructor(){super(),this._target=null,this._session=null,this.shadow=null,this.popup=null,this.container=null,this.resizeObserver=null,this.shadow=this.attachShadow({mode:"open"})}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderImageOnlyPopup())}get session(){return this._session||""}set session(e){this._session=e}get msgId(){return this.target.wzrk_id}get pivotId(){return this.target.wzrk_pivot}get onClickUrl(){return this.target.display.onClickUrl}renderImageOnlyPopup(){const e=this.target.wzrk_id.split("_")[0],t=this.session.sessionId;this.shadow.innerHTML=this.getImageOnlyPopupContent(),this.popup=this.shadowRoot.getElementById("imageOnlyPopup"),this.container=this.shadowRoot.getElementById("container"),this.closeIcon=this.shadowRoot.getElementById("close"),this.popup.addEventListener("load",this.updateImageAndContainerWidth()),this.resizeObserver=new ResizeObserver((()=>this.handleResize(this.popup,this.container))),this.resizeObserver.observe(this.popup),this.closeIcon.addEventListener("click",(()=>{if(this.resizeObserver.unobserve(this.popup),document.getElementById("wzrkImageOnlyDiv").style.display="none",this.remove(),null!=e&&"-1"!==e&&ae._isLocalStorageSupported()){const i=Xe();let o=i.wp[t];null==o&&(o={},i[t]=o),o[e]="dnd",et(i)}})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId}),this.onClickUrl&&this.popup.addEventListener("click",(()=>{this.target.display.window?window.open(this.onClickUrl,"_blank"):window.parent.location.href=this.onClickUrl,window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})}))}handleResize(e,t){const i=this.getRenderedImageWidth(e);t.style.setProperty("width","".concat(i,"px"))}getImageOnlyPopupContent(){return"\n ".concat(this.target.msgContent.css,"\n ").concat(this.target.msgContent.html,"\n ")}updateImageAndContainerWidth(){return()=>{const e=this.getRenderedImageWidth(this.popup);this.popup.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("height","auto"),this.container.style.setProperty("position","fixed"),this.popup.style.setProperty("visibility","visible"),this.closeIcon.style.setProperty("visibility","visible"),document.getElementById("wzrkImageOnlyDiv").style.visibility="visible"}}getRenderedImageWidth(e){const t=e.naturalWidth/e.naturalHeight;return e.height*t}}class Rt extends HTMLElement{constructor(e,t){super(),this.wrapper=null,this.snackBar=null,this.shadow=this.attachShadow({mode:"open"}),this.config=e,this.message=t,this.renderMessage(t)}get pivotId(){return this.message.wzrk_pivot}get campaignId(){return this.message.wzrk_id}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}renderMessage(e){switch(this.wrapper=this.createEl("div","messageWrapper"),e.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":{const t=this.prepareBasicMessage(e.msg[0]);this.wrapper.appendChild(t)}}const t=this.createEl("div","timeStamp");if(t.innerHTML="".concat(Wt(e.id.split("_")[1]),""),!e.viewed){const e=this.createEl("span","unreadMarker");t.appendChild(e)}this.wrapper.appendChild(t),this.shadow.appendChild(this.wrapper)}prepareBasicMessage(e){const t=this.createEl("div","message");if(e.imageUrl){const i=this.addImage(e.imageUrl,"mainImg");t.appendChild(i)}const i=this.createEl("div","iconTitleDescWrapper");if(e.iconUrl){const t=this.addImage(e.iconUrl,"iconImg");i.appendChild(t)}const o=this.createEl("div","titleDescWrapper");if(e.title){const t=this.createEl("div","title");t.innerText=e.title,o.appendChild(t)}if(e.description){const t=this.createEl("div","description");t.innerText=e.description,o.appendChild(t)}if((e.title||e.description)&&i.appendChild(o),(e.iconUrl||e.title||e.description)&&t.appendChild(i),e.buttons&&e.buttons.length){const i=this.addButtons(e.buttons);t.appendChild(i)}return t}addButtons(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.createEl("div","buttonsContainer");let i=!1;return e.forEach(((e,o)=>{const n=this.createEl("button","button-".concat(o),"button");n.innerText=e.text,o>0&&(n.style.cssText+="margin-left: 2px;"),"copy"===e.action&&(i=!0),t.appendChild(n)})),i&&this.addSnackbar(t),t}addSnackbar(e){this.snackBar=this.createEl("div","snackbar-".concat(this.campaignId),"snackbar"),this.snackBar.innerHTML=Ht;const t=this.createEl("span","snackbar-msg-".concat(this.campaignId),"snackbar-msg");t.innerText="Copied to clipboard",this.snackBar.appendChild(t),e.appendChild(this.snackBar)}addImage(e,t){const i=this.createEl("div","".concat(t,"Container")),o=this.createEl("img",t);return o.setAttribute("src",e),o.setAttribute("loading","lazy"),i.appendChild(o),i}raiseClickedEvent(e,t){switch(this.message.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":this.raiseClickedForBasicTemplates(e,t)}}raiseClickedForBasicTemplates(e,t){const i=this.message.msg[0],o={msgId:this.campaignId,pivotId:this.pivotId};if("BUTTON"===e.tagName){const t=e.id.split("-")[1],n=i.buttons[t];o.kv={wzrk_c2a:n.text},"url"===n.action?n.openUrlInNewTab?window.open(n.url,"_blank"):window.location=n.url:"copy"===n.action&&(window.focus(),navigator.clipboard.writeText(n.clipboardText),this.snackBar.style.setProperty("display","flex","important"),setTimeout((()=>{this.snackBar.style.setProperty("display","none","important")}),2e3))}else"CT-INBOX-MESSAGE"===e.tagName&&i.onClickUrl&&(i.openUrlInNewTab?window.open(i.onClickUrl,"_blank"):window.location=i.onClickUrl);t?console.log("Notifiction clicked event will be raised at run time with payload ::",o):window.clevertap.renderNotificationClicked(o)}}class jt extends HTMLElement{constructor(e){super(),this.isInboxOpen=!1,this.isInboxFromFlutter=!1,this.selectedCategory=null,this.unviewedMessages={},this.unviewedCounter=0,this.isPreview=!1,this.inboxConfigForPreview={},this.inboxSelector=null,this.inbox=null,this.emptyInboxMsg=null,this.inboxCard=null,this.unviewedBadge=null,this.observer=null,this.selectedCategoryRef=null,this.addClickListenerOnDocument=(()=>e=>{if(e.composedPath().includes(this.inbox)){const t=e.path||e.composedPath&&e.composedPath();if(t.length){const e=t[0].id;if("closeInbox"===e)this.toggleInbox();else if(e.startsWith("category-"))this.prevCategoryRef=this.selectedCategoryRef,this.selectedCategoryRef=t[0],this.updateActiveCategory(t[0].innerText);else{const e=t.filter((e=>{var t;return(null===(t=e.id)||void 0===t?void 0:t.startsWith("button-"))||"CT-INBOX-MESSAGE"===e.tagName}));if(e.length){e[e.length-1].raiseClickedEvent(e[0],this.isPreview)}}}}else(this.inboxSelector.contains(e.target)||this.isInboxOpen)&&(this.isInboxFromFlutter?this.isInboxFromFlutter=!1:this.toggleInbox(e))})(),this.setBadgeStyle=e=>{null!==this.unviewedBadge&&(this.unviewedBadge.innerText=e>9?"9+":e,this.unviewedBadge.style.display=e>0?"flex":"none")},this.logger=e,this.shadow=this.attachShadow({mode:"open"})}get incomingMessages(){return[]}set incomingMessages(e){void 0===e&&(e=[]),e.length>0&&this.inbox&&this.updateInboxMessages(e)}get incomingMessagesForPreview(){return[]}set incomingMessagesForPreview(e){void 0===e&&(e=[]);const t={};e.length>0&&this.inbox&&(this.isPreview=!0,this.unviewedCounter=0,e.forEach((e=>{const i="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=i,t[i]=e,this.unviewedMessages[i]=e,this.unviewedCounter++})),this.buildUIForMessages(t),this.updateUnviewedBadgeCounter())}connectedCallback(){this.init()}init(){this.config=this.isPreview?this.inboxConfigForPreview:ae.readFromLSorCookie(q)||{},0!==Object.keys(this.config).length&&(this.inboxSelector=document.getElementById(this.config.inboxSelector),null!==this.inboxSelector&&(this.config.styles.notificationsBadge?this.addUnviewedBadge():this.unviewedBadge&&this.unviewedBadge.remove(),this.createinbox(),document.removeEventListener("click",this.addClickListenerOnDocument),document.addEventListener("click",this.addClickListenerOnDocument),this.config.categories.length&&this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadow.innerHTML=this.getInboxStyles(),this.shadow.appendChild(this.inbox)))}addMsgsToInboxFromLS(){const e=this.deleteExpiredAndGetUnexpiredMsgs(!1),t=e?Object.keys(e):[];0!==t.length&&(t.forEach((t=>{e[t].viewed||(this.unviewedMessages[t]=e[t],this.unviewedCounter++)})),this.buildUIForMessages(e),this.updateUnviewedBadgeCounter())}deleteExpiredAndGetUnexpiredMsgs(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Nt();const i=Math.floor(Date.now()/1e3);for(const o in t)if(t[o].wzrk_ttl&&t[o].wzrk_ttl>0&&t[o].wzrk_ttl0&&(t=Object.values(t).sort(((e,t)=>t.date-e.date)).reduce(((e,t)=>(e[t.id]=t,e)),{})),Ft(t),t}updateInboxMessages(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.deleteExpiredAndGetUnexpiredMsgs(),i=Date.now(),o={};e.forEach(((e,n)=>{const s="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=s,e.date=i-n,e.viewed=0,t[s]=e,o[s]=e,this.unviewedMessages[s]=e,this.unviewedCounter++})),Ft(t),this.buildUIForMessages(o),this.updateUnviewedBadgeCounter()}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}addUnviewedBadge(){this.unviewedBadge||(this.unviewedBadge=this.createEl("div","unviewedBadge"),this.unviewedBadge.style.cssText="display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ".concat(this.config.styles.notificationsBadge.backgroundColor,"; font-size: 12px; color: ").concat(this.config.styles.notificationsBadge.textColor,"; font-weight: bold; align-items: center; justify-content: center;"),document.body.appendChild(this.unviewedBadge)),this.updateUnviewedBadgePosition(),window.addEventListener("resize",(()=>{this.updateUnviewedBadgePosition()}))}updateUnviewedBadgePosition(){const{top:e,right:t}=this.inboxSelector.getBoundingClientRect();this.unviewedBadge.style.top="".concat(e-8,"px"),this.unviewedBadge.style.left="".concat(t-8,"px")}createinbox(){this.inbox=this.createEl("div","inbox");const e=this.createEl("div","header"),t=this.createEl("div","headerTitle");t.innerText=this.config.title;const i=this.createEl("div","closeInbox");if(i.innerHTML="×",e.appendChild(t),e.appendChild(i),this.inbox.appendChild(e),this.config.categories.length){const e=this.createCategories();this.inbox.appendChild(e)}this.inboxCard=this.createEl("div","inboxCard"),this.inbox.appendChild(this.inboxCard),this.emptyInboxMsg=this.createEl("div","emptyInboxMsg"),this.emptyInboxMsg.innerText="All messages will be displayed here.",this.inboxCard.appendChild(this.emptyInboxMsg);const o={root:this.inboxCard,rootMargin:"0px",threshold:.5};this.observer=new IntersectionObserver(((e,t)=>{this.handleMessageViewed(e)}),o),this.addMsgsToInboxFromLS()}createCategories(){const e=this.createEl("div","categoriesContainer"),t=this.createEl("div","leftArrow");t.innerHTML=Gt,t.children[0].style="transform: rotate(180deg)",t.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(-70,0)})),e.appendChild(t);const i=this.createEl("div","categoriesWrapper");["All",...this.config.categories].forEach(((e,t)=>{const o=this.createEl("div","category-".concat(t),"category");o.innerText=e,0===t&&(this.selectedCategoryRef=o),i.appendChild(o)})),e.appendChild(i);const o=this.createEl("div","rightArrow");o.innerHTML=Gt,o.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(70,0)})),e.appendChild(o);const n={root:e,threshold:.9},s=i.children[0],r=i.children[this.config.categories.length];new IntersectionObserver((e=>{this.categoryObserverCb(t,e[0].intersectionRatio>=.9)}),n).observe(s);return new IntersectionObserver((e=>{this.categoryObserverCb(o,e[0].intersectionRatio>=.9)}),n).observe(r),e}categoryObserverCb(e,t){e&&(e.style.display=t?"none":"flex")}updateActiveCategory(e){this.selectedCategory=e,this.inboxCard.scrollTop=0;let t=0;this.prevCategoryRef&&this.prevCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef.setAttribute("selected","true"),this.inboxCard.childNodes.forEach((e=>{"emptyInboxMsg"!==e.getAttribute("id")&&(e.style.display="All"===this.selectedCategory||e.getAttribute("category")===this.selectedCategory?"block":"none","block"===e.style.display&&t++)})),0===t?(this.emptyInboxMsg.innerText="".concat(e," messages will be displayed here."),this.emptyInboxMsg.style.display="block"):this.emptyInboxMsg.style.display="none"}buildUIForMessages(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!this.isPreview&&this.updateTSForRenderedMsgs(),this.inboxCard.scrollTop=0;const i=null!==(e=this.config.maxMsgsInInbox)&&void 0!==e?e:15,o=this.inboxCard.firstChild,n=Object.values(t).sort(((e,t)=>t.date-e.date)).map((e=>e.id));for(const e of n){const i=new Rt(this.config,t[e]);i.setAttribute("id",t[e].id),i.setAttribute("pivot",t[e].wzrk_pivot),i.setAttribute("part","ct-inbox-message"),this.config.categories.length>0?(i.setAttribute("category",t[e].tags[0]||""),i.style.display="All"===this.selectedCategory||t[e].category===this.selectedCategory?"block":"none"):i.style.display="block",this.inboxCard.insertBefore(i,o),this.observer.observe(i)}let s=this.inboxCard.querySelectorAll("ct-inbox-message").length;for(;s>i;){const e=this.inboxCard.querySelectorAll("ct-inbox-message");e.length>0&&e[e.length-1].remove(),s--}const r=this.inboxCard.querySelectorAll('ct-inbox-message[style*="display: block"]').length;this.emptyInboxMsg.style.display=r?"none":"block"}handleMessageViewed(e){const t=!this.isPreview;this.isInboxOpen&&e.forEach((e=>{e.isIntersecting&&this.unviewedMessages.hasOwnProperty(e.target.id)&&0===e.target.message.viewed&&(e.target.message.viewed=1,t?(window.clevertap.renderNotificationViewed({msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.updateMessageInLS(e.target.id,{...e.target.message,viewed:1}),setTimeout((()=>{e.target.shadowRoot.getElementById("unreadMarker").style.display="none"}),1e3)):console.log("Notifiction viewed event will be raised at run time with payload ::",{msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.unviewedCounter--,this.updateUnviewedBadgeCounter(),delete this.unviewedMessages[e.target.id])}))}updateMessageInLS(e,t){if(!this.isPreview){const i=Nt();i[e]=t,Ft(i)}}toggleInbox(e){this.isInboxOpen=!this.isInboxOpen,this.isInboxFromFlutter=!!(null==e?void 0:e.rect),this.isInboxOpen?(this.inboxCard.scrollTop=0,!this.isPreview&&this.deleteExpiredAndGetUnexpiredMsgs(),this.inbox.style.display="block",this.inbox.style.zIndex="2147483647",this.config.categories.length&&(this.selectedCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef=this.shadowRoot.getElementById("category-0"),this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadowRoot.getElementById("categoriesWrapper").scrollLeft-=this.shadowRoot.getElementById("categoriesWrapper").scrollWidth),this.setInboxPosition(e)):this.inbox.style.display="none"}setInboxPosition(e){const t=window.outerWidth,i=getComputedStyle(le.inbox),o=i.getPropertyValue("--inbox-top"),n=i.getPropertyValue("--inbox-bottom"),s=i.getPropertyValue("--inbox-left"),r=i.getPropertyValue("--inbox-right");if(t>481&&!(o||n||s||r)){const t=Vt(e,this.inbox.clientHeight,this.inbox.clientWidth),i=t.xPos,o=t.yPos;this.inbox.style.top=o+"px",this.inbox.style.left=i+"px"}}updateUnviewedBadgeCounter(){if(this.isPreview)return void this.setBadgeStyle(this.unviewedCounter);let e=0;this.inboxCard.querySelectorAll("ct-inbox-message").forEach((t=>{const i=Nt();i[t.id]&&0===i[t.id].viewed&&e++})),this.setBadgeStyle(e)}updateTSForRenderedMsgs(){this.inboxCard.querySelectorAll("ct-inbox-message").forEach((e=>{const t=e.id.split("_")[1];e.shadow.getElementById("timeStamp").firstChild.innerText=Wt(t)}))}getInboxStyles(){const e=this.config.categories.length?64:16,t={panelBackgroundColor:this.config.styles.panelBackgroundColor,panelBorderColor:this.config.styles.panelBorderColor,headerBackgroundColor:this.config.styles.header.backgroundColor,headerTitleColor:this.config.styles.header.titleColor,closeIconColor:this.config.styles.closeIconColor,categoriesTabColor:this.config.styles.categories.tabColor,categoriesTitleColor:this.config.styles.categories.titleColor,selectedCategoryTabColor:this.config.styles.categories.selectedTab.tabColor,selectedCategoryTitleColor:this.config.styles.categories.selectedTab.titleColor,headerCategoryHeight:36+e};this.config.styles.categories.borderColor&&(t.categoriesBorderColor=this.config.styles.categories.borderColor),this.config.styles.categories.selectedTab.borderColor&&(t.selectedCategoryBorderColor=this.config.styles.categories.selectedTab.borderColor);const i=(e=>{let{panelBackgroundColor:t,panelBorderColor:i,headerBackgroundColor:o,headerTitleColor:n,closeIconColor:s,categoriesTabColor:r,categoriesTitleColor:a,categoriesBorderColor:l,selectedCategoryTabColor:c,selectedCategoryTitleColor:d,selectedCategoryBorderColor:h,headerCategoryHeight:u}=e;return'\n \n ")})(t),o=this.config.styles.cards;return i+(e=>{let{backgroundColor:t,borderColor:i,titleColor:o,descriptionColor:n,buttonColor:s,buttonTextColor:r,unreadMarkerColor:a}=e;return'\n \n ")})({backgroundColor:o.backgroundColor,borderColor:o.borderColor,titleColor:o.titleColor,descriptionColor:o.descriptionColor,buttonColor:o.buttonColor,buttonTextColor:o.buttonTextColor,unreadMarkerColor:o.unreadMarkerColor})}}const Dt=e=>{e.inbox_preview?le.inbox.incomingMessagesForPreview=e.inbox_notifs:le.inbox.incomingMessages=e},zt=e=>{qt(),le.inbox=new jt({logger:e}),document.body.appendChild(le.inbox)},Bt=e=>{const t=ae.readFromLSorCookie(V)||{};if(Object.keys(t).length>0&&Object.keys(t)[0].includes("_")){const i={};return i[e]=t,ae.saveToLSorCookie(V,i),i}return t},Nt=()=>{const e=JSON.parse(decodeURIComponent(ae.read(b)));if(!X(e))return{};const t=Bt(e);return t.hasOwnProperty(e)?t[e]:{}},Ft=e=>{const t=JSON.parse(decodeURIComponent(ae.read(b)));if(!X(t))return;const i={...Bt(t),[t]:e};ae.saveToLSorCookie(V,i)},Ut=e=>new Promise(((t,i)=>{if("complete"===document.readyState)zt(e),t();else{const i=ae.readFromLSorCookie(q)||{},o=()=>{null===le.inbox&&zt(e),t()};window.addEventListener("load",(()=>{if(document.getElementById(i.inboxSelector))o();else{let n=0;if(n<20){const s=setInterval((()=>{document.getElementById(i.inboxSelector)?(o(),clearInterval(s),t()):n>=20&&(clearInterval(s),e.debug("Failed to add inbox")),n++}),500)}}}))}})),qt=()=>{void 0===customElements.get("ct-web-inbox")&&(customElements.define("ct-web-inbox",jt),customElements.define("ct-inbox-message",Rt))},Vt=(e,t,i)=>{const o=document.scrollingElement.scrollLeft,n=document.scrollingElement.scrollTop,s=window.innerWidth+o,r=window.innerHeight+n,a=e.rect||e.target.getBoundingClientRect(),l=a.x+o,c=a.y+n,d=a.left+o,h=a.right+o,u=a.top+n,p=a.bottom,g=a.height,f=a.width;let v,b,m=!1;const y=16;if(p+t<=r){const e=r-(p+t);b=e>=y?p+y:p+e}else if(u-t>=n){const e=u-t;b=e>=y?u-t-y:u-t-e}else m=!0,b=c+g/2-t/2,br&&(b=r-t);if(m){const e=h+i;if(e<=s){v=h+(e+y<=s?y:s-e)}else{const e=d-i;v=e-(e-y>=o?y:e-o)}}else v=l+f/2-i/2,vs&&(v=h-i>=o?h-i:s-i);return{xPos:v,yPos:b}},Wt=e=>{const t=Date.now();let i=Math.floor((t-e)/6e4);return i<5?"Just now":i<60?"".concat(i," minute").concat(i>1?"s":""," ago"):(i=Math.floor(i/60),i<24?"".concat(i," hour").concat(i>1?"s":""," ago"):(i=Math.floor(i/24),"".concat(i," day").concat(i>1?"s":""," ago")))},Kt=()=>Object.keys(ae.readFromLSorCookie(q)||{}).length>0,Gt='\n\n\n',Ht='\n\n\n',Jt=(e,t)=>{document.addEventListener("DOMContentLoaded",(()=>function(e,t){document.body.innerHTML="",Zt=document.createElement("div"),Zt.id="overlayDiv",Zt.style.position="relative",Zt.style.display="flex",document.body.appendChild(Zt);(function(e,t,i){return new Promise(((o,n)=>{var s=document.createElement("script");s.type="module",s.src=e,s.onload=function(){"function"==typeof window.Overlay?(window.Overlay("#overlayDiv",t,i),o()):n(new Error("ContentLayout not found in overlay.js"))},s.onerror=function(e){n(e)},document.head.appendChild(s)}))})("https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js",e,t).then((()=>{console.log("Overlay script loaded successfully.")})).catch((e=>{console.error("Error loading overlay script:",e)})),d=document.createElement("link"),d.rel="stylesheet",d.type="text/css",d.href="https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css",document.head.appendChild(d),o={kitId:"eqj6nom",scriptTimeout:3e3,async:!0},n=document,s=n.documentElement,r=setTimeout((function(){s.className=s.className.replace(/\bwf-loading\b/g,"")+" wf-inactive"}),o.scriptTimeout),a=n.createElement("script"),l=!1,c=n.getElementsByTagName("script")[0],s.className+=" wf-loading",a.src="https://use.typekit.net/"+o.kitId+".js",a.async=!0,a.onload=a.onreadystatechange=function(){if(i=this.readyState,!(l||i&&"complete"!==i&&"loaded"!==i)){l=!0,clearTimeout(r);try{Typekit.load(o)}catch(e){}}},c.parentNode.insertBefore(a,c);var i,o,n,s,r,a,l,c;var d}(e,t)))};let Zt;const $t=(e,t)=>{const i=e.display.details[0],o=Object.keys(i)[0],n=i[o];if(o===window.location.href)for(const i in n){const o=document.querySelector(i);if(o)n[i].html&&(o.outerHTML=n[i].html),t||window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot});else{let o=0;const s=setInterval((()=>{const r=document.querySelector(i);r?(n[i].html&&(r.outerHTML=n[i].html),t||window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot}),clearInterval(s)):(o++,o>=20&&(console.log("No element present on DOM with selector '".concat(i,"'.")),clearInterval(s)))}),500)}}},Yt=(e,t)=>{let{device:i,session:o,request:n,logger:s}=t;const r=i,a=o,l=n,c=s;let d=0;const h=t=>{const i=t.wzrk_id.split("_")[0],o=ie(),n=(e,t,i)=>{let o=0,n=0;null!=e[t]&&(o=e[t]),o++,null!=e.tc&&(n=e.tc),i<0&&n++,e.tc=n,e[t]=o};if(ae._isLocalStorageSupported()){delete sessionStorage.WZRK_CAMP;var s={};const e=Xe();s=3===t.display.wtarget_type&&e.hasOwnProperty("wi")?e.wi:0!==t.display.wtarget_type&&1!==t.display.wtarget_type||!e.hasOwnProperty("wp")?{}:e.wp,e.hasOwnProperty("global")&&(s.wp=e),null==t.display.wmc&&(t.display.wmc=1),null==t.display.wimc&&(t.display.wimc=1);var d=-1;let n=-1,r=-1,l=-1,c=-1,g=-1,f=-1;null!=t.display.efc&&(d=parseInt(t.display.efc,10)),null!=t.display.mdc&&(n=parseInt(t.display.mdc,10)),null!=t.display.tdc&&(r=parseInt(t.display.tdc,10)),null!=t.display.tlc&&(l=parseInt(t.display.tlc,10)),null!=t.display.wmp&&(c=parseInt(t.display.wmp,10)),null!=t.display.wmc&&(g=parseInt(t.display.wmc,10)),null!=t.display.wimc&&(f=parseInt(t.display.wimc,10));var h=s[a.sessionId];if(h){const e=h[i],o=h.tc;if("dnd"===e&&!le.dismissSpamControl)return!1;if(3===t.display.wtarget_type){if(f>0&&o>=f&&d<0)return!1}else if(g>0&&o>=g&&d<0)return!1;if(n>0&&e>=n)return!1}else h={},s[a.sessionId]=h;var u=s[o];if(null!=u){const e=u[i],t=u.tc;if(c>0&&t>=c&&d<0)return!1;if(r>0&&e>=r)return!1}else u={},s[o]=u;var p=s.global;if(null!=p){const e=p[i];if(l>0&&e>=l)return!1}else p={},s.global=p}if(null!=t.display.delay&&t.display.delay>0){const i=t.display.delay;return t.display.delay=0,setTimeout(Yt,1e3*i,e,{device:r,session:a,request:l,logger:c}),!1}n(h,i,d),n(u,i,d),n(p,i,d);let g="wp";3===t.display.wtarget_type&&(g="wi");const f={};f[a.sessionId]=h,f[o]=u,f.global=p,et({[g]:f})},u=()=>{const e=r.getGuid(),t=a.getSessionCookieObject();return"&t=wc&d="+encodeURIComponent(He(e+"|"+t.p+"|"+t.s))},p=(e,t)=>{const i=window.parent[e];"function"==typeof i&&(null!=t.display.kv?i(t.display.kv):i())},g=(e,t,i,o,n)=>{f(t),((e,t,i,o,n)=>{if(""!==e&&null!=e){let o,s;n?o=i:null!==i&&(s=i.getElementsByClassName("jsCT_CTA"),null!=s&&1===s.length&&(o=s[0]));const r=t.display.jsFunc,l=t.display.preview;null==l&&(e+=u()),null!=o&&(o.onclick=()=>{if(null!=r)return null==l&&Qe.fireRequest(e),p(r,t),void at("-1",0,a.sessionId);1===t.display.window?window.open(e,"_blank"):window.location=e})}})(e,t,i,0,n)},f=e=>{const t={type:"event"};t.evtName=R,t.evtData={[T]:e.wzrk_id},e.wzrk_pivot&&(t.evtData={...t.evtData,wzrk_pivot:e.wzrk_pivot}),l.processEvent(t)},v=e=>{var t;void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Lt);const i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,o=document.createElement("ct-web-personalisation-banner");o.msgId=e.wzrk_id,o.pivotId=e.wzrk_pivot,o.divHeight=e.display.divHeight,o.details=e.display.details[0];const n=e.display.divId?document.getElementById(i):document.querySelector(i);n.innerHTML="",n.appendChild(o)},m=e=>{var t;void 0===customElements.get("ct-web-personalisation-carousel")&&customElements.define("ct-web-personalisation-carousel",Mt);const i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,o=document.createElement("ct-web-personalisation-carousel");o.target=e;const n=e.display.divId?document.getElementById(i):document.querySelector(i);n.innerHTML="",n.appendChild(o)},y=e=>{const t=e.wzrk_id.split("_")[0],i=e.display;if(2===i.wtarget_type&&1===e.msgContent.type){const t={};t.msgId=e.wzrk_id,e.wzrk_pivot&&(t.pivotId=e.wzrk_pivot),null!=e.msgContent.kv&&(t.kv=e.msgContent.kv);const i=new CustomEvent("CT_web_native_display",{detail:t});return void document.dispatchEvent(i)}if(1===i.layout)return O(void 0,e);if(3===i.layout){const t="wzrkImageOnlyDiv";if(!1===h(e))return;if(le.dismissSpamControl&&null!=document.getElementById(t)){document.getElementById(t).remove()}if(null!=document.getElementById(t)||null!=document.getElementById("intentPreview"))return;const i=document.createElement("div");return i.id=t,document.body.appendChild(i),void 0===customElements.get("ct-web-popup-imageonly")&&customElements.define("ct-web-popup-imageonly",Tt),(e=>{const t=document.createElement("ct-web-popup-imageonly");t.session=a,t.target=e;const i=document.getElementById("wzrkImageOnlyDiv");i.innerHTML="",i.style.visibility="hidden",i.appendChild(t)})(e)}if(!1===h(e))return;const o="wizParDiv"+i.layout;if(le.dismissSpamControl&&null!=document.getElementById(o)){document.getElementById(o).remove()}if(null!=document.getElementById(o))return;le.campaignDivMap[t]=o;const n=2===i.layout,s=document.createElement("div");s.id=o;const r=window.innerHeight,l=window.innerWidth;let c=!1;if(n)s.setAttribute("style",i.iFrameStyle);else{var d=10;let e=5*l/100,t=d+5*r/100,o=30*l/100+20,n="width:30%;";(/mobile/i.test(navigator.userAgent)||/mini/i.test(navigator.userAgent))&&!1===/iPad/i.test(navigator.userAgent)?(o=85*l/100+20,e=5*l/100,t=5*r/100,n="width:80%;"):("ontouchstart"in window||/tablet/i.test(navigator.userAgent))&&(o=50*l/100+20,e=5*l/100,t=5*r/100,n="width:50%;"),null==i.proto?(c=!0,s.setAttribute("style","display:block;overflow:hidden; bottom:"+t+"px !important;width:"+o+"px !important;right:"+e+"px !important;position:fixed;z-index:2147483647;")):s.setAttribute("style",n+i.iFrameStyle)}document.body.appendChild(s);const u=document.createElement("iframe"),p=!1===i.br?"0":"8";u.frameborder="0px",u.marginheight="0px",u.marginwidth="0px",u.scrolling="no",u.id="wiz-iframe";const f=e.display.onClick;let v,b="";if(""!==f&&null!=f&&(b="cursor:pointer;"),1===e.msgContent.type)v=e.msgContent.html,v=v.replace(/##campaignId##/g,t),v=v.replace(/##campaignId_batchId##/g,e.wzrk_id);else{const i='";let n,s,r,a,l;"dark"===e.display.theme?(n="#2d2d2e",s="#eaeaea",r="#353535",a="#353535",l="#ffffff"):(n="#ffffff",s="#000000",a="#f4f4f4",r="#a5a6a6",l="#ffffff");const c=e.msgContent.title,d=e.msgContent.description;let h="";null!=e.msgContent.imageUrl&&""!==e.msgContent.imageUrl&&(h="");v=i+("
×
"+h+"
"+c+"
")+("
"+d+"
")}u.setAttribute("style","z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;"),s.appendChild(u);const m=(u.contentWindow?u.contentWindow:u.contentDocument.document?u.contentDocument.document:u.contentDocument).document,y=new Event("CT_campaign_rendered");document.dispatchEvent(y),m.open(),m.write(v),i["custom-editor"]&&k(e,m),m.close();const w=()=>{d=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv").scrollHeight,!0===i["custom-editor"]||n||(d+=25),document.getElementById("wiz-iframe").contentDocument.body.style.margin="0px",document.getElementById("wiz-iframe").style.height=d+"px"},C=navigator.userAgent.toLowerCase();if(-1!==C.indexOf("safari"))if(C.indexOf("chrome")>-1)u.onload=()=>{w();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)};else{let t=u.contentDocument||u.contentWindow;t.document&&(t=t.document),w();const i=setInterval((()=>{if("complete"===t.readyState){clearInterval(i),w();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)}}),10)}else u.onload=()=>{w();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)}},k=(e,t)=>{const i=t.createElement("script");i.innerHTML="\n const ct__camapignId = '".concat(e.wzrk_id,"';\n const ct__formatVal = (v) => {\n return v && v.trim().substring(0, 20);\n }\n const ct__parentOrigin = window.parent.origin;\n document.body.addEventListener('click', (event) => {\n const elem = event.target.closest?.('a[wzrk_c2a], button[wzrk_c2a]');\n if (elem) {\n const {innerText, id, name, value, href} = elem;\n const clickAttr = elem.getAttribute('onclick') || elem.getAttribute('click');\n const onclickURL = clickAttr?.match(/(window.open)[(](\"|')(.*)(\"|',)/)?.[3] || clickAttr?.match(/(location.href *= *)(\"|')(.*)(\"|')/)?.[3];\n const props = {innerText, id, name, value};\n let msgCTkv = Object.keys(props).reduce((acc, c) => {\n const formattedVal = ct__formatVal(props[c]);\n formattedVal && (acc['wzrk_click_' + c] = formattedVal);\n return acc;\n }, {});\n if(onclickURL) { msgCTkv['wzrk_click_' + 'url'] = onclickURL; }\n if(href) { msgCTkv['wzrk_click_' + 'c2a'] = href; }\n const notifData = { msgId: ct__camapignId, msgCTkv, pivotId: '").concat(e.wzrk_pivot,"' };\n window.parent.clevertap.renderNotificationClicked(notifData);\n }\n });\n "),t.body.appendChild(i)};let x=!1;const S=e=>{let t=e.display.onClick;if(window.clevertap.hasOwnProperty("notificationCallback")&&void 0!==window.clevertap.notificationCallback&&"function"==typeof window.clevertap.notificationCallback){const i=window.clevertap.notificationCallback;if(!x){const o={};o.msgContent=e.msgContent,o.msgId=e.wzrk_id,e.wzrk_pivot&&(o.pivotId=e.wzrk_pivot),null!=e.display.kv&&(o.kv=e.display.kv),window.clevertap.raiseNotificationClicked=()=>{if(""!==t&&null!=t){const i=e.display.jsFunc;if(t+=u(),null!=i)return Qe.fireRequest(t),void p(i,e);1===e.display.window?window.open(t,"_blank"):window.location=t}},window.clevertap.raiseNotificationViewed=()=>{f(e)},i(o),x=!0}}else if(window.clevertap.popupCurrentWzrkId=e.wzrk_id,y(e),window.clevertap.hasOwnProperty("popupCallbacks")&&void 0!==window.clevertap.popupCallbacks&&"function"==typeof window.clevertap.popupCallbacks[e.wzrk_id]){const t=window.clevertap.popupCallbacks[e.wzrk_id],n={};n.msgContent=e.msgContent,n.msgId=e.wzrk_id,e.wzrk_pivot&&(n.pivotId=e.wzrk_pivot);var i=[];for(var o in e)if(o.startsWith(M)&&o!==T){const t={[o]:e[o]};i.push(t)}i.length>0&&(n.msgCTkv=i),null!=e.display.kv&&(n.kv=e.display.kv),window.clevertap.raisePopupNotificationClicked=t=>{if(!t||!t.msgId)return;const i={type:"event"};if(i.evtName=j,i.evtData={[T]:t.msgId},e.wzrk_pivot&&(i.evtData={...i.evtData,wzrk_pivot:t.pivotId}),t.msgCTkv)for(var o of t.msgCTkv)i.evtData={...i.evtData,...o};l.processEvent(i)},t(n)}};let I;const O=(e,t)=>{let i;if(null!=e&&e.clientY>0)return;if(i=null==t?I:t,le.dismissSpamControl&&0===i.display.wtarget_type&&null!=document.getElementById("intentPreview")&&null!=document.getElementById("intentOpacityDiv")){document.getElementById("intentPreview").remove(),document.getElementById("intentOpacityDiv").remove()}if(null!=document.getElementById("intentPreview")||null!=document.getElementById("wzrkImageOnlyDiv"))return;if(null==i.display.layout&&(/mobile/i.test(navigator.userAgent)||/mini/i.test(navigator.userAgent)||/iPad/i.test(navigator.userAgent)||"ontouchstart"in window||/tablet/i.test(navigator.userAgent)))return;if(!1===h(i))return;const o=i.wzrk_id.split("_")[0];le.campaignDivMap[o]="intentPreview";let n=!1;const s=document.createElement("div");s.id="intentOpacityDiv";const r=i.display.opacity||.7,a="rgba(0,0,0,".concat(r,")");s.setAttribute("style","position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ".concat(a,";")),document.body.appendChild(s);const l=document.createElement("div");l.id="intentPreview",null==i.display.proto?(n=!0,l.setAttribute("style","display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;")):l.setAttribute("style",i.display.iFrameStyle),document.body.appendChild(l);const c=document.createElement("iframe"),d=!1===i.display.br?"0":"8";c.frameborder="0px",c.marginheight="0px",c.marginwidth="0px",c.scrolling="no",c.id="wiz-iframe-intent";const u=i.display.onClick;let p,f="";if(""!==u&&null!=u&&(f="cursor:pointer;"),1===i.msgContent.type)p=i.msgContent.html,p=p.replace(/##campaignId##/g,o),p=p.replace(/##campaignId_batchId##/g,i.wzrk_id);else{const e='";let t,n,s,r;"dark"===i.display.theme?(t="#2d2d2e",n="#eaeaea",s="#353535",r="#ffffff"):(t="#ffffff",n="#000000",s="#a5a6a6",r="#ffffff");const a=i.msgContent.title,l=i.msgContent.description;let c="";null!=i.msgContent.ctaText&&""!==i.msgContent.ctaText&&(c="");let h="";null!=i.msgContent.imageUrl&&""!==i.msgContent.imageUrl&&(h="
+a+
");p=e+("
×
"+a+"
")+("
"+l+"
"+h+c+"
")}c.setAttribute("style","z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;"),l.appendChild(c);const v=(c.contentWindow?c.contentWindow:c.contentDocument.document?c.contentDocument.document:c.contentDocument).document,b=new Event("CT_campaign_rendered");document.dispatchEvent(b),v.open(),v.write(p),i.display["custom-editor"]&&k(i,v),v.close();const m=document.getElementById("wiz-iframe-intent").contentDocument.getElementById("contentDiv");g(u,i,m,0,n)};if(!document.body)return void(d<6&&(d++,setTimeout(Yt,1e3,e,{device:r,session:a,request:l,logger:c})));const _=e=>{Object.keys(e).map((t=>{var i,o;e[t].display.divId?(i=e[t].display.divId,o=document.getElementById(i)):(i=e[t].display.divSelector,o=document.querySelector(i)),null!==o&&(2===e[t].msgContent.type?v(e[t]):m(e[t]),delete e[t])}))};if(null!=e.inapp_notifs){const t={};for(let i=0;i{window.addEventListener("load",(()=>{let t=0;if(t<20){const i=setInterval((()=>{_(e),0!==Object.keys(e).length&&20!==t||(clearInterval(i),e={}),t++}),500)}}))})(t))}const E=()=>{if(e.inbox_preview)Dt(e);else if(e.inbox_notifs){const t=[];for(let i=0;i1&&void 0!==arguments[1]&&arguments[1];const i=ae.readFromLSorCookie(q)||{};t?(le.inbox.inboxConfigForPreview=e,le.inbox.isPreview=!0,le.inbox&&le.inbox.init()):JSON.stringify(i)!==JSON.stringify(e)&&(ae.saveToLSorCookie(q,e),le.inbox&&le.inbox.init())}(e.webInboxSetting),Ut(c).then((()=>{E()})).catch((e=>{}))):E()),e.vars)return void le.variableStore.mergeVariables(e.vars);const A=(e,t)=>{const i=Xe(),o=i[t].global;if(null!=o&&t)for(const i in e)if(e.hasOwnProperty(i)&&(delete o[e[i]],ae.read(w))){const o=JSON.parse(decodeURIComponent(ae.read(w))),n=JSON.parse(decodeURIComponent(ae.read(b)));o[n]&&o[n][t]&&o[n][t][e[i]]&&(delete o[n][t][e[i]],ae.save(w,encodeURIComponent(JSON.stringify(o))))}et(i)};if(ae._isLocalStorageSupported())try{if(null!=e.evpr){const t=e.evpr.events,i=e.evpr.profile,o=e.evpr.expires_in,n=oe();ae.setMetaProp("lsTime",n),ae.setMetaProp("exTs",o),(e=>{if(null!=le.globalEventsMap||(le.globalEventsMap=ae.readFromLSorCookie(C),null!=le.globalEventsMap)){for(const t in e)if(e.hasOwnProperty(t)){const i=le.globalEventsMap[t],o=e[t];null!=le.globalEventsMap[t]?null!=o[0]&&o[0]>i[0]&&(le.globalEventsMap[t]=o):le.globalEventsMap[t]=o}}else le.globalEventsMap=e})(t),ae.saveToLSorCookie(C,le.globalEventsMap),null==le.globalProfileMap?rt(i,!0):rt(i,!1)}null!=e.arp&&(e=>{if(null!=e.skipResARP&&e.skipResARP)return console.debug("Update ARP Request rejected",e),null;const t=!0===e.isOUL;if(ae._isLocalStorageSupported())try{let i=ae.readFromLSorCookie(P);if(null==i||t){i={};for(const t in e)e.hasOwnProperty(t)&&(-1===e[t]?delete i[t]:i[t]=e[t]);ae.saveToLSorCookie(P,i)}}catch(e){console.error("Unable to parse ARP JSON: "+e)}})(e.arp),null!=e.inapp_stale&&e.inapp_stale.length>0&&A(e.inapp_stale,"wp"),null!=e.inbox_stale&&e.inbox_stale.length>0&&A(e.inbox_stale,"wi")}catch(e){c.error("Unable to persist evrp/arp: "+e)}};var Qt=t("isPersonalisationActive");class Xt{constructor(e){let{isPersonalisationActive:t}=e;Object.defineProperty(this,Qt,{writable:!0,value:void 0}),i(this,Qt)[Qt]=t}getTotalVisits(){if(!i(this,Qt)[Qt]())return;let e=ae.getMetaProp("sc");return null==e&&(e=1),e}getLastVisit(){if(!i(this,Qt)[Qt]())return;const e=ae.getMetaProp("ps");return null!=e?new Date(1e3*e):void 0}}const ei=1,ti=2,ii=3,oi=4;var ni=t("logLevel"),si=t("log"),ri=t("isLegacyDebug");class ai{constructor(e){Object.defineProperty(this,ri,{get:ci,set:void 0}),Object.defineProperty(this,si,{value:li}),Object.defineProperty(this,ni,{writable:!0,value:void 0}),this.wzrkError={},i(this,ni)[ni]=null==e?e:ti,this.wzrkError={}}get logLevel(){return i(this,ni)[ni]}set logLevel(e){i(this,ni)[ni]=e}error(e){i(this,ni)[ni]>=ei&&i(this,si)[si]("error",e)}info(e){i(this,ni)[ni]>=ti&&i(this,si)[si]("log",e)}debug(e){(i(this,ni)[ni]>=ii||i(this,ri)[ri])&&i(this,si)[si]("debug",e)}debugPE(e){i(this,ni)[ni]>=oi&&i(this,si)[si]("debug_pe",e)}reportError(e,t){this.wzrkError.c=e,this.wzrkError.d=t,this.error("".concat(Ce," ").concat(e,": ").concat(t))}}var li=function(e,t){if(window.console)try{const i=(new Date).getTime();console[e]("CleverTap [".concat(i,"]: ").concat(t))}catch(e){}},ci=function(){return"undefined"!=typeof sessionStorage&&""===sessionStorage.WZRK_D},di=t("logger"),hi=t("sessionId"),ui=t("isPersonalisationActive");class pi{constructor(e){let{logger:t,isPersonalisationActive:o}=e;Object.defineProperty(this,di,{writable:!0,value:void 0}),Object.defineProperty(this,hi,{writable:!0,value:void 0}),Object.defineProperty(this,ui,{writable:!0,value:void 0}),this.cookieName=void 0,this.scookieObj=void 0,this.sessionId=ae.getMetaProp("cs"),i(this,di)[di]=t,i(this,ui)[ui]=o}get sessionId(){return i(this,hi)[hi]}set sessionId(e){i(this,hi)[hi]=e}getSessionCookieObject(){let e=ae.readCookie(this.cookieName),t={};if(null!=e)if(e=e.replace(p,'"'),t=JSON.parse(e),J(t)){if(void 0!==t.t){const e=t.t;oe()-e>1260&&(t={})}}else t={};return this.scookieObj=t,t}setSessionCookieObject(e){const t=JSON.stringify(e);ae.createBroadCookie(this.cookieName,t,1200,We())}manageSession(e){if(void 0===this.sessionId||this.sessionId!==e){const t=ae.getMetaProp("cs");if(void 0===t)ae.setMetaProp("ps",e),ae.setMetaProp("cs",e),ae.setMetaProp("sc",1);else if(t!==e){ae.setMetaProp("ps",t),ae.setMetaProp("cs",e);let i=ae.getMetaProp("sc");void 0===i&&(i=0),ae.setMetaProp("sc",i+1)}this.sessionId=e}}getTimeElapsed(){if(!i(this,ui)[ui]())return;null!=this.scookieObj&&(this.scookieObj=this.getSessionCookieObject());const e=this.scookieObj.s;if(null!=e){const t=oe();return Math.floor(t-e)}}getPageCount(){if(i(this,ui)[ui]())return null!=this.scookieObj&&(this.scookieObj=this.getSessionCookieObject()),this.scookieObj.p}}let gi=0,fi=0;var vi=t("logger"),bi=t("account"),mi=t("device"),yi=t("session"),wi=t("isPersonalisationActive"),Ci=t("clearCookie"),ki=t("addToLocalEventMap");class xi{constructor(e){let{logger:t,account:o,device:n,session:s,isPersonalisationActive:r}=e;Object.defineProperty(this,ki,{value:Pi}),Object.defineProperty(this,vi,{writable:!0,value:void 0}),Object.defineProperty(this,bi,{writable:!0,value:void 0}),Object.defineProperty(this,mi,{writable:!0,value:void 0}),Object.defineProperty(this,yi,{writable:!0,value:void 0}),Object.defineProperty(this,wi,{writable:!0,value:void 0}),Object.defineProperty(this,Ci,{writable:!0,value:!1}),this.processingBackup=!1,i(this,vi)[vi]=t,i(this,bi)[bi]=o,i(this,mi)[mi]=n,i(this,yi)[yi]=s,i(this,wi)[wi]=r,Qe.logger=t,Qe.device=n,Qe.account=o}processBackupEvents(){const e=ae.readFromLSorCookie(S);if(null!=e){this.processingBackup=!0;for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];void 0===o.fired&&(i(this,vi)[vi].debug("Processing backup event : "+o.q),void 0!==o.q&&Qe.fireRequest(o.q),o.fired=!0)}ae.saveToLSorCookie(S,e),this.processingBackup=!1}}addSystemDataToObject(e,t){void 0===t&&(e=ee(e,i(this,vi)[vi])),$(i(this,vi)[vi].wzrkError)||(e.wzrk_error=i(this,vi)[vi].wzrkError,i(this,vi)[vi].wzrkError={}),e.id=i(this,bi)[bi].id,X(i(this,mi)[mi].gcookie)&&(e.g=i(this,mi)[mi].gcookie);const o=i(this,yi)[yi].getSessionCookieObject();e.s=o.s,e.pg=void 0===o.p?1:o.p;let n=document.location.protocol;return n=n.replace(":",""),e.af={lib:"web-sdk-v1.7.3",protocol:n,...le.flutterVersion},sessionStorage.hasOwnProperty("WZRK_D")&&(e.debug=!0),e}addFlags(e){if(i(this,Ci)[Ci]=ae.getAndClearMetaProp(g),void 0!==i(this,Ci)[Ci]&&i(this,Ci)[Ci]&&(e.rc=!0,i(this,vi)[vi].debug("reset cookie sent in request and cleared from meta for future requests.")),i(this,wi)[wi]()){const t=ae.getMetaProp("lsTime"),i=ae.getMetaProp("exTs");if(void 0===t||void 0===i)return void(e.dsync=!0);t+i{if(e.ok)return e.json();throw e})).then((e=>(i(this,vi)[vi].debug("Sync data successful",e),e))).catch((e=>{throw i(this,vi)[vi].debug("Error in syncing variables",e),e}))}}var Pi=function(e){if(ae._isLocalStorageSupported()){void 0===le.globalEventsMap&&(le.globalEventsMap=ae.readFromLSorCookie(C),void 0===le.globalEventsMap&&(le.globalEventsMap={}));const t=oe();let i=le.globalEventsMap[e];void 0!==i?(i[2]=t,i[0]++):(i=[],i.push(1),i.push(t),i.push(t)),le.globalEventsMap[e]=i,ae.saveToLSorCookie(C,le.globalEventsMap)}},Si=t("request"),Ii=t("account"),Oi=t("oldValues"),_i=t("logger"),Ei=t("processPrivacyArray");class Ai extends Array{constructor(e,t){let{request:o,account:n,logger:s}=e;super(),Object.defineProperty(this,Ei,{value:Li}),Object.defineProperty(this,Si,{writable:!0,value:void 0}),Object.defineProperty(this,Ii,{writable:!0,value:void 0}),Object.defineProperty(this,Oi,{writable:!0,value:void 0}),Object.defineProperty(this,_i,{writable:!0,value:void 0}),i(this,_i)[_i]=s,i(this,Si)[Si]=o,i(this,Ii)[Ii]=n,i(this,Oi)[Oi]=t}push(){for(var e=arguments.length,t=new Array(e),o=0;o0?le.privacyArray:t):le.privacyArray.push(...t),0}_processOldValues(){i(this,Oi)[Oi]&&i(this,Ei)[Ei](i(this,Oi)[Oi]),i(this,Oi)[Oi]=null}}var Li=function(e){if(Array.isArray(e)&&e.length>0){const o=e.reduce(((e,t)=>({...e,...t})),{});let n={};const s={};var t=!1;if(o.hasOwnProperty(O)&&"boolean"==typeof(t=o.optOut)&&(s.ct_optout=t,le.isOptInRequest=!t),o.hasOwnProperty(_)){const e=o.useIP,t="boolean"==typeof e&&e;ae.setMetaProp(_,t)}if(!$(s)){n.type="profile",n.profile=s,n=i(this,Si)[Si].addSystemDataToObject(n,void 0);const o=Ke(JSON.stringify(n),i(this,_i)[_i]);let r=i(this,Ii)[Ii].dataPostURL;r=Ve(r,"type",A),r=Ve(r,"d",o),r=Ve(r,O,t?"true":"false"),i(this,Si)[Si].saveAndFireRequest(r,le.blockRequest),e.splice(0,e.length)}}},Mi=t("oldValues"),Ti=t("logger"),Ri=t("request"),ji=t("account"),Di=t("wizAlertJSPath"),zi=t("fcmPublicKey"),Bi=t("setUpWebPush"),Ni=t("setUpWebPushNotifications"),Fi=t("setApplicationServerKey"),Ui=t("setUpSafariNotifications"),qi=t("setUpChromeFirefoxNotifications"),Vi=t("addWizAlertJS"),Wi=t("removeWizAlertJS"),Ki=t("handleNotificationRegistration");class Gi extends Array{constructor(e,t){let{logger:o,session:n,request:s,account:r}=e;super(),Object.defineProperty(this,Ki,{value:eo}),Object.defineProperty(this,Wi,{value:Xi}),Object.defineProperty(this,Vi,{value:Qi}),Object.defineProperty(this,qi,{value:Yi}),Object.defineProperty(this,Ui,{value:$i}),Object.defineProperty(this,Fi,{value:Zi}),Object.defineProperty(this,Ni,{value:Ji}),Object.defineProperty(this,Bi,{value:Hi}),Object.defineProperty(this,Mi,{writable:!0,value:void 0}),Object.defineProperty(this,Ti,{writable:!0,value:void 0}),Object.defineProperty(this,Ri,{writable:!0,value:void 0}),Object.defineProperty(this,ji,{writable:!0,value:void 0}),Object.defineProperty(this,Di,{writable:!0,value:void 0}),Object.defineProperty(this,zi,{writable:!0,value:void 0}),i(this,Di)[Di]="https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js",i(this,zi)[zi]=null,i(this,Mi)[Mi]=t,i(this,Ti)[Ti]=o,i(this,Ri)[Ri]=s,i(this,ji)[ji]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o0?i(this,Ki)[Ki](e):null==le.webPushEnabled&&e.length>0?(le.notifApi.notifEnabledFromApi=!0,le.notifApi.displayArgs=e.slice()):!1===le.webPushEnabled&&e.length>0&&i(this,Ti)[Ti].error("Make sure push notifications are fully enabled and integrated")},Ji=function(e,t,o,n){-1!==navigator.userAgent.indexOf("Chrome")||-1!==navigator.userAgent.indexOf("Firefox")?i(this,qi)[qi](e,t):-1!==navigator.userAgent.indexOf("Safari")&&i(this,Ui)[Ui](e,o,n)},Zi=function(e){i(this,zi)[zi]=e},$i=function(e,t,o){void 0===t&&i(this,Ti)[Ti].error("Ensure that APNS Web Push ID is supplied"),void 0===o&&i(this,Ti)[Ti].error("Ensure that APNS Web Push service path is supplied"),"safari"in window&&"pushNotification"in window.safari&&window.safari.pushNotification.requestPermission(o,t,{},(e=>{if("granted"===e.permission){const t=JSON.parse(JSON.stringify(e));t.endpoint=e.deviceToken,t.browser="Safari",ae.saveToLSorCookie(z,t),i(this,Ri)[Ri].registerToken(t),i(this,Ti)[Ti].info("Safari Web Push registered. Device Token: "+e.deviceToken)}else"denied"===e.permission&&i(this,Ti)[Ti].info("Error subscribing to Safari web push")}))},Yi=function(e,t){let o="";"serviceWorker"in navigator&&navigator.serviceWorker.register(t).then((e=>{if("undefined"!=typeof __wzrk_account_id)return new Promise((t=>setTimeout((()=>t(e)),5e3)));o=e.scope;return/^(\.?)(\/?)([^/]*).js$/.test(t)?navigator.serviceWorker.ready:-1!==navigator.userAgent.indexOf("Chrome")?new Promise((t=>setTimeout((()=>t(e)),5e3))):navigator.serviceWorker.getRegistrations()})).then((t=>{-1!==navigator.userAgent.indexOf("Firefox")&&Array.isArray(t)&&(t=t.filter((e=>e.scope===o))[0]);const n={userVisibleOnly:!0};null!=i(this,zi)[zi]&&(n.applicationServerKey=(e=>{let t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),i=window.atob(t),o=[];for(let e=0;e{i(this,Ti)[Ti].info("Service Worker registered. Endpoint: "+t.endpoint);const o=JSON.parse(JSON.stringify(t));-1!==navigator.userAgent.indexOf("Chrome")?(o.endpoint=o.endpoint.split("/").pop(),o.browser="Chrome"):-1!==navigator.userAgent.indexOf("Firefox")&&(o.endpoint=o.endpoint.split("/").pop(),o.browser="Firefox"),ae.saveToLSorCookie(z,o),i(this,Ri)[Ri].registerToken(o),void 0!==e&&"function"==typeof e&&e()})).catch((e=>{i(this,Ti)[Ti].error("Error subscribing: "+e),t.pushManager.getSubscription().then((e=>{null!==e&&e.unsubscribe().then((e=>{i(this,Ti)[Ti].info("Unsubscription successful")})).catch((e=>{i(this,Ti)[Ti].error("Error unsubscribing: "+e)}))}))}))})).catch((e=>{i(this,Ti)[Ti].error("error registering service worker: "+e)}))},Qi=function(){const e=document.createElement("script");return e.setAttribute("type","text/javascript"),e.setAttribute("id","wzrk-alert-js"),e.setAttribute("src",i(this,Di)[Di]),document.getElementsByTagName("body")[0].appendChild(e),e},Xi=function(){const e=document.getElementById("wzrk-alert-js");e.parentNode.removeChild(e)},eo=function(e){let t,o,n,s,r,a,l,c,d,h,u,p,g,f,v;if(1===e.length){if(J(e[0])){const i=e[0];t=i.titleText,o=i.bodyText,n=i.okButtonText,s=i.rejectButtonText,r=i.okButtonColor,a=i.skipDialog,l=i.askAgainTimeInSeconds,c=i.okCallback,d=i.rejectCallback,h=i.subscriptionCallback,u=i.serviceWorkerPath,p=i.httpsPopupPath,g=i.httpsIframePath,f=i.apnsWebPushId,v=i.apnsWebPushServiceUrl}}else t=e[0],o=e[1],n=e[2],s=e[3],r=e[4],a=e[5],l=e[6];if(null==a&&(a=!1),null==u&&(u="/clevertap_sw.js"),void 0===navigator.serviceWorker)return;const b=null!=p&&null!=g;if("https:"!==window.location.protocol&&"localhost"!==document.location.hostname&&!b)return void i(this,Ti)[Ti].error("Make sure you are https or localhost to register for notifications");if(-1!==navigator.userAgent.indexOf("Chrome")){const e=navigator.userAgent.match(/Chrome\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}else if(-1!==navigator.userAgent.indexOf("Firefox")){const e=navigator.userAgent.match(/Firefox\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}else{if(-1===navigator.userAgent.indexOf("Safari"))return;{const e=navigator.userAgent.match(/Safari\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}}if(!b){if(null==Notification)return;if("granted"===Notification.permission)return void i(this,Ni)[Ni](h,u,f,v);if("denied"===Notification.permission)return;if(a)return void i(this,Ni)[Ni](h,u,f,v)}if(!(t&&o&&n&&s))return void i(this,Ti)[Ti].error("Missing input parameters; please specify title, body, ok button and cancel button text");null!=r&&r.match(/^#[a-f\d]{6}$/i)||(r="#f28046");const m=(new Date).getTime()/1e3;if(null==ae.getMetaProp("notif_last_time"))ae.setMetaProp("notif_last_time",m);else{if(null==l&&(l=604800),m-ae.getMetaProp("notif_last_time"){if(null!=e.data){let a={};try{a=JSON.parse(e.data)}catch(e){return}null!=a.state&&"ct"===a.from&&"not"===a.state&&(i(this,Vi)[Vi]().onload=()=>{window.wzrkPermissionPopup.wizAlert({title:t,body:o,confirmButtonText:n,confirmButtonColor:r,rejectButtonText:s},(e=>{e?("function"==typeof c&&c(),window.open(p)):"function"==typeof d&&d(),i(this,Wi)[Wi]()}))})}}),!1)}else i(this,Vi)[Vi]().onload=()=>{window.wzrkPermissionPopup.wizAlert({title:t,body:o,confirmButtonText:n,confirmButtonColor:r,rejectButtonText:s},(e=>{e?("function"==typeof c&&c(),i(this,Ni)[Ni](h,u,f,v)):"function"==typeof d&&d(),i(this,Wi)[Wi]()}))}},to=t("variableStore");class io{constructor(e){let{variableStore:t}=e;Object.defineProperty(this,to,{writable:!0,value:void 0}),this.name=null,this.defaultValue=null,this.value=null,this.type=null,this.hadStarted=!1,this.valueChangedCallbacks=[],i(this,to)[to]=t}getValue(){return this.value}getdefaultValue(){return this.defaultValue}static define(e,t,i){if(!e||"string"!=typeof e)return console.error("Empty or invalid name parameter provided."),null;if(e.startsWith(".")||e.endsWith("."))return console.error("Variable name starts or ends with a `.` which is not allowed: "+e),null;const o=typeof t;if("string"!==o&&"number"!==o&&"boolean"!==o)return console.error("Only primitive types (string, number, boolean) are accepted as value"),null;const n=i.getVariable(e);if(n)return n;const s=new io({variableStore:i});try{s.name=e,s.defaultValue=t,s.value=t,s.type=o,i.registerVariable(s),s.update(t)}catch(e){console.error(e)}return s}update(e){const t=this.value;this.value=e,null===e&&null===t||null!==e&&e===t&&this.hadStarted||i(this,to)[to].hasVarsRequestCompleted()&&(this.hadStarted=!0,this.triggerValueChanged())}triggerValueChanged(){this.valueChangedCallbacks.forEach((e=>{e(this)}))}addValueChangedCallback(e){e?(this.valueChangedCallbacks.push(e),i(this,to)[to].hasVarsRequestCompleted()&&e(this)):console.log("Invalid callback parameter provided.")}removeValueChangedCallback(e){const t=this.valueChangedCallbacks.indexOf(e);-1!==t&&this.valueChangedCallbacks.splice(t,1)}clearStartFlag(){this.hadStarted=!1}}var oo=t("logger"),no=t("account"),so=t("request"),ro=t("event"),ao=t("variables"),lo=t("remoteVariables"),co=t("fetchCallback"),ho=t("variablesChangedCallbacks"),uo=t("oneTimeVariablesChangedCallbacks"),po=t("hasVarsRequestCompleted"),go=t("runVariablesChangedCallback");class fo{constructor(e){let{logger:t,request:o,account:n,event:s}=e;Object.defineProperty(this,go,{value:vo}),Object.defineProperty(this,oo,{writable:!0,value:void 0}),Object.defineProperty(this,no,{writable:!0,value:void 0}),Object.defineProperty(this,so,{writable:!0,value:void 0}),Object.defineProperty(this,ro,{writable:!0,value:void 0}),Object.defineProperty(this,ao,{writable:!0,value:void 0}),Object.defineProperty(this,lo,{writable:!0,value:void 0}),Object.defineProperty(this,co,{writable:!0,value:void 0}),Object.defineProperty(this,ho,{writable:!0,value:void 0}),Object.defineProperty(this,uo,{writable:!0,value:void 0}),Object.defineProperty(this,po,{writable:!0,value:!1}),i(this,oo)[oo]=t,i(this,no)[no]=n,i(this,so)[so]=o,i(this,ro)[ro]=s,i(this,ao)[ao]={},i(this,lo)[lo]={},i(this,ho)[ho]=[],i(this,uo)[uo]=[],le.variableStore=this}registerVariable(e){const{name:t}=e;i(this,ao)[ao][t]=e,console.log("registerVariable",i(this,ao)[ao])}getVariable(e){return i(this,ao)[ao][e]}hasVarsRequestCompleted(){return i(this,po)[po]}syncVariables(e,t){if(!i(this,no)[no].token){const e="Account token is missing.";return i(this,oo)[oo].error(e),Promise.reject(new Error(e))}const o={type:"varsPayload",vars:{}};for(const e in i(this,ao)[ao])o.vars[e]={defaultValue:i(this,ao)[ao][e].defaultValue,type:i(this,ao)[ao][e].type};if(0===Object.keys(o.vars).length){const e="No variables are defined.";return i(this,oo)[oo].error(e),Promise.reject(new Error(e))}let n={};n=i(this,so)[so].addSystemDataToObject(n,void 0),n.tk=i(this,no)[no].token,n.type="meta";const s=JSON.stringify([n,o]),r=i(this,no)[no].dataPostPEURL;return i(this,so)[so].post(r,s).then((t=>(e&&"function"==typeof e&&e(t),t))).catch((e=>{throw t&&"function"==typeof t&&t(e),400===e.status?i(this,oo)[oo].error("Invalid sync payload or clear the existing draft"):401===e.status?i(this,oo)[oo].error("This is not a test profile"):i(this,oo)[oo].error("Sync variable failed"),e}))}fetchVariables(e){i(this,ro)[ro].push(K,{t:4}),e&&"function"==typeof e&&(i(this,co)[co]=e)}mergeVariables(e){console.log("msg vars is ",e),i(this,po)[po]=!0,ae.saveToLSorCookie("WZRK_PE",e),i(this,lo)[lo]=e;for(const t in i(this,ao)[ao])e.hasOwnProperty(t)&&i(this,ao)[ao][t].update(e[t]);i(this,co)[co]&&i(this,co)[co](),i(this,go)[go]()}addVariablesChangedCallback(e){e&&"function"==typeof e?(i(this,ho)[ho].push(e),this.hasVarsRequestCompleted()&&e()):i(this,oo)[oo].error("callback is not a function")}addOneTimeVariablesChangedCallback(e){e&&"function"==typeof e&&(this.hasVarsRequestCompleted()?e():i(this,uo)[uo].push(e))}removeVariablesChangedCallback(e){const t=i(this,ho)[ho].indexOf(e);-1!==t&&i(this,ho)[ho].splice(t,1)}removeOneTimeVariablesChangedCallback(e){const t=i(this,uo)[uo].indexOf(e);-1!==t&&i(this,uo)[uo].splice(t,1)}}var vo=function(){for(var e of i(this,ho)[ho])e();for(var t of i(this,uo)[uo])t();i(this,uo)[uo].length=0},bo=t("logger"),mo=t("api"),yo=t("onloadcalled"),wo=t("device"),Co=t("session"),ko=t("account"),xo=t("request"),Po=t("variableStore"),So=t("isSpa"),Io=t("previousUrl"),Oo=t("boundCheckPageChanged"),_o=t("dismissSpamControl"),Eo=t("processOldValues"),Ao=t("debounce"),Lo=t("checkPageChanged"),Mo=t("handleMessageEvent"),To=t("pingRequest"),Ro=t("isPingContinuous"),jo=t("overrideDSyncFlag");var Do=function(){this.onUserLogin._processOldValues(),this.privacy._processOldValues(),this.event._processOldValues(),this.profile._processOldValues(),this.notifications._processOldValues()},zo=function(e){let t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300;return function(){clearTimeout(t),t=setTimeout(e,i)}},Bo=function(){i(this,Ao)[Ao]((()=>{i(this,Io)[Io]!==location.href&&this.pageChanged()}))()},No=function(e){var t;e.data&&e.data.message&&("Dashboard"===e.data.message&&e.data.url?Jt(e.data.url,null!==(t=e.data.variant)&&void 0!==t?t:null):"Overlay"===e.data.message&&$t(e.data,!0))},Fo=function(){let e=i(this,ko)[ko].dataPostURL,t={};t=i(this,xo)[xo].addSystemDataToObject(t,void 0),e=Ve(e,"type","ping"),e=Ve(e,"d",Ke(JSON.stringify(t),i(this,bo)[bo])),i(this,xo)[xo].saveAndFireRequest(e,le.blockRequest)},Uo=function(){return void 0!==window.wzrk_d&&"continuous"===window.wzrk_d.ping},qo=function(e){this._isPersonalisationActive()&&(e.dsync=!0)};const Vo=new class{get spa(){return i(this,So)[So]}set spa(e){const t=!0===e;i(this,So)[So]!==t&&1===i(this,yo)[yo]&&(t?document.addEventListener("click",i(this,Oo)[Oo]):document.removeEventListener("click",i(this,Oo)[Oo])),i(this,So)[So]=t}get dismissSpamControl(){return i(this,_o)[_o]}set dismissSpamControl(e){const t=!0===e;i(this,_o)[_o]=t,le.dismissSpamControl=t}constructor(){var e,t,o,n,s;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.defineProperty(this,jo,{value:qo}),Object.defineProperty(this,Ro,{value:Uo}),Object.defineProperty(this,To,{value:Fo}),Object.defineProperty(this,Mo,{value:No}),Object.defineProperty(this,Lo,{value:Bo}),Object.defineProperty(this,Ao,{value:zo}),Object.defineProperty(this,Eo,{value:Do}),Object.defineProperty(this,bo,{writable:!0,value:void 0}),Object.defineProperty(this,mo,{writable:!0,value:void 0}),Object.defineProperty(this,yo,{writable:!0,value:void 0}),Object.defineProperty(this,wo,{writable:!0,value:void 0}),Object.defineProperty(this,Co,{writable:!0,value:void 0}),Object.defineProperty(this,ko,{writable:!0,value:void 0}),Object.defineProperty(this,xo,{writable:!0,value:void 0}),Object.defineProperty(this,Po,{writable:!0,value:void 0}),Object.defineProperty(this,So,{writable:!0,value:void 0}),Object.defineProperty(this,Io,{writable:!0,value:void 0}),Object.defineProperty(this,Oo,{writable:!0,value:i(this,Lo)[Lo].bind(this)}),Object.defineProperty(this,_o,{writable:!0,value:void 0}),this.enablePersonalization=void 0,this.popupCallbacks={},this.popupCurrentWzrkId="",i(this,yo)[yo]=0,this._isPersonalisationActive=this._isPersonalisationActive.bind(this),this.raiseNotificationClicked=()=>{},i(this,bo)[bo]=new ai(ti),i(this,ko)[ko]=new d(null===(e=r.account)||void 0===e?void 0:e[0],r.region||(null===(t=r.account)||void 0===t?void 0:t[1]),r.targetDomain||(null===(o=r.account)||void 0===o?void 0:o[2]),r.token||(null===(n=r.account)||void 0===n?void 0:n[3])),i(this,wo)[wo]=new ye({logger:i(this,bo)[bo]}),i(this,_o)[_o]=r.dismissSpamControl||!1,i(this,Co)[Co]=new pi({logger:i(this,bo)[bo],isPersonalisationActive:this._isPersonalisationActive}),i(this,xo)[xo]=new xi({logger:i(this,bo)[bo],account:i(this,ko)[ko],device:i(this,wo)[wo],session:i(this,Co)[Co],isPersonalisationActive:this._isPersonalisationActive}),this.enablePersonalization=r.enablePersonalization||!1,this.event=new Fe({logger:i(this,bo)[bo],request:i(this,xo)[xo],isPersonalisationActive:this._isPersonalisationActive},r.event),this.profile=new gt({logger:i(this,bo)[bo],request:i(this,xo)[xo],account:i(this,ko)[ko],isPersonalisationActive:this._isPersonalisationActive},r.profile),this.onUserLogin=new It({request:i(this,xo)[xo],account:i(this,ko)[ko],session:i(this,Co)[Co],logger:i(this,bo)[bo],device:i(this,wo)[wo]},r.onUserLogin),this.privacy=new Ai({request:i(this,xo)[xo],account:i(this,ko)[ko],logger:i(this,bo)[bo]},r.privacy),this.notifications=new Gi({logger:i(this,bo)[bo],request:i(this,xo)[xo],account:i(this,ko)[ko]},r.notifications),i(this,Po)[Po]=new fo({logger:i(this,bo)[bo],request:i(this,xo)[xo],account:i(this,ko)[ko],event:this.event}),i(this,mo)[mo]=new be({logger:i(this,bo)[bo],request:i(this,xo)[xo],device:i(this,wo)[wo],session:i(this,Co)[Co]}),this.spa=r.spa,this.dismissSpamControl=r.dismissSpamControl,this.user=new Xt({isPersonalisationActive:this._isPersonalisationActive}),this.session={getTimeElapsed:()=>i(this,Co)[Co].getTimeElapsed(),getPageCount:()=>i(this,Co)[Co].getPageCount()},this.logout=()=>{i(this,bo)[bo].debug("logout called"),ae.setInstantDeleteFlagInK()},this.clear=()=>{this.onUserLogin.clear()},this.getCleverTapID=()=>i(this,wo)[wo].getGuid(),this.getAccountID=()=>i(this,ko)[ko].id,this.getSCDomain=()=>i(this,ko)[ko].finalTargetDomain,this.setLibrary=(e,t)=>{le.flutterVersion={[e]:t}},this.setSCSDKVersion=e=>{i(this,ko)[ko].scSDKVersion=e;const t={};t.af={scv:"sc-sdk-v"+i(this,ko)[ko].scSDKVersion};let o=i(this,ko)[ko].dataPostURL;o=Ve(o,"type","page"),o=Ve(o,"d",Ke(JSON.stringify(t),i(this,bo)[bo])),i(this,xo)[xo].saveAndFireRequest(o,le.blockRequest)},Kt()&&(qt(),Ut(i(this,bo)[bo])),this.getInboxMessageCount=()=>{const e=Nt();return Object.keys(e).length},this.getInboxMessageUnreadCount=()=>{if(le.inbox)return le.inbox.unviewedCounter;i(this,bo)[bo].debug("No unread messages")},this.getAllInboxMessages=()=>Nt(),this.getUnreadInboxMessages=()=>{if(le.inbox)return le.inbox.unviewedMessages;i(this,bo)[bo].debug("No unread messages")},this.getInboxMessageForId=e=>{const t=Nt();if((null!==e||""!==e)&&t.hasOwnProperty(e))return t[e];i(this,bo)[bo].error("No message available for message Id "+e)},this.deleteInboxMessage=e=>{const t=Nt();if(null===e&&""===e||!t.hasOwnProperty(e))i(this,bo)[bo].error("No message available for message Id "+e);else{const i=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);0===t[e].viewed&&(le.inbox.unviewedCounter--,delete le.inbox.unviewedMessages[e],document.getElementById("unviewedBadge").innerText=le.inbox.unviewedCounter,document.getElementById("unviewedBadge").style.display=le.inbox.unviewedCounter>0?"flex":"none"),i&&i.remove(),delete t[e],Ft(t)}},this.markReadInboxMessage=e=>{const t=le.inbox.unviewedMessages,o=Nt();if(null===e&&""===e||!t.hasOwnProperty(e))i(this,bo)[bo].error("No message available for message Id "+e);else{const t=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);if(null!==t&&(t.shadowRoot.getElementById("unreadMarker").style.display="none"),o[e].viewed=1,document.getElementById("unviewedBadge")){var n=parseInt(document.getElementById("unviewedBadge").innerText)-1;document.getElementById("unviewedBadge").innerText=n,document.getElementById("unviewedBadge").style.display=n>0?"flex":"none"}window.clevertap.renderNotificationViewed({msgId:o[e].wzrk_id,pivotId:o[e].pivotId}),le.inbox.unviewedCounter--,delete le.inbox.unviewedMessages[e],Ft(o)}},this.markReadInboxMessagesForIds=e=>{if(Array.isArray(e))for(var t=0;t{const e=le.inbox.unviewedMessages,t=Nt();if(Object.keys(e).length>0){Object.keys(e).forEach((e=>{const i=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);null!==i&&(i.shadowRoot.getElementById("unreadMarker").style.display="none"),t[e].viewed=1,window.clevertap.renderNotificationViewed({msgId:t[e].wzrk_id,pivotId:t[e].wzrk_pivot})})),document.getElementById("unviewedBadge").innerText=0,document.getElementById("unviewedBadge").style.display="none",Ft(t),le.inbox.unviewedCounter=0,le.inbox.unviewedMessages={}}else i(this,bo)[bo].debug("All messages are already read")},this.toggleInbox=e=>{var t;return null===(t=le.inbox)||void 0===t?void 0:t.toggleInbox(e)},this.renderNotificationViewed=e=>{a(R,e)},this.renderNotificationClicked=e=>{a(j,e)};const a=(e,t)=>{if(!t||!t.msgId)return;const o={type:"event"};if(o.evtName=e,o.evtData={[T]:t.msgId},t.pivotId&&(o.evtData={...o.evtData,wzrk_pivot:t.pivotId}),t.wzrk_slideNo&&(o.evtData={...o.evtData,wzrk_slideNo:t.wzrk_slideNo}),t.kv&&null!==t.kv&&void 0!==t.kv)for(const e in t.kv)e.startsWith(M)&&(o.evtData={...o.evtData,[e]:t.kv[e]});if(t.msgCTkv&&null!==t.msgCTkv&&void 0!==t.msgCTkv)for(const e in t.msgCTkv)e.startsWith(M)&&(o.evtData={...o.evtData,[e]:t.msgCTkv[e]});i(this,xo)[xo].processEvent(o)};this.setLogLevel=e=>{i(this,bo)[bo].logLevel=Number(e),3===e?sessionStorage.WZRK_D="":delete sessionStorage.WZRK_D},this.handleIncrementValue=(e,t)=>{this.profile._handleIncrementDecrementValue(e,t,B)},this.handleDecrementValue=(e,t)=>{this.profile._handleIncrementDecrementValue(e,t,"$decr")},this.setMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueSet(e,t,"$set"):console.error("setMultiValuesForKey should be called with a value of type array")},this.addMultiValueForKey=(e,t)=>{"string"==typeof t||"number"==typeof t?this.profile._handleMultiValueAdd(e,t,N):console.error("addMultiValueForKey should be called with a value of type string or number.")},this.addMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueAdd(e,t,N):console.error("addMultiValuesForKey should be called with a value of type array.")},this.removeMultiValueForKey=(e,t)=>{"string"==typeof t||"number"==typeof t?this.profile._handleMultiValueRemove(e,t,F):console.error("removeMultiValueForKey should be called with a value of type string or number.")},this.removeMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueRemove(e,t,F):console.error("removeMultiValuesForKey should be called with a value of type array.")},this.removeValueForKey=e=>{this.profile._handleMultiValueDelete(e,U)};const l=(e,t,o)=>{((e,t,i,o,n)=>{const s=qe(location.href),r=s.e,a=s.p,l=s.page_type;if(void 0!==r){const s={};s.id=o.id,s.unsubGroups=le.unsubGroups,le.updatedCategoryLong&&(s.cUsY=le.updatedCategoryLong);let c=o.emailURL;i&&(c=Ve(c,"fetchGroups",i)),t&&(c=Ve(c,"encoded",t)),c=Ve(c,"e",r),c=Ve(c,"d",Ke(JSON.stringify(s),n)),a&&(c=Ve(c,"p",a)),"-1"!==e&&(c=Ve(c,"sub",e)),l&&(le.globalUnsubscribe=l===I,c=Ve(c,"page_type",l)),Qe.fireRequest(c)}})(e,t,o,i(this,ko)[ko],i(this,bo)[bo])};function c(e){var t=e.coords.latitude,i=e.coords.longitude;le.location={Latitude:t,Longitude:i},this.sendLocationData({Latitude:t,Longitude:i})}function h(e){switch(e.code){case e.PERMISSION_DENIED:console.log("User denied the request for Geolocation.");break;case e.POSITION_UNAVAILABLE:console.log("Location information is unavailable.");break;case e.TIMEOUT:console.log("The request to get user location timed out.");break;case e.UNKNOWN_ERROR:console.log("An unknown error occurred.")}}this.getLocation=function(e,t){if(e&&"number"!=typeof e||t&&"number"!=typeof t)console.log("Latitude and Longitude must be of number type");else if(e&&t){if(e<=-90||e>90)return void console.log("A vaid latitude must range between -90 and 90");if(t<=-180||t>180)return void console.log("A valid longitude must range between -180 and 180");le.location={Latitude:e,Longitude:t},this.sendLocationData({Latitude:e,Longitude:t})}else navigator.geolocation?navigator.geolocation.getCurrentPosition(c.bind(this),h):console.log("Geolocation is not supported by this browser.")};const u=i(this,mo)[mo];u.logout=this.logout,u.clear=this.clear,u.closeIframe=(e,t)=>{at(e,0,i(this,Co)[Co].sessionId)},u.enableWebPush=(e,t)=>{this.notifications._enableWebPush(e,t)},u.tr=e=>{Yt(e,{device:i(this,wo)[wo],session:i(this,Co)[Co],request:i(this,xo)[xo],logger:i(this,bo)[bo]})},u.setEnum=e=>{((e,t)=>{if(H(e)||Q(e))return"$E_"+e;t.error(Ae)})(e,i(this,bo)[bo])},u.is_onloadcalled=()=>1===i(this,yo)[yo],u.subEmail=e=>{l("1",e)},u.getEmail=(e,t)=>{l("-1",e,t)},u.unSubEmail=e=>{l("0",e)},u.unsubEmailGroups=e=>{le.unsubGroups=[];const t=document.getElementsByClassName("ct-unsub-group-input-item");for(let e=0;e{le.unsubGroups=e},u.getSubscriptionGroups=()=>le.unsubGroups,u.changeSubscriptionGroups=(e,t)=>{u.setSubscriptionGroups(t),l("2",e)},u.isGlobalUnsubscribe=()=>le.globalUnsubscribe,u.setIsGlobalUnsubscribe=e=>{le.globalUnsubscribe=e},u.setUpdatedCategoryLong=e=>{e.cUsY&&(le.updatedCategoryLong=e.cUsY)},window.$CLTP_WR=window.$WZRK_WR=u,(null===(s=r.account)||void 0===s?void 0:s[0].id)&&this.init()}init(e,t,o,n){if(1===i(this,yo)[yo])return;if(ae.removeCookie("WZRK_P",window.location.hostname),!i(this,ko)[ko].id){if(!e)return void i(this,bo)[bo].error(ke);i(this,ko)[ko].id=e}i(this,Co)[Co].cookieName="WZRK_S_"+i(this,ko)[ko].id,t&&(i(this,ko)[ko].region=t),o&&(i(this,ko)[ko].targetDomain=o),n&&(i(this,ko)[ko].token=n);const s=location.href,r=qe(s.toLowerCase());if(void 0!==r.e&&"0"==r.wzrk_ex)return;le.isPrivacyArrPushed=!0,le.privacyArray.length>0&&this.privacy.push(le.privacyArray),i(this,Eo)[Eo](),this.pageChanged();const a=setInterval((()=>{i(this,wo)[wo].gcookie&&(clearInterval(a),i(this,xo)[xo].processBackupEvents())}),3e3);i(this,So)[So]?document.addEventListener("click",i(this,Oo)[Oo]):document.removeEventListener("click",i(this,Oo)[Oo]),i(this,yo)[yo]=1}pageChanged(){const e=window.location.search;if("?ctBuilder"===e)return console.log("open in visual builder mode"),window.addEventListener("message",i(this,Mo)[Mo],!1),void window.postMessage("builder","*");if("?ctBuilderPreview"===e)return window.addEventListener("message",i(this,Mo)[Mo],!1),void window.postMessage("preview","*");const t=window.location.href,o=qe(t.toLowerCase()),n=i(this,Co)[Co].getSessionCookieObject();let s=void 0===n.p?0:n.p;n.p=++s,i(this,Co)[Co].setSessionCookieObject(n);let r={},a=(e=>{if(""===e)return"";var t=document.createElement("a");return t.href=e,t.hostname})(document.referrer);if(window.location.hostname!==a){const e=120;""!==a&&(a=a.length>e?a.substring(0,e):a,r.referrer=a);let t=o.utm_source||o.wzrk_source;void 0!==t&&(t=t.length>e?t.substring(0,e):t,r.us=t);let i=o.utm_medium||o.wzrk_medium;void 0!==i&&(i=i.length>e?i.substring(0,e):i,r.um=i);let n=o.utm_campaign||o.wzrk_campaign;if(void 0!==n&&(n=n.length>e?n.substring(0,e):n,r.uc=n),void 0!==o.wzrk_medium){const e=o.wzrk_medium;e.match(/^email$|^social$|^search$/)&&(r.wm=e)}}r=i(this,xo)[xo].addSystemDataToObject(r,void 0),r.cpg=t,r.WZRK_CAMP=it();let l=i(this,ko)[ko].dataPostURL;i(this,xo)[xo].addFlags(r),1===parseInt(r.pg)&&i(this,jo)[jo](r),l=Ve(l,"type","page"),l=Ve(l,"d",Ke(JSON.stringify(r),i(this,bo)[bo])),i(this,xo)[xo].saveAndFireRequest(l,le.blockRequest),1===parseInt(r.pg)&&this.event.push(K,{t:4}),i(this,Io)[Io]=t,setTimeout((()=>{s<=3&&i(this,To)[To](),i(this,Ro)[Ro]()&&setInterval((()=>{i(this,To)[To]()}),3e5)}),12e4)}_isPersonalisationActive(){return ae._isLocalStorageSupported()&&this.enablePersonalization}set popupCallback(e){this.popupCallbacks[this.popupCurrentWzrkId]=e}sendLocationData(e){let t={af:{}};const o={};if(t.type="profile",null==o.tz&&(o.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),t.profile=o,e){Object.keys(e).forEach((i=>{t.af[i]=e[i]}))}le.location&&(t.af={...t.af,...le.location}),t=i(this,xo)[xo].addSystemDataToObject(t,!0),i(this,xo)[xo].addFlags(t);const n=Ke(JSON.stringify(t),i(this,bo)[bo]);let s=i(this,ko)[ko].dataPostURL;s=Ve(s,"type",A),s=Ve(s,"d",n),i(this,xo)[xo].saveAndFireRequest(s,le.blockRequest)}setOffline(e){"boolean"==typeof e?(le.offline=e,e||i(this,xo)[xo].processBackupEvents()):console.error("setOffline should be called with a value of type boolean")}defineVariable(e,t){return io.define(e,t,i(this,Po)[Po])}syncVariables(e,t){if(4===i(this,bo)[bo].logLevel)return i(this,Po)[Po].syncVariables(e,t);{const e="App log level is not set to 4";return i(this,bo)[bo].error(e),Promise.reject(new Error(e))}}fetchVariables(e){i(this,Po)[Po].fetchVariables(e)}addVariablesChangedCallback(e){i(this,Po)[Po].addVariablesChangedCallback(e)}addOneTimeVariablesChangedCallback(e){i(this,Po)[Po].addOneTimeVariablesChangedCallback(e)}}(window.clevertap);return window.clevertap=window.wizrocket=Vo,Vo})); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).clevertap=t()}(this,(function(){"use strict";var e=0;function t(t){return"__private_"+e+++"_"+t}function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}const o="clevertap-prod.com",n="https:";var s=t("accountId"),r=t("region"),a=t("targetDomain"),l=t("dcSdkversion"),c=t("token");class d{constructor(){let{id:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";Object.defineProperty(this,s,{writable:!0,value:void 0}),Object.defineProperty(this,r,{writable:!0,value:""}),Object.defineProperty(this,a,{writable:!0,value:o}),Object.defineProperty(this,l,{writable:!0,value:""}),Object.defineProperty(this,c,{writable:!0,value:""}),this.id=e,t&&(this.region=t),i&&(this.targetDomain=i),n&&(this.token=n)}get id(){return i(this,s)[s]}set id(e){i(this,s)[s]=e}get region(){return i(this,r)[r]}set region(e){i(this,r)[r]=e}get dcSDKVersion(){return i(this,l)[l]}set dcSDKVersion(e){i(this,l)[l]=e}get targetDomain(){return i(this,a)[a]}set targetDomain(e){i(this,a)[a]=e}get token(){return i(this,c)[c]}set token(e){i(this,c)[c]=e}get finalTargetDomain(){return this.region?"".concat(this.region,".").concat(this.targetDomain):this.targetDomain===o?"".concat("eu1",".").concat(this.targetDomain):this.targetDomain}get dataPostPEURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/defineVars")}get dataPostURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/a?t=96")}get recorderURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/r?r=1")}get emailURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/e?r=1")}}const h=new RegExp("^\\s+|\\.|:|\\$|'|\"|\\\\|\\s+$","g"),u=new RegExp("^\\s+|'|\"|\\\\|\\s+$","g"),p=new RegExp("'","g"),g="clear",f="Charged ID",v="WZRK_CHARGED_ID",b="WZRK_G",m="WZRK_K",y="WZRK_CAMP",w="WZRK_CAMP_G",C="WZRK_EV",k="WZRK_META",x="WZRK_PR",P="WZRK_ARP",S="WZRK_L",I="global",O="optOut",_="useIP",E="WZRK_X",A="push",L=31536e3,M="wzrk_",T="wzrk_id",R="Notification Viewed",j="Notification Clicked",D="WZRK_FPU",z="WZRK_PSD",B="$incr",N="$add",F="$remove",U="$delete",q="WZRK_INBOX_CONFIG",V="WZRK_INBOX",W=1e3,K="wzrk_fetch",G=["Stayed","UTM Visited","App Launched","Notification Sent",R,j],H=e=>"string"==typeof e||e instanceof String,J=e=>"[object Object]"===Object.prototype.toString.call(e),Z=e=>"object"==typeof e&&e instanceof Date,$=e=>{for(const t in e)if(e.hasOwnProperty(t))return!1;return!0},Y=e=>!isNaN(parseFloat(e))&&isFinite(e),Q=e=>/^-?[\d.]+(?:e-?\d+)?$/.test(e)&&"number"==typeof e,X=e=>null!=e&&"undefined"!==e,ee=(e,t)=>{if("object"!=typeof e){let i;return H(e)?(i=te(e,u),i.length>1024&&(i=i.substring(0,1024),t.reportError(521,i+"... length exceeded 1024 chars. Trimmed."))):i=e,i}for(const i in e)if(e.hasOwnProperty(i)){const o=ee(e[i],t);let n;n=te(i,h),n.length>1024&&(n=n.substring(0,1024),t.reportError(520,n+"... length exceeded 1024 chars. Trimmed.")),delete e[i],e[n]=o}return e},te=(e,t)=>e.replace(t,""),ie=()=>{const e=new Date;return e.getFullYear()+""+e.getMonth()+e.getDay()},oe=()=>Math.floor((new Date).getTime()/1e3),ne=e=>"$D_"+Math.round(e.getTime()/1e3),se=e=>{if(re(e))return"$D_"+e},re=e=>{const t=/^(\d{4})(\d{2})(\d{2})$/.exec(e);if(null==t)return!1;const i=t[3],o=t[2]-1,n=t[1],s=new Date(n,o,i);return s.getDate()==i&&s.getMonth()==o&&s.getFullYear()==n};class ae{static save(e,t){return!(!e||!t)&&(this._isLocalStorageSupported()?(localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),!0):void 0)}static read(e){if(!e)return!1;let t=null;if(this._isLocalStorageSupported()&&(t=localStorage.getItem(e)),null!=t)try{t=JSON.parse(t)}catch(e){}return t}static remove(e){return!!e&&(this._isLocalStorageSupported()?(localStorage.removeItem(e),!0):void 0)}static removeCookie(e,t){let i=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";t&&(i=i+" domain="+t+"; path=/"),document.cookie=i}static createCookie(e,t,i,o){let n="",s="";if(i){const e=new Date;e.setTime(e.getTime()+1e3*i),n="; expires="+e.toGMTString()}o&&(s="; domain="+o),t=encodeURIComponent(t),document.cookie=e+"="+t+n+s+"; path=/"}static readCookie(e){const t=e+"=",i=document.cookie.split(";");for(let e=0;e=0;o--){if(a=0===o?r[o]+a:"."+r[o]+a,this.readCookie(e)){var n="test_"+e+o;if(this.createCookie(n,t,10,a),!this.readCookie(n))continue;this.removeCookie(n,a)}this.createCookie(e,t,i,a);if(this.readCookie(e)==t){s=a,le.broadDomain=s;break}}}else this.createCookie(e,t,i,s)}else this.createCookie(e,t,i,o)}static getMetaProp(e){const t=this.readFromLSorCookie(k);if(null!=t)return t[e]}static setMetaProp(e,t){if(this._isLocalStorageSupported()){let i=this.readFromLSorCookie(k);null==i&&(i={}),void 0===t?delete i[e]:i[e]=t,this.saveToLSorCookie(k,i)}}static getAndClearMetaProp(e){const t=this.getMetaProp(e);return this.setMetaProp(e,void 0),t}static setInstantDeleteFlagInK(){let e=this.readFromLSorCookie(m);null==e&&(e={}),e.flag=!0,this.saveToLSorCookie(m,e)}static backupEvent(e,t,i){let o=this.readFromLSorCookie(S);void 0===o&&(o={}),o[t]={q:e},this.saveToLSorCookie(S,o),i.debug("stored in ".concat(S," reqNo : ").concat(t," -> ").concat(e))}static removeBackup(e,t){const i=this.readFromLSorCookie(S);null!=i&&void 0!==i[e]&&(t.debug("del event: ".concat(e," data-> ").concat(i[e].q)),delete i[e],this.saveToLSorCookie(S,i))}}const le={globalCache:{gcookie:null,REQ_N:0,RESP_N:0},LRU_CACHE:null,globalProfileMap:void 0,globalEventsMap:void 0,blockRequest:!1,isOptInRequest:!1,broadDomain:null,webPushEnabled:null,campaignDivMap:{},currentSessionId:null,wiz_counter:0,notifApi:{notifEnabledFromApi:!1},unsubGroups:[],updatedCategoryLong:null,inbox:null,isPrivacyArrPushed:!1,privacyArray:[],offline:!1,location:null,dismissSpamControl:!1,globalUnsubscribe:!0,flutterVersion:null,variableStore:{}};var ce=t("keyOrder"),de=t("deleteFromObject");class he{constructor(e){Object.defineProperty(this,de,{value:ue}),Object.defineProperty(this,ce,{writable:!0,value:void 0}),this.max=e;let t=ae.readFromLSorCookie(E);if(t){const e={};i(this,ce)[ce]=[],t=t.cache;for(const o in t)t.hasOwnProperty(o)&&(e[t[o][0]]=t[o][1],i(this,ce)[ce].push(t[o][0]));this.cache=e}else this.cache={},i(this,ce)[ce]=[]}get(e){const t=this.cache[e];return t&&(this.cache=i(this,de)[de](e,this.cache),this.cache[e]=t,i(this,ce)[ce].push(e)),this.saveCacheToLS(this.cache),t}set(e,t){const o=this.cache[e],n=i(this,ce)[ce];null!=o?this.cache=i(this,de)[de](e,this.cache):n.length===this.max&&(this.cache=i(this,de)[de](n[0],this.cache)),this.cache[e]=t,i(this,ce)[ce][i(this,ce)[ce]-1]!==e&&i(this,ce)[ce].push(e),this.saveCacheToLS(this.cache)}saveCacheToLS(e){const t=[],o=i(this,ce)[ce];for(const i in o)if(o.hasOwnProperty(i)){const n=[];n.push(o[i]),n.push(e[o[i]]),t.push(n)}ae.saveToLSorCookie(E,{cache:t})}getKey(e){if(null===e)return null;const t=i(this,ce)[ce];for(const i in t)if(t.hasOwnProperty(i)&&this.cache[t[i]]===e)return t[i];return null}getSecondLastKey(){const e=i(this,ce)[ce];return null!=e&&e.length>1?e[e.length-2]:-1}getLastKey(){const e=i(this,ce)[ce].length;if(e)return i(this,ce)[ce][e-1]}}var ue=function(e,t){const o=JSON.parse(JSON.stringify(i(this,ce)[ce])),n={};let s;for(const i in o)o.hasOwnProperty(i)&&(o[i]!==e?n[o[i]]=t[o[i]]:s=i);return o.splice(s,1),i(this,ce)[ce]=JSON.parse(JSON.stringify(o)),n},pe=t("logger"),ge=t("request"),fe=t("device"),ve=t("session");class be{constructor(e){let{logger:t,request:o,device:n,session:s}=e;Object.defineProperty(this,pe,{writable:!0,value:void 0}),Object.defineProperty(this,ge,{writable:!0,value:void 0}),Object.defineProperty(this,fe,{writable:!0,value:void 0}),Object.defineProperty(this,ve,{writable:!0,value:void 0}),i(this,pe)[pe]=t,i(this,ge)[ge]=o,i(this,fe)[fe]=n,i(this,ve)[ve]=s}s(e,t,o,n,s){let r=!1,a=!1;if(window.isOULInProgress&&(o||"undefined"!==n&&n===window.oulReqN)&&(window.isOULInProgress=!1,r=!0),void 0===n&&(n=0),ae.removeBackup(n,i(this,pe)[pe]),n>le.globalCache.REQ_N)return;if(X(i(this,fe)[fe].gcookie)||e&&(a=!0),!X(i(this,fe)[fe].gcookie)||o||"boolean"==typeof s){const n=i(this,ve)[ve].getSessionCookieObject();if(window.isOULInProgress||n.s&&t{if(J(e)){for(var t in e)if(e.hasOwnProperty(t)){if(J(e[t])||Array.isArray(e[t]))return!1;Z(e[t])&&(e[t]=ne(e[t]))}return!0}return!1},Re=(e,t)=>{if(J(e)){for(var i in e)if(e.hasOwnProperty(i))if("Items"===i){if(!Array.isArray(e[i]))return!1;for(var o in e[i].length>50&&t.reportError(522,"Charged Items exceed 50 limit. Actual count: "+e[i].length),e[i])if(e[i].hasOwnProperty(o)&&(!J(e[i][o])||!Te(e[i][o])))return!1}else{if(J(e[i])||Array.isArray(e[i]))return!1;Z(e[i])&&(e[i]=ne(e[i]))}if(H(e[f])||Q(e[f])){const i=e[f]+"";if(void 0===Me&&(Me=ae.readFromLSorCookie(v)),void 0!==Me&&Me.trim()===i.trim())return t.error("Duplicate charged Id - Dropped"+e),!1;Me=i,ae.saveToLSorCookie(v,i)}return!0}return!1};var je=t("logger"),De=t("oldValues"),ze=t("request"),Be=t("isPersonalisationActive"),Ne=t("processEventArray");class Fe extends Array{constructor(e,t){let{logger:o,request:n,isPersonalisationActive:s}=e;super(),Object.defineProperty(this,Ne,{value:Ue}),Object.defineProperty(this,je,{writable:!0,value:void 0}),Object.defineProperty(this,De,{writable:!0,value:void 0}),Object.defineProperty(this,ze,{writable:!0,value:void 0}),Object.defineProperty(this,Be,{writable:!0,value:void 0}),i(this,je)[je]=o,i(this,De)[De]=t,i(this,ze)[ze]=n,i(this,Be)[Be]=s}push(){for(var e=arguments.length,t=new Array(e),o=0;o0;){var t=e.shift();if(!H(t)){i(this,je)[je].error(xe);continue}if(t.length>1024&&(t=t.substring(0,1024),i(this,je)[je].reportError(510,t+"... length exceeded 1024 chars. Trimmed.")),G.includes(t)){i(this,je)[je].reportError(513,t+" is a restricted system event. It cannot be used as an event name.");continue}const o={type:"event"};if(o.evtName=te(t,h),0!==e.length){const n=e.shift();if(J(n)){if("Charged"===t){if(!Re(n,i(this,je)[je])){i(this,je)[je].reportError(511,"Charged event structure invalid. Not sent.");continue}}else if(!Te(n)){i(this,je)[je].reportError(512,t+" event structure invalid. Not sent.");continue}o.evtData=n}else e.unshift(n)}i(this,ze)[ze].processEvent(o)}};const qe=e=>{const t={},i=e.indexOf("?");if(i>1){const o=e.substring(i+1);let n;const s=/\+/g,r=/([^&=]+)=?([^&]*)/g,a=function(e){let t=e.replace(s," ");try{t=decodeURIComponent(t)}catch(e){}return t};for(n=r.exec(o);n;)t[a(n[1])]=a(n[2]),n=r.exec(o)}return t},Ve=(e,t,i)=>e+"&"+t+"="+encodeURIComponent(i),We=()=>window.location.hostname,Ke=(e,t)=>(t&&"function"==typeof t.debug&&t.debug("dobj:"+e),He(e)),Ge=(()=>{let e="",t=0;for(t=0;t<=25;t++)e+=String.fromCharCode(t+65);for(t=0;t<=25;t++)e+=String.fromCharCode(t+97);for(t=0;t<10;t++)e+=t;return e+"+/="})(),He=e=>{if(null==e)return"";var t,i,o,n,s,r,a,l="",c=0;for(e=(e=>{if(null==e)return"";let t,i,o,n={},s={},r="",a="",l="",c=2,d=3,h=2,u="",p=0,g=0,f=String.fromCharCode;for(o=0;o>=1}else{for(i=1,t=0;t>=1}c--,0==c&&(c=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;c--,0==c&&(c=Math.pow(2,h),h++),n[a]=d++,l=String(r)}if(""!==l){if(Object.prototype.hasOwnProperty.call(s,l)){if(l.charCodeAt(0)<256){for(t=0;t>=1}else{for(i=1,t=0;t>=1}c--,0==c&&(c=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;c--,0==c&&(c=Math.pow(2,h),h++)}for(i=2,t=0;t>=1;for(;;){if(p<<=1,15==g){u+=f(p);break}g++}return u})(e);c<2*e.length;)c%2==0?(t=e.charCodeAt(c/2)>>8,i=255&e.charCodeAt(c/2),o=c/2+1>8:NaN):(t=255&e.charCodeAt((c-1)/2),(c+1)/2>8,o=255&e.charCodeAt((c+1)/2)):i=o=NaN),c+=3,n=t>>2,s=(3&t)<<4|i>>4,r=(15&i)<<2|o>>6,a=63&o,isNaN(i)?r=a=64:isNaN(o)&&(a=64),l=l+Ge.charAt(n)+Ge.charAt(s)+Ge.charAt(r)+Ge.charAt(a);return l};var Je=t("fireRequest"),Ze=t("dropRequestDueToOptOut"),$e=t("addUseIPToRequest"),Ye=t("addARPToRequest");class Qe{constructor(){this.networkRetryCount=0,this.minDelayFrequency=0}static fireRequest(e,t,o,n){i(this,Je)[Je](e,1,t,o,n)}getDelayFrequency(){if(this.logger.debug("Network retry #"+this.networkRetryCount),this.networkRetryCount<10)return this.logger.debug(this.account.id,"Failure count is "+this.networkRetryCount+". Setting delay frequency to 1s"),this.minDelayFrequency=W,this.minDelayFrequency;if(null==this.account.region)return this.logger.debug(this.account.id,"Setting delay frequency to 1s"),W;{const e=1e3*(Math.floor(10*Math.random())+1);return this.minDelayFrequency+=e,this.minDelayFrequency<6e5?(this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency):(this.minDelayFrequency=W,this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency)}}}Qe.logger=void 0,Qe.device=void 0,Qe.account=void 0,Object.defineProperty(Qe,Je,{value:function(e,t,o,n,s){var r,a;if(i(this,Ze)[Ze]())return void this.logger.debug("req dropped due to optout cookie: "+this.device.gcookie);if(X(this.device.gcookie)||(le.blockRequest=!0),s&&s===K)!X(this.device.gcookie)&&le.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(this.networkRetryCount)),i(this,Je)[Je](e,void 0,o,n)}),this.getDelayFrequency());else if(!X(this.device.gcookie)&&le.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(t)),i(this,Je)[Je](e,t+1,o,n)}),50);if(n?window.isOULInProgress=!0:(X(this.device.gcookie)&&(e=Ve(e,"gc",this.device.gcookie)),e=i(this,Ye)[Ye](e,o)),e=Ve(e,"tries",t),e=i(this,$e)[$e](e),e=Ve(e,"r",(new Date).getTime()),(null===(r=window.clevertap)||void 0===r?void 0:r.hasOwnProperty("plugin"))||(null===(a=window.wizrocket)||void 0===a?void 0:a.hasOwnProperty("plugin"))){const t=window.clevertap.plugin||window.wizrocket.plugin;e=Ve(e,"ct_pl",t)}-1!==e.indexOf("chrome-extension:")&&(e=e.replace("chrome-extension:","https:"));for(var l=document.getElementsByClassName("ct-jp-cb");l[0]&&l[0].parentNode;)l[0].parentNode.removeChild(l[0]);const c=document.createElement("script");c.setAttribute("type","text/javascript"),c.setAttribute("src",e),c.setAttribute("class","ct-jp-cb"),c.setAttribute("rel","nofollow"),c.async=!0,document.getElementsByTagName("head")[0].appendChild(c),this.logger.debug("req snt -> url: "+e)}}),Object.defineProperty(Qe,Ze,{value:function(){return!le.isOptInRequest&&X(this.device.gcookie)&&H(this.device.gcookie)?":OO"===this.device.gcookie.slice(-3):(le.isOptInRequest=!1,!1)}}),Object.defineProperty(Qe,$e,{value:function(e){var t=ae.getMetaProp(_);return"boolean"!=typeof t&&(t=!1),Ve(e,_,t?"true":"false")}}),Object.defineProperty(Qe,Ye,{value:function(e,t){if(!0===t){const t={skipResARP:!0};return Ve(e,"arp",Ke(JSON.stringify(t),this.logger))}return ae._isLocalStorageSupported()&&void 0!==localStorage.getItem(P)&&null!==localStorage.getItem(P)?Ve(e,"arp",Ke(JSON.stringify(ae.readFromLSorCookie(P)),this.logger)):e}});const Xe=()=>{let e={};if(ae._isLocalStorageSupported()){let t=ae.read(y);null!=t?(t=JSON.parse(decodeURIComponent(t).replace(p,'"')),t.hasOwnProperty("global")?e.wp=t:e=t):e={}}return e},et=e=>{if(ae._isLocalStorageSupported()){const t={...Xe(),...e},i=JSON.stringify(t);ae.save(y,encodeURIComponent(i)),tt()}},tt=()=>{if(ae._isLocalStorageSupported()){let i=ae.read(b);if(X(i))try{i=JSON.parse(decodeURIComponent(ae.read(b)));const o=ae.read(w)?JSON.parse(decodeURIComponent(ae.read(w))):{};if(i&&ae._isLocalStorageSupported()){var e={},t=Xe();Object.keys(t).forEach((n=>{const s=i in o&&Object.keys(o[i]).length&&o[i][n]?o[i][n]:{},r=t[n].global,a=ie(),l=t[n][a];if(void 0!==r){const e=Object.keys(r);for(const t in e){let i=[];if(e.hasOwnProperty(t)){let o=0,n=0;const a=e[t];if("tc"===a)continue;void 0!==l&&void 0!==l[a]&&(o=l[a]),void 0!==r&&void 0!==r[a]&&(n=r[a]),i=[a,o,n],s[a]=i}}}e={...e,[n]:s}})),o[i]=e,ae.save(w,encodeURIComponent(JSON.stringify(o)))}}catch(e){console.error("Invalid clevertap Id "+e)}}},it=()=>{const e=JSON.parse(decodeURIComponent(ae.read(b)));let t={};if(ae._isLocalStorageSupported()){let i={};t=Xe();const o=ae.read(w),n=o?decodeURIComponent(o):null,s=n?JSON.parse(n):null,r=e&&null!=o&&s&&s[e]&&s[e].wp?Object.values(s[e].wp):[],a=e&&null!=o&&s&&s[e]&&s[e].wi?Object.values(s[e].wi):[],l=ie();let c=0,d=0;return t.wp&&t.wp[l]&&"undefined"!==t.wp[l].tc&&(c=t.wp[l].tc),t.wi&&t.wi[l]&&"undefined"!==t.wi[l].tc&&(d=t.wi[l].tc),i={wmp:c,wimp:d,tlc:r,witlc:a},i}},ot=(e,t)=>{let{logger:i}=t,o=!1;if(J(e))for(const t in e)if(e.hasOwnProperty(t)){o=!0;let n=e[t];if(null==n){delete e[t];continue}"Gender"!==t||n.match(/^M$|^F$/)||(o=!1,i.error(Pe)),"Employed"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Se)),"Married"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Ie)),"Education"!==t||n.match(/^School$|^College$|^Graduate$/)||(o=!1,i.error(Oe)),"Age"===t&&null!=n&&(Y(n)?e.Age=+n:(o=!1,i.error(_e))),"DOB"===t?(/^\$D_/.test(n)&&11===(n+"").length||Z(n)||(o=!1,i.error(Ee)),Z(n)&&(e[t]=ne(n))):Z(n)&&(e[t]=ne(n)),"Phone"!==t||$(n)||(n.length>8&&"+"===n.charAt(0)?(n=n.substring(1,n.length),Y(n)?e.Phone=+n:(o=!1,i.error(Le+". Removed."))):(o=!1,i.error(Le+". Removed."))),o||delete e[t]}return o},nt=e=>{const t={};t.Name=e.name,null!=e.id&&(t.FBID=e.id+""),"male"===e.gender?t.Gender="M":"female"===e.gender?t.Gender="F":t.Gender="O";null!=e.relationship_status&&(t.Married="N","Married"===e.relationship_status&&(t.Married="Y"));const i=function(e){if(null!=e){let t="",i="";for(let o=0;o0?"Y":"N",null!=e.email&&(t.Email=e.email),null!=e.birthday){const i=e.birthday.split("/");t.DOB=se(i[2]+i[0]+i[1])}return t},st=(e,t)=>{let{logger:i}=t;const o={};if(null!=e.displayName&&(o.Name=e.displayName),null!=e.id&&(o.GPID=e.id+""),null!=e.gender&&("male"===e.gender?o.Gender="M":"female"===e.gender?o.Gender="F":"other"===e.gender&&(o.Gender="O")),null!=e.image&&!1===e.image.isDefault&&(o.Photo=e.image.url.split("?sz")[0]),null!=e.emails)for(let t=0;t{if(ae._isLocalStorageSupported()){if(null==le.globalProfileMap&&(le.globalProfileMap=ae.readFromLSorCookie(x),null==le.globalProfileMap&&(le.globalProfileMap={})),null!=e._custom){const t=e._custom;for(const i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);delete e._custom}for(const i in e)if(e.hasOwnProperty(i)){if(le.globalProfileMap.hasOwnProperty(i)&&!t)continue;le.globalProfileMap[i]=e[i]}null!=le.globalProfileMap._custom&&delete le.globalProfileMap._custom,ae.saveToLSorCookie(x,le.globalProfileMap)}},at=(e,t,i)=>{if(null!=e&&"-1"!==e&&ae._isLocalStorageSupported()){const t=Xe();let o=t.wp[i];null==o&&(o={},t[i]=o),o[e]="dnd",et(t)}if(null!=le.campaignDivMap){const t=le.campaignDivMap[e];null!=t&&(document.getElementById(t).style.display="none","intentPreview"===t&&null!=document.getElementById("intentOpacityDiv")&&(document.getElementById("intentOpacityDiv").style.display="none"))}};var lt=t("logger"),ct=t("request"),dt=t("account"),ht=t("oldValues"),ut=t("isPersonalisationActive"),pt=t("processProfileArray");class gt extends Array{constructor(e,t){let{logger:o,request:n,account:s,isPersonalisationActive:r}=e;super(),Object.defineProperty(this,pt,{value:ft}),Object.defineProperty(this,lt,{writable:!0,value:void 0}),Object.defineProperty(this,ct,{writable:!0,value:void 0}),Object.defineProperty(this,dt,{writable:!0,value:void 0}),Object.defineProperty(this,ht,{writable:!0,value:void 0}),Object.defineProperty(this,ut,{writable:!0,value:void 0}),i(this,lt)[lt]=o,i(this,ct)[ct]=n,i(this,dt)[dt]=s,i(this,ht)[ht]=t,i(this,ut)[ut]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o0)for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];let n,s={};if(null!=o.Site){if(n=o.Site,$(n)||!ot(n,{logger:i(this,lt)[lt]}))return}else if(null!=o.Facebook){const e=o.Facebook;$(e)||e.error||(n=nt(e))}else if(null!=o["Google Plus"]){const e=o["Google Plus"];$(e)||e.error||(n=st(e,{logger:i(this,lt)[lt]}))}if(null!=n&&!$(n)){s.type="profile",null==n.tz&&(n.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),s.profile=n,rt(n,!0),s=i(this,ct)[ct].addSystemDataToObject(s,void 0),i(this,ct)[ct].addFlags(s);const e=Ke(JSON.stringify(s),i(this,lt)[lt]);let t=i(this,dt)[dt].dataPostURL;t=Ve(t,"type",A),t=Ve(t,"d",e),i(this,ct)[ct].saveAndFireRequest(t,le.blockRequest)}}},vt=t("request"),bt=t("logger"),mt=t("account"),yt=t("session"),wt=t("oldValues"),Ct=t("device"),kt=t("processOUL"),xt=t("handleCookieFromCache"),Pt=t("deleteUser"),St=t("processLoginArray");class It extends Array{constructor(e,t){let{request:o,account:n,session:s,logger:r,device:a}=e;super(),Object.defineProperty(this,St,{value:At}),Object.defineProperty(this,Pt,{value:Et}),Object.defineProperty(this,xt,{value:_t}),Object.defineProperty(this,kt,{value:Ot}),Object.defineProperty(this,vt,{writable:!0,value:void 0}),Object.defineProperty(this,bt,{writable:!0,value:void 0}),Object.defineProperty(this,mt,{writable:!0,value:void 0}),Object.defineProperty(this,yt,{writable:!0,value:void 0}),Object.defineProperty(this,wt,{writable:!0,value:void 0}),Object.defineProperty(this,Ct,{writable:!0,value:void 0}),i(this,vt)[vt]=o,i(this,mt)[mt]=n,i(this,yt)[yt]=s,i(this,bt)[bt]=r,i(this,wt)[wt]=t,i(this,Ct)[Ct]=a}clear(){i(this,bt)[bt].debug("clear called. Reset flag has been set."),i(this,Pt)[Pt](),ae.setMetaProp(g,!0)}push(){for(var e=arguments.length,t=new Array(e),o=0;o{let o=ae.readFromLSorCookie(m);const n=ae.readFromLSorCookie(b);let s;if(null==o)o={},s=e;else{s=o.id;let r=!1,a=!1;if(null==s&&(s=e[0],r=!0),null==le.LRU_CACHE&&ae._isLocalStorageSupported()&&(le.LRU_CACHE=new he(100)),r)null!=n&&(le.LRU_CACHE.set(s,n),le.blockRequest=!1);else for(const t in e)if(e.hasOwnProperty(t)){const i=e[t];if(le.LRU_CACHE.cache[i]){s=i,a=!0;break}}if(a){s!==le.LRU_CACHE.getLastKey()?i(this,xt)[xt]():(t=!1,ae.saveToLSorCookie(D,t));const e=le.LRU_CACHE.get(s);le.LRU_CACHE.set(s,e),ae.saveToLSorCookie(b,e),i(this,Ct)[Ct].gcookie=e;const o=le.LRU_CACHE.getSecondLastKey();if(ae.readFromLSorCookie(D)&&-1!==o){const e=le.LRU_CACHE.cache[o];i(this,vt)[vt].unregisterTokenForGuid(e)}}else r?null!=n&&(i(this,Ct)[Ct].gcookie=n,ae.saveToLSorCookie(b,n),t=!1):this.clear(),ae.saveToLSorCookie(D,!1),s=e[0]}o.id=s,ae.saveToLSorCookie(m,o)};if(Array.isArray(e)&&e.length>0)for(const n in e)if(e.hasOwnProperty(n)){const s=e[n];let r,a={};if(null!=s.Site){if(r=s.Site,$(r)||!ot(r,{logger:i(this,bt)[bt]}))return}else if(null!=s.Facebook){const e=s.Facebook;$(e)||e.error||(r=nt(e))}else if(null!=s["Google Plus"]){const e=s["Google Plus"];$(e)&&!e.error&&(r=st(e,{logger:i(this,bt)[bt]}))}if(null!=r&&!$(r)){a.type="profile",null==r.tz&&(r.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),a.profile=r;const e=[];ae._isLocalStorageSupported()&&(r.Identity&&e.push(r.Identity),r.Email&&e.push(r.Email),r.GPID&&e.push("GP:"+r.GPID),r.FBID&&e.push("FB:"+r.FBID),e.length>0&&o(e)),rt(r,!0),a=i(this,vt)[vt].addSystemDataToObject(a,void 0),i(this,vt)[vt].addFlags(a),t&&(a.isOUL=!0);const n=Ke(JSON.stringify(a),i(this,bt)[bt]);let s=i(this,mt)[mt].dataPostURL;s=Ve(s,"type",A),s=Ve(s,"d",n),i(this,vt)[vt].saveAndFireRequest(s,le.blockRequest,t)}}},_t=function(){le.blockRequest=!1,console.debug("Block request is false"),ae._isLocalStorageSupported()&&(delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),ae.removeCookie(y,We()),ae.removeCookie(i(this,yt)[yt].cookieName,le.broadDomain),ae.removeCookie(P,le.broadDomain),i(this,yt)[yt].setSessionCookieObject("")},Et=function(){le.blockRequest=!0,i(this,bt)[bt].debug("Block request is true"),le.globalCache={gcookie:null,REQ_N:0,RESP_N:0},ae._isLocalStorageSupported()&&(delete localStorage.WZRK_G,delete localStorage.WZRK_K,delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),ae.removeCookie(b,le.broadDomain),ae.removeCookie(y,We()),ae.removeCookie(m,We()),ae.removeCookie(i(this,yt)[yt].cookieName,le.broadDomain),ae.removeCookie(P,le.broadDomain),i(this,Ct)[Ct].gcookie=null,i(this,yt)[yt].setSessionCookieObject("")},At=function(e){if(Array.isArray(e)&&e.length>0){const t=e.pop();if(null!=t&&J(t)&&(null!=t.Site&&Object.keys(t.Site).length>0||null!=t.Facebook&&Object.keys(t.Facebook).length>0||null!=t["Google Plus"]&&Object.keys(t["Google Plus"]).length>0)){ae.setInstantDeleteFlagInK();try{i(this,kt)[kt]([t])}catch(e){i(this,bt)[bt].debug(e)}}else i(this,bt)[bt].error("Profile object is in incorrect format")}};class Lt extends HTMLElement{constructor(){super(),this._details=null,this.shadow=null,this.shadow=this.attachShadow({mode:"open"})}get details(){return this._details||""}set details(e){null===this._details&&(this._details=e,this.renderBanner())}renderBanner(){this.shadow.innerHTML=this.getBannerContent(),!1!==this.trackClick&&this.addEventListener("click",(()=>{const e=this.details.onClick;e&&(this.details.window?window.open(e,"_blank"):window.parent.location.href=e),window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId})}getBannerContent(){return'\n \n \n ")}}class Mt extends HTMLElement{constructor(){super(),this._target=null,this._carousel=null,this.shadow=null,this.slides=0,this.previouslySelectedItem=-1,this.selectedItem=1,this.autoSlide=null,this.stopAutoSlideTimeout=null,this.shadow=this.attachShadow({mode:"open"}),void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Lt)}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderCarousel())}get details(){return this.target.display.details}get display(){return this.target.display}renderCarousel(){this.slides=this.details.length,this.shadow.innerHTML=this.getStyles();const e=this.getCarouselContent();this.display.showNavBtns&&e.insertAdjacentHTML("beforeend",this.display.navBtnsHtml),this.display.showNavArrows&&(e.insertAdjacentHTML("beforeend",this.display.leftNavArrowHtml),e.insertAdjacentHTML("beforeend",this.display.rightNavArrowHtml)),this._carousel=e,this.shadow.appendChild(e),this.setupClick(),this.updateSelectedItem(),this.startAutoSlide(),this.setupOnHover(),window.clevertap.renderNotificationViewed({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot})}setupClick(){this._carousel.addEventListener("click",(e=>{const t=e.target.id;if(t.startsWith("carousel__button")){const e=+t.split("-")[1];e!==this.selectedItem&&(this.previouslySelectedItem=this.selectedItem,this.selectedItem=e,this.updateSelectedItem(),this.startAutoSlide())}else if(t.startsWith("carousel__arrow"))t.endsWith("right")?this.goToNext():this.goToPrev(),this.startAutoSlide();else if(t.indexOf("-")>-1){const e=+t.split("-")[1],i=e-1;window.parent.clevertap&&window.clevertap.renderNotificationClicked({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot,wzrk_slideNo:e});const o=this.details[i].onClick;""!==o&&(this.details[i].window?window.open(o,"_blank"):window.location.href=o)}}))}setupOnHover(){this._carousel.addEventListener("mouseenter",(e=>{this.stopAutoSlideTimeout=setTimeout((()=>{this.autoSlide=clearInterval(this.autoSlide)}),500)})),this._carousel.addEventListener("mouseleave",(e=>{clearTimeout(this.stopAutoSlideTimeout),void 0===this.autoSlide&&this.startAutoSlide()}))}getCarouselContent(){const e=document.createElement("div");return e.setAttribute("class","carousel"),this.details.forEach(((t,i)=>{const o=document.createElement("ct-web-personalisation-banner");o.classList.add("carousel__item"),o.trackClick=!1,o.setAttribute("id","carousel__item-".concat(i+1)),o.details=t,e.appendChild(o)})),e}getStyles(){var e,t;return"\n \n ")}updateSelectedItem(){if(-1!==this.previouslySelectedItem){const e=this.shadow.getElementById("carousel__item-".concat(this.previouslySelectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.previouslySelectedItem));e.classList.remove("carousel__item--selected"),t&&t.classList.remove("carousel__button--selected")}const e=this.shadow.getElementById("carousel__item-".concat(this.selectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.selectedItem));e.classList.add("carousel__item--selected"),t&&t.classList.add("carousel__button--selected")}startAutoSlide(){clearInterval(this.autoSlide),this.autoSlide=setInterval((()=>{this.goToNext()}),this.display.sliderTime?1e3*this.display.sliderTime:3e3)}goToNext(){this.goTo(this.selectedItem,(this.selectedItem+1)%this.slides)}goToPrev(){this.goTo(this.selectedItem,this.selectedItem-1)}goTo(e,t){this.previouslySelectedItem=e,this.selectedItem=t,0===t&&(this.selectedItem=this.slides),this.updateSelectedItem()}}class Tt extends HTMLElement{constructor(){super(),this._target=null,this._session=null,this.shadow=null,this.popup=null,this.container=null,this.resizeObserver=null,this.shadow=this.attachShadow({mode:"open"})}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderImageOnlyPopup())}get session(){return this._session||""}set session(e){this._session=e}get msgId(){return this.target.wzrk_id}get pivotId(){return this.target.wzrk_pivot}get onClickUrl(){return this.target.display.onClickUrl}renderImageOnlyPopup(){const e=this.target.wzrk_id.split("_")[0],t=this.session.sessionId;this.shadow.innerHTML=this.getImageOnlyPopupContent(),this.popup=this.shadowRoot.getElementById("imageOnlyPopup"),this.container=this.shadowRoot.getElementById("container"),this.closeIcon=this.shadowRoot.getElementById("close"),this.popup.addEventListener("load",this.updateImageAndContainerWidth()),this.resizeObserver=new ResizeObserver((()=>this.handleResize(this.popup,this.container))),this.resizeObserver.observe(this.popup),this.closeIcon.addEventListener("click",(()=>{if(this.resizeObserver.unobserve(this.popup),document.getElementById("wzrkImageOnlyDiv").style.display="none",this.remove(),null!=e&&"-1"!==e&&ae._isLocalStorageSupported()){const i=Xe();let o=i.wp[t];null==o&&(o={},i[t]=o),o[e]="dnd",et(i)}})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId}),this.onClickUrl&&this.popup.addEventListener("click",(()=>{this.target.display.window?window.open(this.onClickUrl,"_blank"):window.parent.location.href=this.onClickUrl,window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})}))}handleResize(e,t){const i=this.getRenderedImageWidth(e);t.style.setProperty("width","".concat(i,"px"))}getImageOnlyPopupContent(){return"\n ".concat(this.target.msgContent.css,"\n ").concat(this.target.msgContent.html,"\n ")}updateImageAndContainerWidth(){return()=>{const e=this.getRenderedImageWidth(this.popup);this.popup.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("height","auto"),this.container.style.setProperty("position","fixed"),this.popup.style.setProperty("visibility","visible"),this.closeIcon.style.setProperty("visibility","visible"),document.getElementById("wzrkImageOnlyDiv").style.visibility="visible"}}getRenderedImageWidth(e){const t=e.naturalWidth/e.naturalHeight;return e.height*t}}class Rt extends HTMLElement{constructor(e,t){super(),this.wrapper=null,this.snackBar=null,this.shadow=this.attachShadow({mode:"open"}),this.config=e,this.message=t,this.renderMessage(t)}get pivotId(){return this.message.wzrk_pivot}get campaignId(){return this.message.wzrk_id}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}renderMessage(e){switch(this.wrapper=this.createEl("div","messageWrapper"),e.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":{const t=this.prepareBasicMessage(e.msg[0]);this.wrapper.appendChild(t)}}const t=this.createEl("div","timeStamp");if(t.innerHTML="".concat(Wt(e.id.split("_")[1]),""),!e.viewed){const e=this.createEl("span","unreadMarker");t.appendChild(e)}this.wrapper.appendChild(t),this.shadow.appendChild(this.wrapper)}prepareBasicMessage(e){const t=this.createEl("div","message");if(e.imageUrl){const i=this.addImage(e.imageUrl,"mainImg");t.appendChild(i)}const i=this.createEl("div","iconTitleDescWrapper");if(e.iconUrl){const t=this.addImage(e.iconUrl,"iconImg");i.appendChild(t)}const o=this.createEl("div","titleDescWrapper");if(e.title){const t=this.createEl("div","title");t.innerText=e.title,o.appendChild(t)}if(e.description){const t=this.createEl("div","description");t.innerText=e.description,o.appendChild(t)}if((e.title||e.description)&&i.appendChild(o),(e.iconUrl||e.title||e.description)&&t.appendChild(i),e.buttons&&e.buttons.length){const i=this.addButtons(e.buttons);t.appendChild(i)}return t}addButtons(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.createEl("div","buttonsContainer");let i=!1;return e.forEach(((e,o)=>{const n=this.createEl("button","button-".concat(o),"button");n.innerText=e.text,o>0&&(n.style.cssText+="margin-left: 2px;"),"copy"===e.action&&(i=!0),t.appendChild(n)})),i&&this.addSnackbar(t),t}addSnackbar(e){this.snackBar=this.createEl("div","snackbar-".concat(this.campaignId),"snackbar"),this.snackBar.innerHTML=Ht;const t=this.createEl("span","snackbar-msg-".concat(this.campaignId),"snackbar-msg");t.innerText="Copied to clipboard",this.snackBar.appendChild(t),e.appendChild(this.snackBar)}addImage(e,t){const i=this.createEl("div","".concat(t,"Container")),o=this.createEl("img",t);return o.setAttribute("src",e),o.setAttribute("loading","lazy"),i.appendChild(o),i}raiseClickedEvent(e,t){switch(this.message.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":this.raiseClickedForBasicTemplates(e,t)}}raiseClickedForBasicTemplates(e,t){const i=this.message.msg[0],o={msgId:this.campaignId,pivotId:this.pivotId};if("BUTTON"===e.tagName){const t=e.id.split("-")[1],n=i.buttons[t];o.kv={wzrk_c2a:n.text},"url"===n.action?n.openUrlInNewTab?window.open(n.url,"_blank"):window.location=n.url:"copy"===n.action&&(window.focus(),navigator.clipboard.writeText(n.clipboardText),this.snackBar.style.setProperty("display","flex","important"),setTimeout((()=>{this.snackBar.style.setProperty("display","none","important")}),2e3))}else"CT-INBOX-MESSAGE"===e.tagName&&i.onClickUrl&&(i.openUrlInNewTab?window.open(i.onClickUrl,"_blank"):window.location=i.onClickUrl);t?console.log("Notifiction clicked event will be raised at run time with payload ::",o):window.clevertap.renderNotificationClicked(o)}}class jt extends HTMLElement{constructor(e){super(),this.isInboxOpen=!1,this.isInboxFromFlutter=!1,this.selectedCategory=null,this.unviewedMessages={},this.unviewedCounter=0,this.isPreview=!1,this.inboxConfigForPreview={},this.inboxSelector=null,this.inbox=null,this.emptyInboxMsg=null,this.inboxCard=null,this.unviewedBadge=null,this.observer=null,this.selectedCategoryRef=null,this.addClickListenerOnDocument=(()=>e=>{if(e.composedPath().includes(this.inbox)){const t=e.path||e.composedPath&&e.composedPath();if(t.length){const e=t[0].id;if("closeInbox"===e)this.toggleInbox();else if(e.startsWith("category-"))this.prevCategoryRef=this.selectedCategoryRef,this.selectedCategoryRef=t[0],this.updateActiveCategory(t[0].innerText);else{const e=t.filter((e=>{var t;return(null===(t=e.id)||void 0===t?void 0:t.startsWith("button-"))||"CT-INBOX-MESSAGE"===e.tagName}));if(e.length){e[e.length-1].raiseClickedEvent(e[0],this.isPreview)}}}}else(this.inboxSelector.contains(e.target)||this.isInboxOpen)&&(this.isInboxFromFlutter?this.isInboxFromFlutter=!1:this.toggleInbox(e))})(),this.setBadgeStyle=e=>{null!==this.unviewedBadge&&(this.unviewedBadge.innerText=e>9?"9+":e,this.unviewedBadge.style.display=e>0?"flex":"none")},this.logger=e,this.shadow=this.attachShadow({mode:"open"})}get incomingMessages(){return[]}set incomingMessages(e){void 0===e&&(e=[]),e.length>0&&this.inbox&&this.updateInboxMessages(e)}get incomingMessagesForPreview(){return[]}set incomingMessagesForPreview(e){void 0===e&&(e=[]);const t={};e.length>0&&this.inbox&&(this.isPreview=!0,this.unviewedCounter=0,e.forEach((e=>{const i="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=i,t[i]=e,this.unviewedMessages[i]=e,this.unviewedCounter++})),this.buildUIForMessages(t),this.updateUnviewedBadgeCounter())}connectedCallback(){this.init()}init(){this.config=this.isPreview?this.inboxConfigForPreview:ae.readFromLSorCookie(q)||{},0!==Object.keys(this.config).length&&(this.inboxSelector=document.getElementById(this.config.inboxSelector),null!==this.inboxSelector&&(this.config.styles.notificationsBadge?this.addUnviewedBadge():this.unviewedBadge&&this.unviewedBadge.remove(),this.createinbox(),document.removeEventListener("click",this.addClickListenerOnDocument),document.addEventListener("click",this.addClickListenerOnDocument),this.config.categories.length&&this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadow.innerHTML=this.getInboxStyles(),this.shadow.appendChild(this.inbox)))}addMsgsToInboxFromLS(){const e=this.deleteExpiredAndGetUnexpiredMsgs(!1),t=e?Object.keys(e):[];0!==t.length&&(t.forEach((t=>{e[t].viewed||(this.unviewedMessages[t]=e[t],this.unviewedCounter++)})),this.buildUIForMessages(e),this.updateUnviewedBadgeCounter())}deleteExpiredAndGetUnexpiredMsgs(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Nt();const i=Math.floor(Date.now()/1e3);for(const o in t)if(t[o].wzrk_ttl&&t[o].wzrk_ttl>0&&t[o].wzrk_ttl0&&(t=Object.values(t).sort(((e,t)=>t.date-e.date)).reduce(((e,t)=>(e[t.id]=t,e)),{})),Ft(t),t}updateInboxMessages(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.deleteExpiredAndGetUnexpiredMsgs(),i=Date.now(),o={};e.forEach(((e,n)=>{const s="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=s,e.date=i-n,e.viewed=0,t[s]=e,o[s]=e,this.unviewedMessages[s]=e,this.unviewedCounter++})),Ft(t),this.buildUIForMessages(o),this.updateUnviewedBadgeCounter()}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}addUnviewedBadge(){this.unviewedBadge||(this.unviewedBadge=this.createEl("div","unviewedBadge"),this.unviewedBadge.style.cssText="display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ".concat(this.config.styles.notificationsBadge.backgroundColor,"; font-size: 12px; color: ").concat(this.config.styles.notificationsBadge.textColor,"; font-weight: bold; align-items: center; justify-content: center;"),document.body.appendChild(this.unviewedBadge)),this.updateUnviewedBadgePosition(),window.addEventListener("resize",(()=>{this.updateUnviewedBadgePosition()}))}updateUnviewedBadgePosition(){const{top:e,right:t}=this.inboxSelector.getBoundingClientRect();this.unviewedBadge.style.top="".concat(e-8,"px"),this.unviewedBadge.style.left="".concat(t-8,"px")}createinbox(){this.inbox=this.createEl("div","inbox");const e=this.createEl("div","header"),t=this.createEl("div","headerTitle");t.innerText=this.config.title;const i=this.createEl("div","closeInbox");if(i.innerHTML="×",e.appendChild(t),e.appendChild(i),this.inbox.appendChild(e),this.config.categories.length){const e=this.createCategories();this.inbox.appendChild(e)}this.inboxCard=this.createEl("div","inboxCard"),this.inbox.appendChild(this.inboxCard),this.emptyInboxMsg=this.createEl("div","emptyInboxMsg"),this.emptyInboxMsg.innerText="All messages will be displayed here.",this.inboxCard.appendChild(this.emptyInboxMsg);const o={root:this.inboxCard,rootMargin:"0px",threshold:.5};this.observer=new IntersectionObserver(((e,t)=>{this.handleMessageViewed(e)}),o),this.addMsgsToInboxFromLS()}createCategories(){const e=this.createEl("div","categoriesContainer"),t=this.createEl("div","leftArrow");t.innerHTML=Gt,t.children[0].style="transform: rotate(180deg)",t.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(-70,0)})),e.appendChild(t);const i=this.createEl("div","categoriesWrapper");["All",...this.config.categories].forEach(((e,t)=>{const o=this.createEl("div","category-".concat(t),"category");o.innerText=e,0===t&&(this.selectedCategoryRef=o),i.appendChild(o)})),e.appendChild(i);const o=this.createEl("div","rightArrow");o.innerHTML=Gt,o.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(70,0)})),e.appendChild(o);const n={root:e,threshold:.9},s=i.children[0],r=i.children[this.config.categories.length];new IntersectionObserver((e=>{this.categoryObserverCb(t,e[0].intersectionRatio>=.9)}),n).observe(s);return new IntersectionObserver((e=>{this.categoryObserverCb(o,e[0].intersectionRatio>=.9)}),n).observe(r),e}categoryObserverCb(e,t){e&&(e.style.display=t?"none":"flex")}updateActiveCategory(e){this.selectedCategory=e,this.inboxCard.scrollTop=0;let t=0;this.prevCategoryRef&&this.prevCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef.setAttribute("selected","true"),this.inboxCard.childNodes.forEach((e=>{"emptyInboxMsg"!==e.getAttribute("id")&&(e.style.display="All"===this.selectedCategory||e.getAttribute("category")===this.selectedCategory?"block":"none","block"===e.style.display&&t++)})),0===t?(this.emptyInboxMsg.innerText="".concat(e," messages will be displayed here."),this.emptyInboxMsg.style.display="block"):this.emptyInboxMsg.style.display="none"}buildUIForMessages(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!this.isPreview&&this.updateTSForRenderedMsgs(),this.inboxCard.scrollTop=0;const i=null!==(e=this.config.maxMsgsInInbox)&&void 0!==e?e:15,o=this.inboxCard.firstChild,n=Object.values(t).sort(((e,t)=>t.date-e.date)).map((e=>e.id));for(const e of n){const i=new Rt(this.config,t[e]);i.setAttribute("id",t[e].id),i.setAttribute("pivot",t[e].wzrk_pivot),i.setAttribute("part","ct-inbox-message"),this.config.categories.length>0?(i.setAttribute("category",t[e].tags[0]||""),i.style.display="All"===this.selectedCategory||t[e].category===this.selectedCategory?"block":"none"):i.style.display="block",this.inboxCard.insertBefore(i,o),this.observer.observe(i)}let s=this.inboxCard.querySelectorAll("ct-inbox-message").length;for(;s>i;){const e=this.inboxCard.querySelectorAll("ct-inbox-message");e.length>0&&e[e.length-1].remove(),s--}const r=this.inboxCard.querySelectorAll('ct-inbox-message[style*="display: block"]').length;this.emptyInboxMsg.style.display=r?"none":"block"}handleMessageViewed(e){const t=!this.isPreview;this.isInboxOpen&&e.forEach((e=>{e.isIntersecting&&this.unviewedMessages.hasOwnProperty(e.target.id)&&0===e.target.message.viewed&&(e.target.message.viewed=1,t?(window.clevertap.renderNotificationViewed({msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.updateMessageInLS(e.target.id,{...e.target.message,viewed:1}),setTimeout((()=>{e.target.shadowRoot.getElementById("unreadMarker").style.display="none"}),1e3)):console.log("Notifiction viewed event will be raised at run time with payload ::",{msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.unviewedCounter--,this.updateUnviewedBadgeCounter(),delete this.unviewedMessages[e.target.id])}))}updateMessageInLS(e,t){if(!this.isPreview){const i=Nt();i[e]=t,Ft(i)}}toggleInbox(e){this.isInboxOpen=!this.isInboxOpen,this.isInboxFromFlutter=!!(null==e?void 0:e.rect),this.isInboxOpen?(this.inboxCard.scrollTop=0,!this.isPreview&&this.deleteExpiredAndGetUnexpiredMsgs(),this.inbox.style.display="block",this.inbox.style.zIndex="2147483647",this.config.categories.length&&(this.selectedCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef=this.shadowRoot.getElementById("category-0"),this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadowRoot.getElementById("categoriesWrapper").scrollLeft-=this.shadowRoot.getElementById("categoriesWrapper").scrollWidth),this.setInboxPosition(e)):this.inbox.style.display="none"}setInboxPosition(e){const t=window.outerWidth,i=getComputedStyle(le.inbox),o=i.getPropertyValue("--inbox-top"),n=i.getPropertyValue("--inbox-bottom"),s=i.getPropertyValue("--inbox-left"),r=i.getPropertyValue("--inbox-right");if(t>481&&!(o||n||s||r)){const t=Vt(e,this.inbox.clientHeight,this.inbox.clientWidth),i=t.xPos,o=t.yPos;this.inbox.style.top=o+"px",this.inbox.style.left=i+"px"}}updateUnviewedBadgeCounter(){if(this.isPreview)return void this.setBadgeStyle(this.unviewedCounter);let e=0;this.inboxCard.querySelectorAll("ct-inbox-message").forEach((t=>{const i=Nt();i[t.id]&&0===i[t.id].viewed&&e++})),this.setBadgeStyle(e)}updateTSForRenderedMsgs(){this.inboxCard.querySelectorAll("ct-inbox-message").forEach((e=>{const t=e.id.split("_")[1];e.shadow.getElementById("timeStamp").firstChild.innerText=Wt(t)}))}getInboxStyles(){const e=this.config.categories.length?64:16,t={panelBackgroundColor:this.config.styles.panelBackgroundColor,panelBorderColor:this.config.styles.panelBorderColor,headerBackgroundColor:this.config.styles.header.backgroundColor,headerTitleColor:this.config.styles.header.titleColor,closeIconColor:this.config.styles.closeIconColor,categoriesTabColor:this.config.styles.categories.tabColor,categoriesTitleColor:this.config.styles.categories.titleColor,selectedCategoryTabColor:this.config.styles.categories.selectedTab.tabColor,selectedCategoryTitleColor:this.config.styles.categories.selectedTab.titleColor,headerCategoryHeight:36+e};this.config.styles.categories.borderColor&&(t.categoriesBorderColor=this.config.styles.categories.borderColor),this.config.styles.categories.selectedTab.borderColor&&(t.selectedCategoryBorderColor=this.config.styles.categories.selectedTab.borderColor);const i=(e=>{let{panelBackgroundColor:t,panelBorderColor:i,headerBackgroundColor:o,headerTitleColor:n,closeIconColor:s,categoriesTabColor:r,categoriesTitleColor:a,categoriesBorderColor:l,selectedCategoryTabColor:c,selectedCategoryTitleColor:d,selectedCategoryBorderColor:h,headerCategoryHeight:u}=e;return'\n \n ")})(t),o=this.config.styles.cards;return i+(e=>{let{backgroundColor:t,borderColor:i,titleColor:o,descriptionColor:n,buttonColor:s,buttonTextColor:r,unreadMarkerColor:a}=e;return'\n \n ")})({backgroundColor:o.backgroundColor,borderColor:o.borderColor,titleColor:o.titleColor,descriptionColor:o.descriptionColor,buttonColor:o.buttonColor,buttonTextColor:o.buttonTextColor,unreadMarkerColor:o.unreadMarkerColor})}}const Dt=e=>{e.inbox_preview?le.inbox.incomingMessagesForPreview=e.inbox_notifs:le.inbox.incomingMessages=e},zt=e=>{qt(),le.inbox=new jt({logger:e}),document.body.appendChild(le.inbox)},Bt=e=>{const t=ae.readFromLSorCookie(V)||{};if(Object.keys(t).length>0&&Object.keys(t)[0].includes("_")){const i={};return i[e]=t,ae.saveToLSorCookie(V,i),i}return t},Nt=()=>{const e=JSON.parse(decodeURIComponent(ae.read(b)));if(!X(e))return{};const t=Bt(e);return t.hasOwnProperty(e)?t[e]:{}},Ft=e=>{const t=JSON.parse(decodeURIComponent(ae.read(b)));if(!X(t))return;const i={...Bt(t),[t]:e};ae.saveToLSorCookie(V,i)},Ut=e=>new Promise(((t,i)=>{if("complete"===document.readyState)zt(e),t();else{const i=ae.readFromLSorCookie(q)||{},o=()=>{null===le.inbox&&zt(e),t()};window.addEventListener("load",(()=>{if(document.getElementById(i.inboxSelector))o();else{let n=0;if(n<20){const s=setInterval((()=>{document.getElementById(i.inboxSelector)?(o(),clearInterval(s),t()):n>=20&&(clearInterval(s),e.debug("Failed to add inbox")),n++}),500)}}}))}})),qt=()=>{void 0===customElements.get("ct-web-inbox")&&(customElements.define("ct-web-inbox",jt),customElements.define("ct-inbox-message",Rt))},Vt=(e,t,i)=>{const o=document.scrollingElement.scrollLeft,n=document.scrollingElement.scrollTop,s=window.innerWidth+o,r=window.innerHeight+n,a=e.rect||e.target.getBoundingClientRect(),l=a.x+o,c=a.y+n,d=a.left+o,h=a.right+o,u=a.top+n,p=a.bottom,g=a.height,f=a.width;let v,b,m=!1;const y=16;if(p+t<=r){const e=r-(p+t);b=e>=y?p+y:p+e}else if(u-t>=n){const e=u-t;b=e>=y?u-t-y:u-t-e}else m=!0,b=c+g/2-t/2,br&&(b=r-t);if(m){const e=h+i;if(e<=s){v=h+(e+y<=s?y:s-e)}else{const e=d-i;v=e-(e-y>=o?y:e-o)}}else v=l+f/2-i/2,vs&&(v=h-i>=o?h-i:s-i);return{xPos:v,yPos:b}},Wt=e=>{const t=Date.now();let i=Math.floor((t-e)/6e4);return i<5?"Just now":i<60?"".concat(i," minute").concat(i>1?"s":""," ago"):(i=Math.floor(i/60),i<24?"".concat(i," hour").concat(i>1?"s":""," ago"):(i=Math.floor(i/24),"".concat(i," day").concat(i>1?"s":""," ago")))},Kt=()=>Object.keys(ae.readFromLSorCookie(q)||{}).length>0,Gt='\n\n\n',Ht='\n\n\n',Jt=(e,t)=>{document.addEventListener("DOMContentLoaded",(()=>function(e,t){document.body.innerHTML="",Zt=document.createElement("div"),Zt.id="overlayDiv",Zt.style.position="relative",Zt.style.display="flex",document.body.appendChild(Zt);(function(e,t,i){return new Promise(((o,n)=>{var s=document.createElement("script");s.type="module",s.src=e,s.onload=function(){"function"==typeof window.Overlay?(window.Overlay("#overlayDiv",t,i),o()):n(new Error("ContentLayout not found in overlay.js"))},s.onerror=function(e){n(e)},document.head.appendChild(s)}))})("https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js",e,t).then((()=>{console.log("Overlay script loaded successfully.")})).catch((e=>{console.error("Error loading overlay script:",e)})),d=document.createElement("link"),d.rel="stylesheet",d.type="text/css",d.href="https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css",document.head.appendChild(d),o={kitId:"eqj6nom",scriptTimeout:3e3,async:!0},n=document,s=n.documentElement,r=setTimeout((function(){s.className=s.className.replace(/\bwf-loading\b/g,"")+" wf-inactive"}),o.scriptTimeout),a=n.createElement("script"),l=!1,c=n.getElementsByTagName("script")[0],s.className+=" wf-loading",a.src="https://use.typekit.net/"+o.kitId+".js",a.async=!0,a.onload=a.onreadystatechange=function(){if(i=this.readyState,!(l||i&&"complete"!==i&&"loaded"!==i)){l=!0,clearTimeout(r);try{Typekit.load(o)}catch(e){}}},c.parentNode.insertBefore(a,c);var i,o,n,s,r,a,l,c;var d}(e,t)))};let Zt;const $t=(e,t)=>{const i=e.display.details[0],o=Object.keys(i)[0],n=i[o];if(o===window.location.href)for(const i in n){const o=document.querySelector(i);if(o)n[i].html&&(o.outerHTML=n[i].html),t||window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot});else{let o=0;const s=setInterval((()=>{const r=document.querySelector(i);r?(n[i].html&&(r.outerHTML=n[i].html),t||window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot}),clearInterval(s)):(o++,o>=20&&(console.log("No element present on DOM with selector '".concat(i,"'.")),clearInterval(s)))}),500)}}},Yt=(e,t)=>{let{device:i,session:o,request:n,logger:s}=t;const r=i,a=o,l=n,c=s;let d=0;const h=t=>{const i=t.wzrk_id.split("_")[0],o=ie(),n=(e,t,i)=>{let o=0,n=0;null!=e[t]&&(o=e[t]),o++,null!=e.tc&&(n=e.tc),i<0&&n++,e.tc=n,e[t]=o};if(ae._isLocalStorageSupported()){delete sessionStorage.WZRK_CAMP;var s={};const e=Xe();s=3===t.display.wtarget_type&&e.hasOwnProperty("wi")?e.wi:0!==t.display.wtarget_type&&1!==t.display.wtarget_type||!e.hasOwnProperty("wp")?{}:e.wp,e.hasOwnProperty("global")&&(s.wp=e),null==t.display.wmc&&(t.display.wmc=1),null==t.display.wimc&&(t.display.wimc=1);var d=-1;let n=-1,r=-1,l=-1,c=-1,g=-1,f=-1;null!=t.display.efc&&(d=parseInt(t.display.efc,10)),null!=t.display.mdc&&(n=parseInt(t.display.mdc,10)),null!=t.display.tdc&&(r=parseInt(t.display.tdc,10)),null!=t.display.tlc&&(l=parseInt(t.display.tlc,10)),null!=t.display.wmp&&(c=parseInt(t.display.wmp,10)),null!=t.display.wmc&&(g=parseInt(t.display.wmc,10)),null!=t.display.wimc&&(f=parseInt(t.display.wimc,10));var h=s[a.sessionId];if(h){const e=h[i],o=h.tc;if("dnd"===e&&!le.dismissSpamControl)return!1;if(3===t.display.wtarget_type){if(f>0&&o>=f&&d<0)return!1}else if(g>0&&o>=g&&d<0)return!1;if(n>0&&e>=n)return!1}else h={},s[a.sessionId]=h;var u=s[o];if(null!=u){const e=u[i],t=u.tc;if(c>0&&t>=c&&d<0)return!1;if(r>0&&e>=r)return!1}else u={},s[o]=u;var p=s.global;if(null!=p){const e=p[i];if(l>0&&e>=l)return!1}else p={},s.global=p}if(null!=t.display.delay&&t.display.delay>0){const i=t.display.delay;return t.display.delay=0,setTimeout(Yt,1e3*i,e,{device:r,session:a,request:l,logger:c}),!1}n(h,i,d),n(u,i,d),n(p,i,d);let g="wp";3===t.display.wtarget_type&&(g="wi");const f={};f[a.sessionId]=h,f[o]=u,f.global=p,et({[g]:f})},u=()=>{const e=r.getGuid(),t=a.getSessionCookieObject();return"&t=wc&d="+encodeURIComponent(He(e+"|"+t.p+"|"+t.s))},p=(e,t)=>{const i=window.parent[e];"function"==typeof i&&(null!=t.display.kv?i(t.display.kv):i())},g=(e,t,i,o,n)=>{f(t),((e,t,i,o,n)=>{if(""!==e&&null!=e){let o,s;n?o=i:null!==i&&(s=i.getElementsByClassName("jsCT_CTA"),null!=s&&1===s.length&&(o=s[0]));const r=t.display.jsFunc,l=t.display.preview;null==l&&(e+=u()),null!=o&&(o.onclick=()=>{if(null!=r)return null==l&&Qe.fireRequest(e),p(r,t),void at("-1",0,a.sessionId);1===t.display.window?window.open(e,"_blank"):window.location=e})}})(e,t,i,0,n)},f=e=>{const t={type:"event"};t.evtName=R,t.evtData={[T]:e.wzrk_id},e.wzrk_pivot&&(t.evtData={...t.evtData,wzrk_pivot:e.wzrk_pivot}),l.processEvent(t)},v=e=>{var t;void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Lt);const i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,o=document.createElement("ct-web-personalisation-banner");o.msgId=e.wzrk_id,o.pivotId=e.wzrk_pivot,o.divHeight=e.display.divHeight,o.details=e.display.details[0];const n=e.display.divId?document.getElementById(i):document.querySelector(i);n.innerHTML="",n.appendChild(o)},m=e=>{var t;void 0===customElements.get("ct-web-personalisation-carousel")&&customElements.define("ct-web-personalisation-carousel",Mt);const i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,o=document.createElement("ct-web-personalisation-carousel");o.target=e;const n=e.display.divId?document.getElementById(i):document.querySelector(i);n.innerHTML="",n.appendChild(o)},y=e=>{const t=e.wzrk_id.split("_")[0],i=e.display;if(2===i.wtarget_type&&1===e.msgContent.type){const t={};t.msgId=e.wzrk_id,e.wzrk_pivot&&(t.pivotId=e.wzrk_pivot),null!=e.msgContent.kv&&(t.kv=e.msgContent.kv);const i=new CustomEvent("CT_web_native_display",{detail:t});return void document.dispatchEvent(i)}if(1===i.layout)return O(void 0,e);if(3===i.layout){const t="wzrkImageOnlyDiv";if(!1===h(e))return;if(le.dismissSpamControl&&null!=document.getElementById(t)){document.getElementById(t).remove()}if(null!=document.getElementById(t)||null!=document.getElementById("intentPreview"))return;const i=document.createElement("div");return i.id=t,document.body.appendChild(i),void 0===customElements.get("ct-web-popup-imageonly")&&customElements.define("ct-web-popup-imageonly",Tt),(e=>{const t=document.createElement("ct-web-popup-imageonly");t.session=a,t.target=e;const i=document.getElementById("wzrkImageOnlyDiv");i.innerHTML="",i.style.visibility="hidden",i.appendChild(t)})(e)}if(!1===h(e))return;const o="wizParDiv"+i.layout;if(le.dismissSpamControl&&null!=document.getElementById(o)){document.getElementById(o).remove()}if(null!=document.getElementById(o))return;le.campaignDivMap[t]=o;const n=2===i.layout,s=document.createElement("div");s.id=o;const r=window.innerHeight,l=window.innerWidth;let c=!1;if(n)s.setAttribute("style",i.iFrameStyle);else{var d=10;let e=5*l/100,t=d+5*r/100,o=30*l/100+20,n="width:30%;";(/mobile/i.test(navigator.userAgent)||/mini/i.test(navigator.userAgent))&&!1===/iPad/i.test(navigator.userAgent)?(o=85*l/100+20,e=5*l/100,t=5*r/100,n="width:80%;"):("ontouchstart"in window||/tablet/i.test(navigator.userAgent))&&(o=50*l/100+20,e=5*l/100,t=5*r/100,n="width:50%;"),null==i.proto?(c=!0,s.setAttribute("style","display:block;overflow:hidden; bottom:"+t+"px !important;width:"+o+"px !important;right:"+e+"px !important;position:fixed;z-index:2147483647;")):s.setAttribute("style",n+i.iFrameStyle)}document.body.appendChild(s);const u=document.createElement("iframe"),p=!1===i.br?"0":"8";u.frameborder="0px",u.marginheight="0px",u.marginwidth="0px",u.scrolling="no",u.id="wiz-iframe";const f=e.display.onClick;let v,b="";if(""!==f&&null!=f&&(b="cursor:pointer;"),1===e.msgContent.type)v=e.msgContent.html,v=v.replace(/##campaignId##/g,t),v=v.replace(/##campaignId_batchId##/g,e.wzrk_id);else{const i='";let n,s,r,a,l;"dark"===e.display.theme?(n="#2d2d2e",s="#eaeaea",r="#353535",a="#353535",l="#ffffff"):(n="#ffffff",s="#000000",a="#f4f4f4",r="#a5a6a6",l="#ffffff");const c=e.msgContent.title,d=e.msgContent.description;let h="";null!=e.msgContent.imageUrl&&""!==e.msgContent.imageUrl&&(h="");v=i+("
×
"+h+"
"+c+"
")+("
"+d+"
")}u.setAttribute("style","z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;"),s.appendChild(u);const m=(u.contentWindow?u.contentWindow:u.contentDocument.document?u.contentDocument.document:u.contentDocument).document,y=new Event("CT_campaign_rendered");document.dispatchEvent(y),m.open(),m.write(v),i["custom-editor"]&&k(e,m),m.close();const w=()=>{d=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv").scrollHeight,!0===i["custom-editor"]||n||(d+=25),document.getElementById("wiz-iframe").contentDocument.body.style.margin="0px",document.getElementById("wiz-iframe").style.height=d+"px"},C=navigator.userAgent.toLowerCase();if(-1!==C.indexOf("safari"))if(C.indexOf("chrome")>-1)u.onload=()=>{w();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)};else{let t=u.contentDocument||u.contentWindow;t.document&&(t=t.document),w();const i=setInterval((()=>{if("complete"===t.readyState){clearInterval(i),w();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)}}),10)}else u.onload=()=>{w();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)}},k=(e,t)=>{const i=t.createElement("script");i.innerHTML="\n const ct__camapignId = '".concat(e.wzrk_id,"';\n const ct__formatVal = (v) => {\n return v && v.trim().substring(0, 20);\n }\n const ct__parentOrigin = window.parent.origin;\n document.body.addEventListener('click', (event) => {\n const elem = event.target.closest?.('a[wzrk_c2a], button[wzrk_c2a]');\n if (elem) {\n const {innerText, id, name, value, href} = elem;\n const clickAttr = elem.getAttribute('onclick') || elem.getAttribute('click');\n const onclickURL = clickAttr?.match(/(window.open)[(](\"|')(.*)(\"|',)/)?.[3] || clickAttr?.match(/(location.href *= *)(\"|')(.*)(\"|')/)?.[3];\n const props = {innerText, id, name, value};\n let msgCTkv = Object.keys(props).reduce((acc, c) => {\n const formattedVal = ct__formatVal(props[c]);\n formattedVal && (acc['wzrk_click_' + c] = formattedVal);\n return acc;\n }, {});\n if(onclickURL) { msgCTkv['wzrk_click_' + 'url'] = onclickURL; }\n if(href) { msgCTkv['wzrk_click_' + 'c2a'] = href; }\n const notifData = { msgId: ct__camapignId, msgCTkv, pivotId: '").concat(e.wzrk_pivot,"' };\n window.parent.clevertap.renderNotificationClicked(notifData);\n }\n });\n "),t.body.appendChild(i)};let x=!1;const S=e=>{let t=e.display.onClick;if(window.clevertap.hasOwnProperty("notificationCallback")&&void 0!==window.clevertap.notificationCallback&&"function"==typeof window.clevertap.notificationCallback){const i=window.clevertap.notificationCallback;if(!x){const o={};o.msgContent=e.msgContent,o.msgId=e.wzrk_id,e.wzrk_pivot&&(o.pivotId=e.wzrk_pivot),null!=e.display.kv&&(o.kv=e.display.kv),window.clevertap.raiseNotificationClicked=()=>{if(""!==t&&null!=t){const i=e.display.jsFunc;if(t+=u(),null!=i)return Qe.fireRequest(t),void p(i,e);1===e.display.window?window.open(t,"_blank"):window.location=t}},window.clevertap.raiseNotificationViewed=()=>{f(e)},i(o),x=!0}}else if(window.clevertap.popupCurrentWzrkId=e.wzrk_id,y(e),window.clevertap.hasOwnProperty("popupCallbacks")&&void 0!==window.clevertap.popupCallbacks&&"function"==typeof window.clevertap.popupCallbacks[e.wzrk_id]){const t=window.clevertap.popupCallbacks[e.wzrk_id],n={};n.msgContent=e.msgContent,n.msgId=e.wzrk_id,e.wzrk_pivot&&(n.pivotId=e.wzrk_pivot);var i=[];for(var o in e)if(o.startsWith(M)&&o!==T){const t={[o]:e[o]};i.push(t)}i.length>0&&(n.msgCTkv=i),null!=e.display.kv&&(n.kv=e.display.kv),window.clevertap.raisePopupNotificationClicked=t=>{if(!t||!t.msgId)return;const i={type:"event"};if(i.evtName=j,i.evtData={[T]:t.msgId},e.wzrk_pivot&&(i.evtData={...i.evtData,wzrk_pivot:t.pivotId}),t.msgCTkv)for(var o of t.msgCTkv)i.evtData={...i.evtData,...o};l.processEvent(i)},t(n)}};let I;const O=(e,t)=>{let i;if(null!=e&&e.clientY>0)return;if(i=null==t?I:t,le.dismissSpamControl&&0===i.display.wtarget_type&&null!=document.getElementById("intentPreview")&&null!=document.getElementById("intentOpacityDiv")){document.getElementById("intentPreview").remove(),document.getElementById("intentOpacityDiv").remove()}if(null!=document.getElementById("intentPreview")||null!=document.getElementById("wzrkImageOnlyDiv"))return;if(null==i.display.layout&&(/mobile/i.test(navigator.userAgent)||/mini/i.test(navigator.userAgent)||/iPad/i.test(navigator.userAgent)||"ontouchstart"in window||/tablet/i.test(navigator.userAgent)))return;if(!1===h(i))return;const o=i.wzrk_id.split("_")[0];le.campaignDivMap[o]="intentPreview";let n=!1;const s=document.createElement("div");s.id="intentOpacityDiv";const r=i.display.opacity||.7,a="rgba(0,0,0,".concat(r,")");s.setAttribute("style","position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ".concat(a,";")),document.body.appendChild(s);const l=document.createElement("div");l.id="intentPreview",null==i.display.proto?(n=!0,l.setAttribute("style","display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;")):l.setAttribute("style",i.display.iFrameStyle),document.body.appendChild(l);const c=document.createElement("iframe"),d=!1===i.display.br?"0":"8";c.frameborder="0px",c.marginheight="0px",c.marginwidth="0px",c.scrolling="no",c.id="wiz-iframe-intent";const u=i.display.onClick;let p,f="";if(""!==u&&null!=u&&(f="cursor:pointer;"),1===i.msgContent.type)p=i.msgContent.html,p=p.replace(/##campaignId##/g,o),p=p.replace(/##campaignId_batchId##/g,i.wzrk_id);else{const e='";let t,n,s,r;"dark"===i.display.theme?(t="#2d2d2e",n="#eaeaea",s="#353535",r="#ffffff"):(t="#ffffff",n="#000000",s="#a5a6a6",r="#ffffff");const a=i.msgContent.title,l=i.msgContent.description;let c="";null!=i.msgContent.ctaText&&""!==i.msgContent.ctaText&&(c="");let h="";null!=i.msgContent.imageUrl&&""!==i.msgContent.imageUrl&&(h="
+a+
");p=e+("
×
"+a+"
")+("
"+l+"
"+h+c+"
")}c.setAttribute("style","z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;"),l.appendChild(c);const v=(c.contentWindow?c.contentWindow:c.contentDocument.document?c.contentDocument.document:c.contentDocument).document,b=new Event("CT_campaign_rendered");document.dispatchEvent(b),v.open(),v.write(p),i.display["custom-editor"]&&k(i,v),v.close();const m=document.getElementById("wiz-iframe-intent").contentDocument.getElementById("contentDiv");g(u,i,m,0,n)};if(!document.body)return void(d<6&&(d++,setTimeout(Yt,1e3,e,{device:r,session:a,request:l,logger:c})));const _=e=>{Object.keys(e).map((t=>{var i,o;e[t].display.divId?(i=e[t].display.divId,o=document.getElementById(i)):(i=e[t].display.divSelector,o=document.querySelector(i)),null!==o&&(2===e[t].msgContent.type?v(e[t]):m(e[t]),delete e[t])}))};if(null!=e.inapp_notifs){const t={};for(let i=0;i{window.addEventListener("load",(()=>{let t=0;if(t<20){const i=setInterval((()=>{_(e),0!==Object.keys(e).length&&20!==t||(clearInterval(i),e={}),t++}),500)}}))})(t))}const E=()=>{if(e.inbox_preview)Dt(e);else if(e.inbox_notifs){const t=[];for(let i=0;i1&&void 0!==arguments[1]&&arguments[1];const i=ae.readFromLSorCookie(q)||{};t?(le.inbox.inboxConfigForPreview=e,le.inbox.isPreview=!0,le.inbox&&le.inbox.init()):JSON.stringify(i)!==JSON.stringify(e)&&(ae.saveToLSorCookie(q,e),le.inbox&&le.inbox.init())}(e.webInboxSetting),Ut(c).then((()=>{E()})).catch((e=>{}))):E()),e.vars)return void le.variableStore.mergeVariables(e.vars);const A=(e,t)=>{const i=Xe(),o=i[t].global;if(null!=o&&t)for(const i in e)if(e.hasOwnProperty(i)&&(delete o[e[i]],ae.read(w))){const o=JSON.parse(decodeURIComponent(ae.read(w))),n=JSON.parse(decodeURIComponent(ae.read(b)));o[n]&&o[n][t]&&o[n][t][e[i]]&&(delete o[n][t][e[i]],ae.save(w,encodeURIComponent(JSON.stringify(o))))}et(i)};if(ae._isLocalStorageSupported())try{if(null!=e.evpr){const t=e.evpr.events,i=e.evpr.profile,o=e.evpr.expires_in,n=oe();ae.setMetaProp("lsTime",n),ae.setMetaProp("exTs",o),(e=>{if(null!=le.globalEventsMap||(le.globalEventsMap=ae.readFromLSorCookie(C),null!=le.globalEventsMap)){for(const t in e)if(e.hasOwnProperty(t)){const i=le.globalEventsMap[t],o=e[t];null!=le.globalEventsMap[t]?null!=o[0]&&o[0]>i[0]&&(le.globalEventsMap[t]=o):le.globalEventsMap[t]=o}}else le.globalEventsMap=e})(t),ae.saveToLSorCookie(C,le.globalEventsMap),null==le.globalProfileMap?rt(i,!0):rt(i,!1)}null!=e.arp&&(e=>{if(null!=e.skipResARP&&e.skipResARP)return console.debug("Update ARP Request rejected",e),null;const t=!0===e.isOUL;if(ae._isLocalStorageSupported())try{let i=ae.readFromLSorCookie(P);if(null==i||t){i={};for(const t in e)e.hasOwnProperty(t)&&(-1===e[t]?delete i[t]:i[t]=e[t]);ae.saveToLSorCookie(P,i)}}catch(e){console.error("Unable to parse ARP JSON: "+e)}})(e.arp),null!=e.inapp_stale&&e.inapp_stale.length>0&&A(e.inapp_stale,"wp"),null!=e.inbox_stale&&e.inbox_stale.length>0&&A(e.inbox_stale,"wi")}catch(e){c.error("Unable to persist evrp/arp: "+e)}};var Qt=t("isPersonalisationActive");class Xt{constructor(e){let{isPersonalisationActive:t}=e;Object.defineProperty(this,Qt,{writable:!0,value:void 0}),i(this,Qt)[Qt]=t}getTotalVisits(){if(!i(this,Qt)[Qt]())return;let e=ae.getMetaProp("sc");return null==e&&(e=1),e}getLastVisit(){if(!i(this,Qt)[Qt]())return;const e=ae.getMetaProp("ps");return null!=e?new Date(1e3*e):void 0}}const ei=1,ti=2,ii=3,oi=4;var ni=t("logLevel"),si=t("log"),ri=t("isLegacyDebug");class ai{constructor(e){Object.defineProperty(this,ri,{get:ci,set:void 0}),Object.defineProperty(this,si,{value:li}),Object.defineProperty(this,ni,{writable:!0,value:void 0}),this.wzrkError={},i(this,ni)[ni]=null==e?e:ti,this.wzrkError={}}get logLevel(){return i(this,ni)[ni]}set logLevel(e){i(this,ni)[ni]=e}error(e){i(this,ni)[ni]>=ei&&i(this,si)[si]("error",e)}info(e){i(this,ni)[ni]>=ti&&i(this,si)[si]("log",e)}debug(e){(i(this,ni)[ni]>=ii||i(this,ri)[ri])&&i(this,si)[si]("debug",e)}debugPE(e){i(this,ni)[ni]>=oi&&i(this,si)[si]("debug_pe",e)}reportError(e,t){this.wzrkError.c=e,this.wzrkError.d=t,this.error("".concat(Ce," ").concat(e,": ").concat(t))}}var li=function(e,t){if(window.console)try{const i=(new Date).getTime();console[e]("CleverTap [".concat(i,"]: ").concat(t))}catch(e){}},ci=function(){return"undefined"!=typeof sessionStorage&&""===sessionStorage.WZRK_D},di=t("logger"),hi=t("sessionId"),ui=t("isPersonalisationActive");class pi{constructor(e){let{logger:t,isPersonalisationActive:o}=e;Object.defineProperty(this,di,{writable:!0,value:void 0}),Object.defineProperty(this,hi,{writable:!0,value:void 0}),Object.defineProperty(this,ui,{writable:!0,value:void 0}),this.cookieName=void 0,this.scookieObj=void 0,this.sessionId=ae.getMetaProp("cs"),i(this,di)[di]=t,i(this,ui)[ui]=o}get sessionId(){return i(this,hi)[hi]}set sessionId(e){i(this,hi)[hi]=e}getSessionCookieObject(){let e=ae.readCookie(this.cookieName),t={};if(null!=e)if(e=e.replace(p,'"'),t=JSON.parse(e),J(t)){if(void 0!==t.t){const e=t.t;oe()-e>1260&&(t={})}}else t={};return this.scookieObj=t,t}setSessionCookieObject(e){const t=JSON.stringify(e);ae.createBroadCookie(this.cookieName,t,1200,We())}manageSession(e){if(void 0===this.sessionId||this.sessionId!==e){const t=ae.getMetaProp("cs");if(void 0===t)ae.setMetaProp("ps",e),ae.setMetaProp("cs",e),ae.setMetaProp("sc",1);else if(t!==e){ae.setMetaProp("ps",t),ae.setMetaProp("cs",e);let i=ae.getMetaProp("sc");void 0===i&&(i=0),ae.setMetaProp("sc",i+1)}this.sessionId=e}}getTimeElapsed(){if(!i(this,ui)[ui]())return;null!=this.scookieObj&&(this.scookieObj=this.getSessionCookieObject());const e=this.scookieObj.s;if(null!=e){const t=oe();return Math.floor(t-e)}}getPageCount(){if(i(this,ui)[ui]())return null!=this.scookieObj&&(this.scookieObj=this.getSessionCookieObject()),this.scookieObj.p}}let gi=0,fi=0;var vi=t("logger"),bi=t("account"),mi=t("device"),yi=t("session"),wi=t("isPersonalisationActive"),Ci=t("clearCookie"),ki=t("addToLocalEventMap");class xi{constructor(e){let{logger:t,account:o,device:n,session:s,isPersonalisationActive:r}=e;Object.defineProperty(this,ki,{value:Pi}),Object.defineProperty(this,vi,{writable:!0,value:void 0}),Object.defineProperty(this,bi,{writable:!0,value:void 0}),Object.defineProperty(this,mi,{writable:!0,value:void 0}),Object.defineProperty(this,yi,{writable:!0,value:void 0}),Object.defineProperty(this,wi,{writable:!0,value:void 0}),Object.defineProperty(this,Ci,{writable:!0,value:!1}),this.processingBackup=!1,i(this,vi)[vi]=t,i(this,bi)[bi]=o,i(this,mi)[mi]=n,i(this,yi)[yi]=s,i(this,wi)[wi]=r,Qe.logger=t,Qe.device=n,Qe.account=o}processBackupEvents(){const e=ae.readFromLSorCookie(S);if(null!=e){this.processingBackup=!0;for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];void 0===o.fired&&(i(this,vi)[vi].debug("Processing backup event : "+o.q),void 0!==o.q&&Qe.fireRequest(o.q),o.fired=!0)}ae.saveToLSorCookie(S,e),this.processingBackup=!1}}addSystemDataToObject(e,t){void 0===t&&(e=ee(e,i(this,vi)[vi])),$(i(this,vi)[vi].wzrkError)||(e.wzrk_error=i(this,vi)[vi].wzrkError,i(this,vi)[vi].wzrkError={}),e.id=i(this,bi)[bi].id,X(i(this,mi)[mi].gcookie)&&(e.g=i(this,mi)[mi].gcookie);const o=i(this,yi)[yi].getSessionCookieObject();e.s=o.s,e.pg=void 0===o.p?1:o.p;let n=document.location.protocol;return n=n.replace(":",""),e.af={lib:"web-sdk-v1.7.3",protocol:n,...le.flutterVersion},sessionStorage.hasOwnProperty("WZRK_D")&&(e.debug=!0),e}addFlags(e){if(i(this,Ci)[Ci]=ae.getAndClearMetaProp(g),void 0!==i(this,Ci)[Ci]&&i(this,Ci)[Ci]&&(e.rc=!0,i(this,vi)[vi].debug("reset cookie sent in request and cleared from meta for future requests.")),i(this,wi)[wi]()){const t=ae.getMetaProp("lsTime"),i=ae.getMetaProp("exTs");if(void 0===t||void 0===i)return void(e.dsync=!0);t+i{if(e.ok)return e.json();throw e})).then((e=>(i(this,vi)[vi].debug("Sync data successful",e),e))).catch((e=>{throw i(this,vi)[vi].debug("Error in syncing variables",e),e}))}}var Pi=function(e){if(ae._isLocalStorageSupported()){void 0===le.globalEventsMap&&(le.globalEventsMap=ae.readFromLSorCookie(C),void 0===le.globalEventsMap&&(le.globalEventsMap={}));const t=oe();let i=le.globalEventsMap[e];void 0!==i?(i[2]=t,i[0]++):(i=[],i.push(1),i.push(t),i.push(t)),le.globalEventsMap[e]=i,ae.saveToLSorCookie(C,le.globalEventsMap)}},Si=t("request"),Ii=t("account"),Oi=t("oldValues"),_i=t("logger"),Ei=t("processPrivacyArray");class Ai extends Array{constructor(e,t){let{request:o,account:n,logger:s}=e;super(),Object.defineProperty(this,Ei,{value:Li}),Object.defineProperty(this,Si,{writable:!0,value:void 0}),Object.defineProperty(this,Ii,{writable:!0,value:void 0}),Object.defineProperty(this,Oi,{writable:!0,value:void 0}),Object.defineProperty(this,_i,{writable:!0,value:void 0}),i(this,_i)[_i]=s,i(this,Si)[Si]=o,i(this,Ii)[Ii]=n,i(this,Oi)[Oi]=t}push(){for(var e=arguments.length,t=new Array(e),o=0;o0?le.privacyArray:t):le.privacyArray.push(...t),0}_processOldValues(){i(this,Oi)[Oi]&&i(this,Ei)[Ei](i(this,Oi)[Oi]),i(this,Oi)[Oi]=null}}var Li=function(e){if(Array.isArray(e)&&e.length>0){const o=e.reduce(((e,t)=>({...e,...t})),{});let n={};const s={};var t=!1;if(o.hasOwnProperty(O)&&"boolean"==typeof(t=o.optOut)&&(s.ct_optout=t,le.isOptInRequest=!t),o.hasOwnProperty(_)){const e=o.useIP,t="boolean"==typeof e&&e;ae.setMetaProp(_,t)}if(!$(s)){n.type="profile",n.profile=s,n=i(this,Si)[Si].addSystemDataToObject(n,void 0);const o=Ke(JSON.stringify(n),i(this,_i)[_i]);let r=i(this,Ii)[Ii].dataPostURL;r=Ve(r,"type",A),r=Ve(r,"d",o),r=Ve(r,O,t?"true":"false"),i(this,Si)[Si].saveAndFireRequest(r,le.blockRequest),e.splice(0,e.length)}}},Mi=t("oldValues"),Ti=t("logger"),Ri=t("request"),ji=t("account"),Di=t("wizAlertJSPath"),zi=t("fcmPublicKey"),Bi=t("setUpWebPush"),Ni=t("setUpWebPushNotifications"),Fi=t("setApplicationServerKey"),Ui=t("setUpSafariNotifications"),qi=t("setUpChromeFirefoxNotifications"),Vi=t("addWizAlertJS"),Wi=t("removeWizAlertJS"),Ki=t("handleNotificationRegistration");class Gi extends Array{constructor(e,t){let{logger:o,session:n,request:s,account:r}=e;super(),Object.defineProperty(this,Ki,{value:eo}),Object.defineProperty(this,Wi,{value:Xi}),Object.defineProperty(this,Vi,{value:Qi}),Object.defineProperty(this,qi,{value:Yi}),Object.defineProperty(this,Ui,{value:$i}),Object.defineProperty(this,Fi,{value:Zi}),Object.defineProperty(this,Ni,{value:Ji}),Object.defineProperty(this,Bi,{value:Hi}),Object.defineProperty(this,Mi,{writable:!0,value:void 0}),Object.defineProperty(this,Ti,{writable:!0,value:void 0}),Object.defineProperty(this,Ri,{writable:!0,value:void 0}),Object.defineProperty(this,ji,{writable:!0,value:void 0}),Object.defineProperty(this,Di,{writable:!0,value:void 0}),Object.defineProperty(this,zi,{writable:!0,value:void 0}),i(this,Di)[Di]="https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js",i(this,zi)[zi]=null,i(this,Mi)[Mi]=t,i(this,Ti)[Ti]=o,i(this,Ri)[Ri]=s,i(this,ji)[ji]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o0?i(this,Ki)[Ki](e):null==le.webPushEnabled&&e.length>0?(le.notifApi.notifEnabledFromApi=!0,le.notifApi.displayArgs=e.slice()):!1===le.webPushEnabled&&e.length>0&&i(this,Ti)[Ti].error("Make sure push notifications are fully enabled and integrated")},Ji=function(e,t,o,n){-1!==navigator.userAgent.indexOf("Chrome")||-1!==navigator.userAgent.indexOf("Firefox")?i(this,qi)[qi](e,t):-1!==navigator.userAgent.indexOf("Safari")&&i(this,Ui)[Ui](e,o,n)},Zi=function(e){i(this,zi)[zi]=e},$i=function(e,t,o){void 0===t&&i(this,Ti)[Ti].error("Ensure that APNS Web Push ID is supplied"),void 0===o&&i(this,Ti)[Ti].error("Ensure that APNS Web Push service path is supplied"),"safari"in window&&"pushNotification"in window.safari&&window.safari.pushNotification.requestPermission(o,t,{},(e=>{if("granted"===e.permission){const t=JSON.parse(JSON.stringify(e));t.endpoint=e.deviceToken,t.browser="Safari",ae.saveToLSorCookie(z,t),i(this,Ri)[Ri].registerToken(t),i(this,Ti)[Ti].info("Safari Web Push registered. Device Token: "+e.deviceToken)}else"denied"===e.permission&&i(this,Ti)[Ti].info("Error subscribing to Safari web push")}))},Yi=function(e,t){let o="";"serviceWorker"in navigator&&navigator.serviceWorker.register(t).then((e=>{if("undefined"!=typeof __wzrk_account_id)return new Promise((t=>setTimeout((()=>t(e)),5e3)));o=e.scope;return/^(\.?)(\/?)([^/]*).js$/.test(t)?navigator.serviceWorker.ready:-1!==navigator.userAgent.indexOf("Chrome")?new Promise((t=>setTimeout((()=>t(e)),5e3))):navigator.serviceWorker.getRegistrations()})).then((t=>{-1!==navigator.userAgent.indexOf("Firefox")&&Array.isArray(t)&&(t=t.filter((e=>e.scope===o))[0]);const n={userVisibleOnly:!0};null!=i(this,zi)[zi]&&(n.applicationServerKey=(e=>{let t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),i=window.atob(t),o=[];for(let e=0;e{i(this,Ti)[Ti].info("Service Worker registered. Endpoint: "+t.endpoint);const o=JSON.parse(JSON.stringify(t));-1!==navigator.userAgent.indexOf("Chrome")?(o.endpoint=o.endpoint.split("/").pop(),o.browser="Chrome"):-1!==navigator.userAgent.indexOf("Firefox")&&(o.endpoint=o.endpoint.split("/").pop(),o.browser="Firefox"),ae.saveToLSorCookie(z,o),i(this,Ri)[Ri].registerToken(o),void 0!==e&&"function"==typeof e&&e()})).catch((e=>{i(this,Ti)[Ti].error("Error subscribing: "+e),t.pushManager.getSubscription().then((e=>{null!==e&&e.unsubscribe().then((e=>{i(this,Ti)[Ti].info("Unsubscription successful")})).catch((e=>{i(this,Ti)[Ti].error("Error unsubscribing: "+e)}))}))}))})).catch((e=>{i(this,Ti)[Ti].error("error registering service worker: "+e)}))},Qi=function(){const e=document.createElement("script");return e.setAttribute("type","text/javascript"),e.setAttribute("id","wzrk-alert-js"),e.setAttribute("src",i(this,Di)[Di]),document.getElementsByTagName("body")[0].appendChild(e),e},Xi=function(){const e=document.getElementById("wzrk-alert-js");e.parentNode.removeChild(e)},eo=function(e){let t,o,n,s,r,a,l,c,d,h,u,p,g,f,v;if(1===e.length){if(J(e[0])){const i=e[0];t=i.titleText,o=i.bodyText,n=i.okButtonText,s=i.rejectButtonText,r=i.okButtonColor,a=i.skipDialog,l=i.askAgainTimeInSeconds,c=i.okCallback,d=i.rejectCallback,h=i.subscriptionCallback,u=i.serviceWorkerPath,p=i.httpsPopupPath,g=i.httpsIframePath,f=i.apnsWebPushId,v=i.apnsWebPushServiceUrl}}else t=e[0],o=e[1],n=e[2],s=e[3],r=e[4],a=e[5],l=e[6];if(null==a&&(a=!1),null==u&&(u="/clevertap_sw.js"),void 0===navigator.serviceWorker)return;const b=null!=p&&null!=g;if("https:"!==window.location.protocol&&"localhost"!==document.location.hostname&&!b)return void i(this,Ti)[Ti].error("Make sure you are https or localhost to register for notifications");if(-1!==navigator.userAgent.indexOf("Chrome")){const e=navigator.userAgent.match(/Chrome\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}else if(-1!==navigator.userAgent.indexOf("Firefox")){const e=navigator.userAgent.match(/Firefox\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}else{if(-1===navigator.userAgent.indexOf("Safari"))return;{const e=navigator.userAgent.match(/Safari\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}}if(!b){if(null==Notification)return;if("granted"===Notification.permission)return void i(this,Ni)[Ni](h,u,f,v);if("denied"===Notification.permission)return;if(a)return void i(this,Ni)[Ni](h,u,f,v)}if(!(t&&o&&n&&s))return void i(this,Ti)[Ti].error("Missing input parameters; please specify title, body, ok button and cancel button text");null!=r&&r.match(/^#[a-f\d]{6}$/i)||(r="#f28046");const m=(new Date).getTime()/1e3;if(null==ae.getMetaProp("notif_last_time"))ae.setMetaProp("notif_last_time",m);else{if(null==l&&(l=604800),m-ae.getMetaProp("notif_last_time"){if(null!=e.data){let a={};try{a=JSON.parse(e.data)}catch(e){return}null!=a.state&&"ct"===a.from&&"not"===a.state&&(i(this,Vi)[Vi]().onload=()=>{window.wzrkPermissionPopup.wizAlert({title:t,body:o,confirmButtonText:n,confirmButtonColor:r,rejectButtonText:s},(e=>{e?("function"==typeof c&&c(),window.open(p)):"function"==typeof d&&d(),i(this,Wi)[Wi]()}))})}}),!1)}else i(this,Vi)[Vi]().onload=()=>{window.wzrkPermissionPopup.wizAlert({title:t,body:o,confirmButtonText:n,confirmButtonColor:r,rejectButtonText:s},(e=>{e?("function"==typeof c&&c(),i(this,Ni)[Ni](h,u,f,v)):"function"==typeof d&&d(),i(this,Wi)[Wi]()}))}},to=t("variableStore");class io{constructor(e){let{variableStore:t}=e;Object.defineProperty(this,to,{writable:!0,value:void 0}),this.name=null,this.defaultValue=null,this.value=null,this.type=null,this.hadStarted=!1,this.valueChangedCallbacks=[],i(this,to)[to]=t}getValue(){return this.value}getdefaultValue(){return this.defaultValue}static define(e,t,i){if(!e||"string"!=typeof e)return console.error("Empty or invalid name parameter provided."),null;if(e.startsWith(".")||e.endsWith("."))return console.error("Variable name starts or ends with a `.` which is not allowed: "+e),null;const o=typeof t;if("string"!==o&&"number"!==o&&"boolean"!==o)return console.error("Only primitive types (string, number, boolean) are accepted as value"),null;const n=i.getVariable(e);if(n)return n;const s=new io({variableStore:i});try{s.name=e,s.defaultValue=t,s.value=t,s.type=o,i.registerVariable(s),s.update(t)}catch(e){console.error(e)}return s}update(e){const t=this.value;this.value=e,null===e&&null===t||null!==e&&e===t&&this.hadStarted||i(this,to)[to].hasVarsRequestCompleted()&&(this.hadStarted=!0,this.triggerValueChanged())}triggerValueChanged(){this.valueChangedCallbacks.forEach((e=>{e(this)}))}addValueChangedCallback(e){e?(this.valueChangedCallbacks.push(e),i(this,to)[to].hasVarsRequestCompleted()&&e(this)):console.log("Invalid callback parameter provided.")}removeValueChangedCallback(e){const t=this.valueChangedCallbacks.indexOf(e);-1!==t&&this.valueChangedCallbacks.splice(t,1)}clearStartFlag(){this.hadStarted=!1}}var oo=t("logger"),no=t("account"),so=t("request"),ro=t("event"),ao=t("variables"),lo=t("remoteVariables"),co=t("fetchCallback"),ho=t("variablesChangedCallbacks"),uo=t("oneTimeVariablesChangedCallbacks"),po=t("hasVarsRequestCompleted"),go=t("runVariablesChangedCallback");class fo{constructor(e){let{logger:t,request:o,account:n,event:s}=e;Object.defineProperty(this,go,{value:vo}),Object.defineProperty(this,oo,{writable:!0,value:void 0}),Object.defineProperty(this,no,{writable:!0,value:void 0}),Object.defineProperty(this,so,{writable:!0,value:void 0}),Object.defineProperty(this,ro,{writable:!0,value:void 0}),Object.defineProperty(this,ao,{writable:!0,value:void 0}),Object.defineProperty(this,lo,{writable:!0,value:void 0}),Object.defineProperty(this,co,{writable:!0,value:void 0}),Object.defineProperty(this,ho,{writable:!0,value:void 0}),Object.defineProperty(this,uo,{writable:!0,value:void 0}),Object.defineProperty(this,po,{writable:!0,value:!1}),i(this,oo)[oo]=t,i(this,no)[no]=n,i(this,so)[so]=o,i(this,ro)[ro]=s,i(this,ao)[ao]={},i(this,lo)[lo]={},i(this,ho)[ho]=[],i(this,uo)[uo]=[],le.variableStore=this}registerVariable(e){const{name:t}=e;i(this,ao)[ao][t]=e,console.log("registerVariable",i(this,ao)[ao])}getVariable(e){return i(this,ao)[ao][e]}hasVarsRequestCompleted(){return i(this,po)[po]}syncVariables(e,t){if(!i(this,no)[no].token){const e="Account token is missing.";return i(this,oo)[oo].error(e),Promise.reject(new Error(e))}const o={type:"varsPayload",vars:{}};for(const e in i(this,ao)[ao])o.vars[e]={defaultValue:i(this,ao)[ao][e].defaultValue,type:i(this,ao)[ao][e].type};if(0===Object.keys(o.vars).length){const e="No variables are defined.";return i(this,oo)[oo].error(e),Promise.reject(new Error(e))}let n={};n=i(this,so)[so].addSystemDataToObject(n,void 0),n.tk=i(this,no)[no].token,n.type="meta";const s=JSON.stringify([n,o]),r=i(this,no)[no].dataPostPEURL;return i(this,so)[so].post(r,s).then((t=>(e&&"function"==typeof e&&e(t),t))).catch((e=>{throw t&&"function"==typeof t&&t(e),400===e.status?i(this,oo)[oo].error("Invalid sync payload or clear the existing draft"):401===e.status?i(this,oo)[oo].error("This is not a test profile"):i(this,oo)[oo].error("Sync variable failed"),e}))}fetchVariables(e){i(this,ro)[ro].push(K,{t:4}),e&&"function"==typeof e&&(i(this,co)[co]=e)}mergeVariables(e){console.log("msg vars is ",e),i(this,po)[po]=!0,ae.saveToLSorCookie("WZRK_PE",e),i(this,lo)[lo]=e;for(const t in i(this,ao)[ao])e.hasOwnProperty(t)&&i(this,ao)[ao][t].update(e[t]);i(this,co)[co]&&i(this,co)[co](),i(this,go)[go]()}addVariablesChangedCallback(e){e&&"function"==typeof e?(i(this,ho)[ho].push(e),this.hasVarsRequestCompleted()&&e()):i(this,oo)[oo].error("callback is not a function")}addOneTimeVariablesChangedCallback(e){e&&"function"==typeof e&&(this.hasVarsRequestCompleted()?e():i(this,uo)[uo].push(e))}removeVariablesChangedCallback(e){const t=i(this,ho)[ho].indexOf(e);-1!==t&&i(this,ho)[ho].splice(t,1)}removeOneTimeVariablesChangedCallback(e){const t=i(this,uo)[uo].indexOf(e);-1!==t&&i(this,uo)[uo].splice(t,1)}}var vo=function(){for(var e of i(this,ho)[ho])e();for(var t of i(this,uo)[uo])t();i(this,uo)[uo].length=0},bo=t("logger"),mo=t("api"),yo=t("onloadcalled"),wo=t("device"),Co=t("session"),ko=t("account"),xo=t("request"),Po=t("variableStore"),So=t("isSpa"),Io=t("previousUrl"),Oo=t("boundCheckPageChanged"),_o=t("dismissSpamControl"),Eo=t("processOldValues"),Ao=t("debounce"),Lo=t("checkPageChanged"),Mo=t("handleMessageEvent"),To=t("pingRequest"),Ro=t("isPingContinuous"),jo=t("overrideDSyncFlag");var Do=function(){this.onUserLogin._processOldValues(),this.privacy._processOldValues(),this.event._processOldValues(),this.profile._processOldValues(),this.notifications._processOldValues()},zo=function(e){let t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300;return function(){clearTimeout(t),t=setTimeout(e,i)}},Bo=function(){i(this,Ao)[Ao]((()=>{i(this,Io)[Io]!==location.href&&this.pageChanged()}))()},No=function(e){var t;e.data&&e.data.message&&("Dashboard"===e.data.message&&e.data.url?Jt(e.data.url,null!==(t=e.data.variant)&&void 0!==t?t:null):"Overlay"===e.data.message&&$t(e.data,!0))},Fo=function(){let e=i(this,ko)[ko].dataPostURL,t={};t=i(this,xo)[xo].addSystemDataToObject(t,void 0),e=Ve(e,"type","ping"),e=Ve(e,"d",Ke(JSON.stringify(t),i(this,bo)[bo])),i(this,xo)[xo].saveAndFireRequest(e,le.blockRequest)},Uo=function(){return void 0!==window.wzrk_d&&"continuous"===window.wzrk_d.ping},qo=function(e){this._isPersonalisationActive()&&(e.dsync=!0)};const Vo=new class{get spa(){return i(this,So)[So]}set spa(e){const t=!0===e;i(this,So)[So]!==t&&1===i(this,yo)[yo]&&(t?document.addEventListener("click",i(this,Oo)[Oo]):document.removeEventListener("click",i(this,Oo)[Oo])),i(this,So)[So]=t}get dismissSpamControl(){return i(this,_o)[_o]}set dismissSpamControl(e){const t=!0===e;i(this,_o)[_o]=t,le.dismissSpamControl=t}constructor(){var e,t,o,n,s;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.defineProperty(this,jo,{value:qo}),Object.defineProperty(this,Ro,{value:Uo}),Object.defineProperty(this,To,{value:Fo}),Object.defineProperty(this,Mo,{value:No}),Object.defineProperty(this,Lo,{value:Bo}),Object.defineProperty(this,Ao,{value:zo}),Object.defineProperty(this,Eo,{value:Do}),Object.defineProperty(this,bo,{writable:!0,value:void 0}),Object.defineProperty(this,mo,{writable:!0,value:void 0}),Object.defineProperty(this,yo,{writable:!0,value:void 0}),Object.defineProperty(this,wo,{writable:!0,value:void 0}),Object.defineProperty(this,Co,{writable:!0,value:void 0}),Object.defineProperty(this,ko,{writable:!0,value:void 0}),Object.defineProperty(this,xo,{writable:!0,value:void 0}),Object.defineProperty(this,Po,{writable:!0,value:void 0}),Object.defineProperty(this,So,{writable:!0,value:void 0}),Object.defineProperty(this,Io,{writable:!0,value:void 0}),Object.defineProperty(this,Oo,{writable:!0,value:i(this,Lo)[Lo].bind(this)}),Object.defineProperty(this,_o,{writable:!0,value:void 0}),this.enablePersonalization=void 0,this.popupCallbacks={},this.popupCurrentWzrkId="",i(this,yo)[yo]=0,this._isPersonalisationActive=this._isPersonalisationActive.bind(this),this.raiseNotificationClicked=()=>{},i(this,bo)[bo]=new ai(ti),i(this,ko)[ko]=new d(null===(e=r.account)||void 0===e?void 0:e[0],r.region||(null===(t=r.account)||void 0===t?void 0:t[1]),r.targetDomain||(null===(o=r.account)||void 0===o?void 0:o[2]),r.token||(null===(n=r.account)||void 0===n?void 0:n[3])),i(this,wo)[wo]=new ye({logger:i(this,bo)[bo]}),i(this,_o)[_o]=r.dismissSpamControl||!1,i(this,Co)[Co]=new pi({logger:i(this,bo)[bo],isPersonalisationActive:this._isPersonalisationActive}),i(this,xo)[xo]=new xi({logger:i(this,bo)[bo],account:i(this,ko)[ko],device:i(this,wo)[wo],session:i(this,Co)[Co],isPersonalisationActive:this._isPersonalisationActive}),this.enablePersonalization=r.enablePersonalization||!1,this.event=new Fe({logger:i(this,bo)[bo],request:i(this,xo)[xo],isPersonalisationActive:this._isPersonalisationActive},r.event),this.profile=new gt({logger:i(this,bo)[bo],request:i(this,xo)[xo],account:i(this,ko)[ko],isPersonalisationActive:this._isPersonalisationActive},r.profile),this.onUserLogin=new It({request:i(this,xo)[xo],account:i(this,ko)[ko],session:i(this,Co)[Co],logger:i(this,bo)[bo],device:i(this,wo)[wo]},r.onUserLogin),this.privacy=new Ai({request:i(this,xo)[xo],account:i(this,ko)[ko],logger:i(this,bo)[bo]},r.privacy),this.notifications=new Gi({logger:i(this,bo)[bo],request:i(this,xo)[xo],account:i(this,ko)[ko]},r.notifications),i(this,Po)[Po]=new fo({logger:i(this,bo)[bo],request:i(this,xo)[xo],account:i(this,ko)[ko],event:this.event}),i(this,mo)[mo]=new be({logger:i(this,bo)[bo],request:i(this,xo)[xo],device:i(this,wo)[wo],session:i(this,Co)[Co]}),this.spa=r.spa,this.dismissSpamControl=r.dismissSpamControl,this.user=new Xt({isPersonalisationActive:this._isPersonalisationActive}),this.session={getTimeElapsed:()=>i(this,Co)[Co].getTimeElapsed(),getPageCount:()=>i(this,Co)[Co].getPageCount()},this.logout=()=>{i(this,bo)[bo].debug("logout called"),ae.setInstantDeleteFlagInK()},this.clear=()=>{this.onUserLogin.clear()},this.getCleverTapID=()=>i(this,wo)[wo].getGuid(),this.getAccountID=()=>i(this,ko)[ko].id,this.getSCDomain=()=>i(this,ko)[ko].finalTargetDomain,this.setLibrary=(e,t)=>{le.flutterVersion={[e]:t}},this.setSCSDKVersion=e=>{i(this,ko)[ko].scSDKVersion=e;const t={};t.af={scv:"sc-sdk-v"+i(this,ko)[ko].scSDKVersion};let o=i(this,ko)[ko].dataPostURL;o=Ve(o,"type","page"),o=Ve(o,"d",Ke(JSON.stringify(t),i(this,bo)[bo])),i(this,xo)[xo].saveAndFireRequest(o,le.blockRequest)},Kt()&&(qt(),Ut(i(this,bo)[bo])),this.getInboxMessageCount=()=>{const e=Nt();return Object.keys(e).length},this.getInboxMessageUnreadCount=()=>{if(le.inbox)return le.inbox.unviewedCounter;i(this,bo)[bo].debug("No unread messages")},this.getAllInboxMessages=()=>Nt(),this.getUnreadInboxMessages=()=>{if(le.inbox)return le.inbox.unviewedMessages;i(this,bo)[bo].debug("No unread messages")},this.getInboxMessageForId=e=>{const t=Nt();if((null!==e||""!==e)&&t.hasOwnProperty(e))return t[e];i(this,bo)[bo].error("No message available for message Id "+e)},this.deleteInboxMessage=e=>{const t=Nt();if(null===e&&""===e||!t.hasOwnProperty(e))i(this,bo)[bo].error("No message available for message Id "+e);else{const i=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);0===t[e].viewed&&(le.inbox.unviewedCounter--,delete le.inbox.unviewedMessages[e],document.getElementById("unviewedBadge").innerText=le.inbox.unviewedCounter,document.getElementById("unviewedBadge").style.display=le.inbox.unviewedCounter>0?"flex":"none"),i&&i.remove(),delete t[e],Ft(t)}},this.markReadInboxMessage=e=>{const t=le.inbox.unviewedMessages,o=Nt();if(null===e&&""===e||!t.hasOwnProperty(e))i(this,bo)[bo].error("No message available for message Id "+e);else{const t=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);if(null!==t&&(t.shadowRoot.getElementById("unreadMarker").style.display="none"),o[e].viewed=1,document.getElementById("unviewedBadge")){var n=parseInt(document.getElementById("unviewedBadge").innerText)-1;document.getElementById("unviewedBadge").innerText=n,document.getElementById("unviewedBadge").style.display=n>0?"flex":"none"}window.clevertap.renderNotificationViewed({msgId:o[e].wzrk_id,pivotId:o[e].pivotId}),le.inbox.unviewedCounter--,delete le.inbox.unviewedMessages[e],Ft(o)}},this.markReadInboxMessagesForIds=e=>{if(Array.isArray(e))for(var t=0;t{const e=le.inbox.unviewedMessages,t=Nt();if(Object.keys(e).length>0){Object.keys(e).forEach((e=>{const i=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);null!==i&&(i.shadowRoot.getElementById("unreadMarker").style.display="none"),t[e].viewed=1,window.clevertap.renderNotificationViewed({msgId:t[e].wzrk_id,pivotId:t[e].wzrk_pivot})})),document.getElementById("unviewedBadge").innerText=0,document.getElementById("unviewedBadge").style.display="none",Ft(t),le.inbox.unviewedCounter=0,le.inbox.unviewedMessages={}}else i(this,bo)[bo].debug("All messages are already read")},this.toggleInbox=e=>{var t;return null===(t=le.inbox)||void 0===t?void 0:t.toggleInbox(e)},this.renderNotificationViewed=e=>{a(R,e)},this.renderNotificationClicked=e=>{a(j,e)};const a=(e,t)=>{if(!t||!t.msgId)return;const o={type:"event"};if(o.evtName=e,o.evtData={[T]:t.msgId},t.pivotId&&(o.evtData={...o.evtData,wzrk_pivot:t.pivotId}),t.wzrk_slideNo&&(o.evtData={...o.evtData,wzrk_slideNo:t.wzrk_slideNo}),t.kv&&null!==t.kv&&void 0!==t.kv)for(const e in t.kv)e.startsWith(M)&&(o.evtData={...o.evtData,[e]:t.kv[e]});if(t.msgCTkv&&null!==t.msgCTkv&&void 0!==t.msgCTkv)for(const e in t.msgCTkv)e.startsWith(M)&&(o.evtData={...o.evtData,[e]:t.msgCTkv[e]});i(this,xo)[xo].processEvent(o)};this.setLogLevel=e=>{i(this,bo)[bo].logLevel=Number(e),3===e?sessionStorage.WZRK_D="":delete sessionStorage.WZRK_D},this.handleIncrementValue=(e,t)=>{this.profile._handleIncrementDecrementValue(e,t,B)},this.handleDecrementValue=(e,t)=>{this.profile._handleIncrementDecrementValue(e,t,"$decr")},this.setMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueSet(e,t,"$set"):console.error("setMultiValuesForKey should be called with a value of type array")},this.addMultiValueForKey=(e,t)=>{"string"==typeof t||"number"==typeof t?this.profile._handleMultiValueAdd(e,t,N):console.error("addMultiValueForKey should be called with a value of type string or number.")},this.addMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueAdd(e,t,N):console.error("addMultiValuesForKey should be called with a value of type array.")},this.removeMultiValueForKey=(e,t)=>{"string"==typeof t||"number"==typeof t?this.profile._handleMultiValueRemove(e,t,F):console.error("removeMultiValueForKey should be called with a value of type string or number.")},this.removeMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueRemove(e,t,F):console.error("removeMultiValuesForKey should be called with a value of type array.")},this.removeValueForKey=e=>{this.profile._handleMultiValueDelete(e,U)};const l=(e,t,o)=>{((e,t,i,o,n)=>{const s=qe(location.href),r=s.e,a=s.p,l=s.page_type;if(void 0!==r){const s={};s.id=o.id,s.unsubGroups=le.unsubGroups,le.updatedCategoryLong&&(s.cUsY=le.updatedCategoryLong);let c=o.emailURL;i&&(c=Ve(c,"fetchGroups",i)),t&&(c=Ve(c,"encoded",t)),c=Ve(c,"e",r),c=Ve(c,"d",Ke(JSON.stringify(s),n)),a&&(c=Ve(c,"p",a)),"-1"!==e&&(c=Ve(c,"sub",e)),l&&(le.globalUnsubscribe=l===I,c=Ve(c,"page_type",l)),Qe.fireRequest(c)}})(e,t,o,i(this,ko)[ko],i(this,bo)[bo])};function c(e){var t=e.coords.latitude,i=e.coords.longitude;le.location={Latitude:t,Longitude:i},this.sendLocationData({Latitude:t,Longitude:i})}function h(e){switch(e.code){case e.PERMISSION_DENIED:console.log("User denied the request for Geolocation.");break;case e.POSITION_UNAVAILABLE:console.log("Location information is unavailable.");break;case e.TIMEOUT:console.log("The request to get user location timed out.");break;case e.UNKNOWN_ERROR:console.log("An unknown error occurred.")}}this.getLocation=function(e,t){if(e&&"number"!=typeof e||t&&"number"!=typeof t)console.log("Latitude and Longitude must be of number type");else if(e&&t){if(e<=-90||e>90)return void console.log("A vaid latitude must range between -90 and 90");if(t<=-180||t>180)return void console.log("A valid longitude must range between -180 and 180");le.location={Latitude:e,Longitude:t},this.sendLocationData({Latitude:e,Longitude:t})}else navigator.geolocation?navigator.geolocation.getCurrentPosition(c.bind(this),h):console.log("Geolocation is not supported by this browser.")};const u=i(this,mo)[mo];u.logout=this.logout,u.clear=this.clear,u.closeIframe=(e,t)=>{at(e,0,i(this,Co)[Co].sessionId)},u.enableWebPush=(e,t)=>{this.notifications._enableWebPush(e,t)},u.tr=e=>{Yt(e,{device:i(this,wo)[wo],session:i(this,Co)[Co],request:i(this,xo)[xo],logger:i(this,bo)[bo]})},u.setEnum=e=>{((e,t)=>{if(H(e)||Q(e))return"$E_"+e;t.error(Ae)})(e,i(this,bo)[bo])},u.is_onloadcalled=()=>1===i(this,yo)[yo],u.subEmail=e=>{l("1",e)},u.getEmail=(e,t)=>{l("-1",e,t)},u.unSubEmail=e=>{l("0",e)},u.unsubEmailGroups=e=>{le.unsubGroups=[];const t=document.getElementsByClassName("ct-unsub-group-input-item");for(let e=0;e{le.unsubGroups=e},u.getSubscriptionGroups=()=>le.unsubGroups,u.changeSubscriptionGroups=(e,t)=>{u.setSubscriptionGroups(t),l("2",e)},u.isGlobalUnsubscribe=()=>le.globalUnsubscribe,u.setIsGlobalUnsubscribe=e=>{le.globalUnsubscribe=e},u.setUpdatedCategoryLong=e=>{e.cUsY&&(le.updatedCategoryLong=e.cUsY)},window.$CLTP_WR=window.$WZRK_WR=u,(null===(s=r.account)||void 0===s?void 0:s[0].id)&&this.init()}init(e,t,o,n){if(1===i(this,yo)[yo])return;if(ae.removeCookie("WZRK_P",window.location.hostname),!i(this,ko)[ko].id){if(!e)return void i(this,bo)[bo].error(ke);i(this,ko)[ko].id=e}i(this,Co)[Co].cookieName="WZRK_S_"+i(this,ko)[ko].id,t&&(i(this,ko)[ko].region=t),o&&(i(this,ko)[ko].targetDomain=o),n&&(i(this,ko)[ko].token=n);const s=location.href,r=qe(s.toLowerCase());if(void 0!==r.e&&"0"==r.wzrk_ex)return;le.isPrivacyArrPushed=!0,le.privacyArray.length>0&&this.privacy.push(le.privacyArray),i(this,Eo)[Eo](),this.pageChanged();const a=setInterval((()=>{i(this,wo)[wo].gcookie&&(clearInterval(a),i(this,xo)[xo].processBackupEvents())}),3e3);i(this,So)[So]?document.addEventListener("click",i(this,Oo)[Oo]):document.removeEventListener("click",i(this,Oo)[Oo]),i(this,yo)[yo]=1}pageChanged(){const e=window.location.search,t=window.opener;if("?ctBuilder"===e)return console.log("open in visual builder mode"),window.addEventListener("message",i(this,Mo)[Mo],!1),void(t&&t.postMessage("builder","*"));if("?ctBuilderPreview"===e)return window.addEventListener("message",i(this,Mo)[Mo],!1),void(t&&t.postMessage("preview","*"));const o=window.location.href,n=qe(o.toLowerCase()),s=i(this,Co)[Co].getSessionCookieObject();let r=void 0===s.p?0:s.p;s.p=++r,i(this,Co)[Co].setSessionCookieObject(s);let a={},l=(e=>{if(""===e)return"";var t=document.createElement("a");return t.href=e,t.hostname})(document.referrer);if(window.location.hostname!==l){const e=120;""!==l&&(l=l.length>e?l.substring(0,e):l,a.referrer=l);let t=n.utm_source||n.wzrk_source;void 0!==t&&(t=t.length>e?t.substring(0,e):t,a.us=t);let i=n.utm_medium||n.wzrk_medium;void 0!==i&&(i=i.length>e?i.substring(0,e):i,a.um=i);let o=n.utm_campaign||n.wzrk_campaign;if(void 0!==o&&(o=o.length>e?o.substring(0,e):o,a.uc=o),void 0!==n.wzrk_medium){const e=n.wzrk_medium;e.match(/^email$|^social$|^search$/)&&(a.wm=e)}}a=i(this,xo)[xo].addSystemDataToObject(a,void 0),a.cpg=o,a.WZRK_CAMP=it();let c=i(this,ko)[ko].dataPostURL;i(this,xo)[xo].addFlags(a),1===parseInt(a.pg)&&i(this,jo)[jo](a),c=Ve(c,"type","page"),c=Ve(c,"d",Ke(JSON.stringify(a),i(this,bo)[bo])),i(this,xo)[xo].saveAndFireRequest(c,le.blockRequest),1===parseInt(a.pg)&&this.event.push(K,{t:4}),i(this,Io)[Io]=o,setTimeout((()=>{r<=3&&i(this,To)[To](),i(this,Ro)[Ro]()&&setInterval((()=>{i(this,To)[To]()}),3e5)}),12e4)}_isPersonalisationActive(){return ae._isLocalStorageSupported()&&this.enablePersonalization}set popupCallback(e){this.popupCallbacks[this.popupCurrentWzrkId]=e}sendLocationData(e){let t={af:{}};const o={};if(t.type="profile",null==o.tz&&(o.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),t.profile=o,e){Object.keys(e).forEach((i=>{t.af[i]=e[i]}))}le.location&&(t.af={...t.af,...le.location}),t=i(this,xo)[xo].addSystemDataToObject(t,!0),i(this,xo)[xo].addFlags(t);const n=Ke(JSON.stringify(t),i(this,bo)[bo]);let s=i(this,ko)[ko].dataPostURL;s=Ve(s,"type",A),s=Ve(s,"d",n),i(this,xo)[xo].saveAndFireRequest(s,le.blockRequest)}setOffline(e){"boolean"==typeof e?(le.offline=e,e||i(this,xo)[xo].processBackupEvents()):console.error("setOffline should be called with a value of type boolean")}defineVariable(e,t){return io.define(e,t,i(this,Po)[Po])}syncVariables(e,t){if(4===i(this,bo)[bo].logLevel)return i(this,Po)[Po].syncVariables(e,t);{const e="App log level is not set to 4";return i(this,bo)[bo].error(e),Promise.reject(new Error(e))}}fetchVariables(e){i(this,Po)[Po].fetchVariables(e)}addVariablesChangedCallback(e){i(this,Po)[Po].addVariablesChangedCallback(e)}addOneTimeVariablesChangedCallback(e){i(this,Po)[Po].addOneTimeVariablesChangedCallback(e)}}(window.clevertap);return window.clevertap=window.wizrocket=Vo,Vo})); diff --git a/src/clevertap.js b/src/clevertap.js index 1d8ef5e8..fcf603e3 100644 --- a/src/clevertap.js +++ b/src/clevertap.js @@ -675,16 +675,22 @@ export default class CleverTap { pageChanged () { const search = window.location.search + const parentWindow = window.opener + if (search === '?ctBuilder') { // open in visual builder mode console.log('open in visual builder mode') window.addEventListener('message', this.#handleMessageEvent, false) - window.postMessage('builder', '*') + if (parentWindow) { + parentWindow.postMessage('builder', '*') + } return } if (search === '?ctBuilderPreview') { window.addEventListener('message', this.#handleMessageEvent, false) - window.postMessage('preview', '*') + if (parentWindow) { + parentWindow.postMessage('preview', '*') + } return } From 4dd526ba9456bcf7f5ae5802520a14620ecd10d9 Mon Sep 17 00:00:00 2001 From: KambleSonam Date: Fri, 10 May 2024 12:46:11 +0530 Subject: [PATCH 06/19] builder preview fix --- clevertap.js | 2 +- clevertap.js.map | 2 +- clevertap.min.js | 2 +- src/modules/visualBuilder/pageBuilder.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/clevertap.js b/clevertap.js index d916d549..0a529db2 100644 --- a/clevertap.js +++ b/clevertap.js @@ -4575,7 +4575,7 @@ } const renderVisualBuilder = (targetingMsgJson, isPreview) => { - const details = targetingMsgJson.display.details[0]; + const details = isPreview ? targetingMsgJson[0] : targetingMsgJson.display.details[0]; const siteUrl = Object.keys(details)[0]; const selectors = details[siteUrl]; diff --git a/clevertap.js.map b/clevertap.js.map index 81ca4706..1a838a49 100644 --- a/clevertap.js.map +++ b/clevertap.js.map @@ -1 +1 @@ -{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/modules/visualBuilder/pageBuilder.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/notification.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {}\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n // Initialize array\n var array = []\n\n // Check if globalProfileMap is null, initialize if needed\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n // Check if the value to be set is either string or number\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = $ct.globalProfileMap[propKey]\n array.push(typeof propVal === 'number' ? propVal : propVal.toLowerCase())\n } else {\n $ct.globalProfileMap[propKey] = propVal\n }\n } else {\n // Check if propVal is an array\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = Array.isArray($ct.globalProfileMap[propKey]) ? $ct.globalProfileMap[propKey] : [$ct.globalProfileMap[propKey]]\n }\n\n // Check for case-sensitive inputs and filter the same ones\n for (var i = 0; i < propVal.length; i++) {\n if (typeof propVal[i] === 'number' && !array.includes(propVal[i])) {\n array.push(propVal[i])\n } else if (typeof propVal[i] === 'string' && !array.includes(propVal[i].toLowerCase())) {\n array.push(propVal[i].toLowerCase())\n } else if ((typeof propVal[i] === 'number' && array.includes(propVal[i])) || (typeof propVal[i] === 'string' && array.includes(propVal[i].toLowerCase()))) {\n console.error('Values already included')\n } else {\n console.error('Array supports only string or number type values')\n }\n }\n\n // Update globalProfileMap with the array\n $ct.globalProfileMap[propKey] = array\n }\n\n // Save to local storage or cookie\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Call the sendMultiValueData function\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n var index = $ct.globalProfileMap[propKey].indexOf(propVal)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n } else {\n for (var k = 0; k < propVal.length; k++) {\n var idx = $ct.globalProfileMap[propKey].indexOf(propVal[k])\n if (idx !== -1) {\n $ct.globalProfileMap[propKey].splice(idx, 1)\n }\n }\n }\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n // console.log('Raise notification clicked event for ', item)\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","export const initialiseCTBuilder = (url, variant) => {\n document.addEventListener('DOMContentLoaded', () => onContentLoad(url, variant))\n}\n\nlet container\n\nfunction onContentLoad (url, variant) {\n document.body.innerHTML = ''\n container = document.createElement('div')\n container.id = 'overlayDiv'\n container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form\n container.style.display = 'flex'\n document.body.appendChild(container)\n const overlayPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js'\n loadOverlayScript(overlayPath, url, variant)\n .then(() => {\n console.log('Overlay script loaded successfully.')\n })\n .catch((error) => {\n console.error('Error loading overlay script:', error)\n })\n loadCSS()\n loadTypeKit()\n}\n\nfunction loadCSS () {\n var link = document.createElement('link')\n link.rel = 'stylesheet'\n link.type = 'text/css'\n link.href = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css'\n document.head.appendChild(link)\n}\n\nfunction loadOverlayScript (overlayPath, url, variant) {\n return new Promise((resolve, reject) => {\n var script = document.createElement('script')\n script.type = 'module'\n script.src = overlayPath\n script.onload = function () {\n if (typeof window.Overlay === 'function') {\n window.Overlay('#overlayDiv', url, variant)\n resolve()\n } else {\n reject(new Error('ContentLayout not found in overlay.js'))\n }\n }\n script.onerror = function (error) {\n reject(error)\n }\n document.head.appendChild(script)\n })\n}\n\nfunction loadTypeKit () {\n var config = {\n kitId: 'eqj6nom',\n scriptTimeout: 3000,\n async: true\n }\n\n var d = document\n var h = d.documentElement\n var t = setTimeout(function () {\n h.className = h.className.replace(/\\bwf-loading\\b/g, '') + ' wf-inactive'\n // $(document).trigger(\"TypeKitReady\");\n }, config.scriptTimeout)\n var tk = d.createElement('script')\n var f = false\n var s = d.getElementsByTagName('script')[0]\n var a\n\n h.className += ' wf-loading'\n tk.src = 'https://use.typekit.net/' + config.kitId + '.js'\n tk.async = true\n tk.onload = tk.onreadystatechange = function () {\n a = this.readyState\n if (f || (a && a !== 'complete' && a !== 'loaded')) return\n f = true\n clearTimeout(t)\n try {\n // eslint-disable-next-line no-undef\n Typekit.load(config)\n } catch (e) {}\n }\n\n s.parentNode.insertBefore(tk, s)\n}\n\nexport const renderVisualBuilder = (targetingMsgJson, isPreview) => {\n const details = targetingMsgJson.display.details[0]\n const siteUrl = Object.keys(details)[0]\n const selectors = details[siteUrl]\n\n if (siteUrl === window.location.href) {\n for (const selector in selectors) {\n const element = document.querySelector(selector)\n if (element) {\n if (selectors[selector].html) {\n element.outerHTML = selectors[selector].html\n } else {\n // Update json data\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n } else {\n let count = 0\n const intervalId = setInterval(() => {\n const retryElement = document.querySelector(selector)\n if (retryElement) {\n if (selectors[selector].html) {\n retryElement.outerHTML = selectors[selector].html\n } else {\n // Update json data\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n clearInterval(intervalId)\n } else {\n count++\n if (count >= 20) {\n console.log(`No element present on DOM with selector '${selector}'.`)\n clearInterval(intervalId)\n }\n }\n }, 500)\n }\n }\n }\n}\n// function addOverlayScript (overlayPath) {\n// const scriptTag = document.createElement('script')\n// scriptTag.setAttribute('type', 'text/javascript')\n// scriptTag.setAttribute('id', 'wzrk-alert-js')\n// scriptTag.setAttribute('src', overlayPath)\n// document.getElementsByTagName('body')[0].appendChild(scriptTag)\n// return scriptTag\n// }\n","import {\n addToLocalProfileMap,\n arp,\n getCampaignObject,\n saveCampaignObject,\n closeIframe\n} from './clevertap'\n\nimport {\n CAMP_COOKIE_NAME,\n DISPLAY,\n GLOBAL,\n EV_COOKIE,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n WZRK_PREFIX,\n WZRK_ID,\n CAMP_COOKIE_G,\n GCOOKIE_NAME\n} from './constants'\n\nimport {\n getNow,\n getToday\n} from './datetime'\n\nimport {\n compressToBase64\n} from './encoder'\n\nimport { StorageManager, $ct } from './storage'\nimport RequestDispatcher from './requestDispatcher'\nimport { CTWebPersonalisationBanner } from './web-personalisation/banner'\nimport { CTWebPersonalisationCarousel } from './web-personalisation/carousel'\nimport { CTWebPopupImageOnly } from './web-popupImageonly/popupImageonly'\nimport { checkAndRegisterWebInboxElements, initializeWebInbox, processWebInboxSettings, hasWebInboxSettingsInLS, processInboxNotifs } from '../modules/web-inbox/helper'\nimport { renderVisualBuilder } from '../modules/visualBuilder/pageBuilder'\n\nconst _tr = (msg, {\n device,\n session,\n request,\n logger\n}) => {\n const _device = device\n const _session = session\n const _request = request\n const _logger = logger\n let _wizCounter = 0\n\n // msg = {\n // arp: {\n // j_n: 'Zw==',\n // i_n: 'Y2NmewICAw==',\n // d_ts: 0,\n // dh: 0,\n // v: 1,\n // j_s: '{ }',\n // id: 'WWW-WWW-WWRZ',\n // e_ts: 0,\n // r_ts: 1649748826,\n // rc_w: 60,\n // rc_n: 5\n // },\n // inapp_notifs: [\n // {\n // msgContent: {\n // templateType: 'point-and-click',\n // type: 4\n // },\n // display: {\n // divId: 'hero-banner',\n // details: [{\n // 'http://localhost:3000/': {\n // '.heroDi1v': {\n // html: 'Hello Sonam'\n // },\n // '#selector_2': {\n // html: '

Hello Sonam

'\n // },\n // '.heroDiv2': {\n // json: {\n // name: 'Sonam',\n // identity: 1234\n // }\n // }\n // }\n // }],\n // wtarget_type: 2,\n // wmc: 1,\n // ff: 'Desktop'\n // },\n // wzrk_id: '1655316906_20220620',\n // wzrk_pivot: 'wzrk_default'\n // }\n // ]\n // }\n // Campaign House keeping\n const doCampHouseKeeping = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const today = getToday()\n\n const incrCount = (obj, campaignId, excludeFromFreqCaps) => {\n let currentCount = 0\n let totalCount = 0\n if (obj[campaignId] != null) {\n currentCount = obj[campaignId]\n }\n currentCount++\n if (obj.tc != null) {\n totalCount = obj.tc\n }\n // if exclude from caps then dont add to total counts\n if (excludeFromFreqCaps < 0) {\n totalCount++\n }\n\n obj.tc = totalCount\n obj[campaignId] = currentCount\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n delete sessionStorage[CAMP_COOKIE_NAME]\n var campTypeObj = {}\n const campObj = getCampaignObject()\n if (targetingMsgJson.display.wtarget_type === 3 && campObj.hasOwnProperty('wi')) {\n campTypeObj = campObj.wi\n } else if ((targetingMsgJson.display.wtarget_type === 0 || targetingMsgJson.display.wtarget_type === 1) && campObj.hasOwnProperty('wp')) {\n campTypeObj = campObj.wp\n } else {\n campTypeObj = {}\n }\n if (campObj.hasOwnProperty('global')) {\n campTypeObj.wp = campObj\n }\n // global session limit. default is 1\n if (targetingMsgJson[DISPLAY].wmc == null) {\n targetingMsgJson[DISPLAY].wmc = 1\n }\n\n // global session limit for web inbox. default is 1\n if (targetingMsgJson[DISPLAY].wimc == null) {\n targetingMsgJson[DISPLAY].wimc = 1\n }\n\n var excludeFromFreqCaps = -1 // efc - Exclude from frequency caps\n let campaignSessionLimit = -1 // mdc - Once per session\n let campaignDailyLimit = -1 // tdc - Once per day\n let campaignTotalLimit = -1 // tlc - Once per user for the duration of campaign\n let totalDailyLimit = -1\n let totalSessionLimit = -1 // wmc - Web Popup Global Session Limit\n let totalInboxSessionLimit = -1 // wimc - Web Inbox Global Session Limit\n\n if (targetingMsgJson[DISPLAY].efc != null) { // exclude from frequency cap\n excludeFromFreqCaps = parseInt(targetingMsgJson[DISPLAY].efc, 10)\n }\n if (targetingMsgJson[DISPLAY].mdc != null) { // Campaign Session Limit\n campaignSessionLimit = parseInt(targetingMsgJson[DISPLAY].mdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tdc != null) { // No of web popups in a day per campaign\n campaignDailyLimit = parseInt(targetingMsgJson[DISPLAY].tdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tlc != null) { // Total lifetime count\n campaignTotalLimit = parseInt(targetingMsgJson[DISPLAY].tlc, 10)\n }\n if (targetingMsgJson[DISPLAY].wmp != null) { // No of campaigns per day\n totalDailyLimit = parseInt(targetingMsgJson[DISPLAY].wmp, 10)\n }\n if (targetingMsgJson[DISPLAY].wmc != null) { // No of campaigns per session\n totalSessionLimit = parseInt(targetingMsgJson[DISPLAY].wmc, 10)\n }\n\n if (targetingMsgJson[DISPLAY].wimc != null) { // No of inbox campaigns per session\n totalInboxSessionLimit = parseInt(targetingMsgJson[DISPLAY].wimc, 10)\n }\n // session level capping\n var sessionObj = campTypeObj[_session.sessionId]\n if (sessionObj) {\n const campaignSessionCount = sessionObj[campaignId]\n const totalSessionCount = sessionObj.tc\n // dnd\n if (campaignSessionCount === 'dnd' && !$ct.dismissSpamControl) {\n return false\n }\n\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n // Inbox session\n if (totalInboxSessionLimit > 0 && totalSessionCount >= totalInboxSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n } else {\n // session\n if (totalSessionLimit > 0 && totalSessionCount >= totalSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n }\n\n // campaign session\n if (campaignSessionLimit > 0 && campaignSessionCount >= campaignSessionLimit) {\n return false\n }\n } else {\n sessionObj = {}\n campTypeObj[_session.sessionId] = sessionObj\n }\n\n // daily level capping\n var dailyObj = campTypeObj[today]\n if (dailyObj != null) {\n const campaignDailyCount = dailyObj[campaignId]\n const totalDailyCount = dailyObj.tc\n // daily\n if (totalDailyLimit > 0 && totalDailyCount >= totalDailyLimit && excludeFromFreqCaps < 0) {\n return false\n }\n // campaign daily\n if (campaignDailyLimit > 0 && campaignDailyCount >= campaignDailyLimit) {\n return false\n }\n } else {\n dailyObj = {}\n campTypeObj[today] = dailyObj\n }\n\n var globalObj = campTypeObj[GLOBAL]\n if (globalObj != null) {\n const campaignTotalCount = globalObj[campaignId]\n // campaign total\n if (campaignTotalLimit > 0 && campaignTotalCount >= campaignTotalLimit) {\n return false\n }\n } else {\n globalObj = {}\n campTypeObj[GLOBAL] = globalObj\n }\n }\n // delay\n if (targetingMsgJson[DISPLAY].delay != null && targetingMsgJson[DISPLAY].delay > 0) {\n const delay = targetingMsgJson[DISPLAY].delay\n targetingMsgJson[DISPLAY].delay = 0\n setTimeout(_tr, delay * 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n return false\n }\n\n incrCount(sessionObj, campaignId, excludeFromFreqCaps)\n incrCount(dailyObj, campaignId, excludeFromFreqCaps)\n incrCount(globalObj, campaignId, excludeFromFreqCaps)\n\n let campKey = 'wp'\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n campKey = 'wi'\n }\n // get ride of stale sessions and day entries\n const newCampObj = {}\n newCampObj[_session.sessionId] = sessionObj\n newCampObj[today] = dailyObj\n newCampObj[GLOBAL] = globalObj\n saveCampaignObject({ [campKey]: newCampObj })\n }\n\n const getCookieParams = () => {\n const gcookie = _device.getGuid()\n const scookieObj = _session.getSessionCookieObject()\n return '&t=wc&d=' + encodeURIComponent(compressToBase64(gcookie + '|' + scookieObj.p + '|' + scookieObj.s))\n }\n\n const setupClickEvent = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n if (onClick !== '' && onClick != null) {\n let ctaElement\n let jsCTAElements\n if (isLegacy) {\n ctaElement = contentDiv\n } else if (contentDiv !== null) {\n jsCTAElements = contentDiv.getElementsByClassName('jsCT_CTA')\n if (jsCTAElements != null && jsCTAElements.length === 1) {\n ctaElement = jsCTAElements[0]\n }\n }\n const jsFunc = targetingMsgJson.display.jsFunc\n const isPreview = targetingMsgJson.display.preview\n if (isPreview == null) {\n onClick += getCookieParams()\n }\n\n if (ctaElement != null) {\n ctaElement.onclick = () => {\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n if (isPreview == null) {\n RequestDispatcher.fireRequest(onClick)\n }\n invokeExternalJs(jsFunc, targetingMsgJson)\n // close iframe. using -1 for no campaignId\n closeIframe('-1', divId, _session.sessionId)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n }\n }\n\n const invokeExternalJs = (jsFunc, targetingMsgJson) => {\n const func = window.parent[jsFunc]\n if (typeof func === 'function') {\n if (targetingMsgJson.display.kv != null) {\n func(targetingMsgJson.display.kv)\n } else {\n func()\n }\n }\n }\n\n const setupClickUrl = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n incrementImpression(targetingMsgJson)\n setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy)\n }\n\n const incrementImpression = (targetingMsgJson) => {\n const data = {}\n data.type = 'event'\n data.evtName = NOTIFICATION_VIEWED\n data.evtData = { [WZRK_ID]: targetingMsgJson.wzrk_id }\n if (targetingMsgJson.wzrk_pivot) {\n data.evtData = { ...data.evtData, wzrk_pivot: targetingMsgJson.wzrk_pivot }\n }\n _request.processEvent(data)\n }\n\n const renderPersonalisationBanner = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const bannerEl = document.createElement('ct-web-personalisation-banner')\n bannerEl.msgId = targetingMsgJson.wzrk_id\n bannerEl.pivotId = targetingMsgJson.wzrk_pivot\n bannerEl.divHeight = targetingMsgJson.display.divHeight\n bannerEl.details = targetingMsgJson.display.details[0]\n const containerEl = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n containerEl.innerHTML = ''\n containerEl.appendChild(bannerEl)\n }\n\n const renderPersonalisationCarousel = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-carousel') === undefined) {\n customElements.define('ct-web-personalisation-carousel', CTWebPersonalisationCarousel)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const carousel = document.createElement('ct-web-personalisation-carousel')\n carousel.target = targetingMsgJson\n const container = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n container.innerHTML = ''\n container.appendChild(carousel)\n }\n\n const renderPopUpImageOnly = (targetingMsgJson) => {\n const divId = 'wzrkImageOnlyDiv'\n const popupImageOnly = document.createElement('ct-web-popup-imageonly')\n popupImageOnly.session = _session\n popupImageOnly.target = targetingMsgJson\n const containerEl = document.getElementById(divId)\n containerEl.innerHTML = ''\n containerEl.style.visibility = 'hidden'\n containerEl.appendChild(popupImageOnly)\n }\n\n const renderFooterNotification = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const displayObj = targetingMsgJson.display\n\n if (displayObj.wtarget_type === 2) { // Handling Web Native display\n // Logic for kv pair data\n if (targetingMsgJson.msgContent.type === 1) {\n const inaObj = {}\n\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.msgContent.kv != null) {\n inaObj.kv = targetingMsgJson.msgContent.kv\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n return\n }\n }\n if (displayObj.layout === 1) { // Handling Web Exit Intent\n return showExitIntent(undefined, targetingMsgJson)\n }\n if (displayObj.layout === 3) { // Handling Web Popup Image Only\n const divId = 'wzrkImageOnlyDiv'\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById(divId) != null || document.getElementById('intentPreview') != null) {\n return\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n document.body.appendChild(msgDiv)\n if (customElements.get('ct-web-popup-imageonly') === undefined) {\n customElements.define('ct-web-popup-imageonly', CTWebPopupImageOnly)\n }\n return renderPopUpImageOnly(targetingMsgJson)\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const divId = 'wizParDiv' + displayObj.layout\n\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n if (document.getElementById(divId) != null) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = divId\n const isBanner = displayObj.layout === 2\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n const viewHeight = window.innerHeight\n const viewWidth = window.innerWidth\n let legacy = false\n\n if (!isBanner) {\n const marginBottom = viewHeight * 5 / 100\n var contentHeight = 10\n let right = viewWidth * 5 / 100\n let bottomPosition = contentHeight + marginBottom\n let width = viewWidth * 30 / 100 + 20\n let widthPerct = 'width:30%;'\n // for small devices - mobile phones\n if ((/mobile/i.test(navigator.userAgent) || (/mini/i.test(navigator.userAgent))) && /iPad/i.test(navigator.userAgent) === false) {\n width = viewWidth * 85 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:80%;'\n // medium devices - tablets\n } else if ('ontouchstart' in window || (/tablet/i.test(navigator.userAgent))) {\n width = viewWidth * 50 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:50%;'\n }\n // legacy footer notif\n if (displayObj.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden; bottom:' + bottomPosition + 'px !important;width:' + width + 'px !important;right:' + right + 'px !important;position:fixed;z-index:2147483647;')\n } else {\n msgDiv.setAttribute('style', widthPerct + displayObj.iFrameStyle)\n }\n } else {\n msgDiv.setAttribute('style', displayObj.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n\n const borderRadius = displayObj.br === false ? '0' : '8'\n\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, leftTd, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n leftTd = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n leftTd = '#f4f4f4'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"\"\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'\" + divId + \"');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"\" +\n // \"\"+\n '' + imageTd + \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
'\n html = css + title + body\n }\n\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n const ifrm = (iframe.contentWindow) ? iframe.contentWindow : (iframe.contentDocument.document) ? iframe.contentDocument.document : iframe.contentDocument\n const doc = ifrm.document\n\n // Dispatch event for popup box/banner close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n doc.open()\n doc.write(html)\n\n if (displayObj['custom-editor']) {\n appendScriptForCustomEvent(targetingMsgJson, doc)\n }\n doc.close()\n\n const adjustIFrameHeight = () => {\n // adjust iframe and body height of html inside correctly\n contentHeight = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv').scrollHeight\n if (displayObj['custom-editor'] !== true && !isBanner) {\n contentHeight += 25\n }\n document.getElementById('wiz-iframe').contentDocument.body.style.margin = '0px'\n document.getElementById('wiz-iframe').style.height = contentHeight + 'px'\n }\n\n const ua = navigator.userAgent.toLowerCase()\n if (ua.indexOf('safari') !== -1) {\n if (ua.indexOf('chrome') > -1) {\n iframe.onload = () => {\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n } else {\n let inDoc = iframe.contentDocument || iframe.contentWindow\n if (inDoc.document) inDoc = inDoc.document\n // safari iphone 7+ needs this.\n adjustIFrameHeight()\n const _timer = setInterval(() => {\n if (inDoc.readyState === 'complete') {\n clearInterval(_timer)\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }, 10)\n }\n } else {\n iframe.onload = () => {\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }\n }\n\n const appendScriptForCustomEvent = (targetingMsgJson, doc) => {\n const script = doc.createElement('script')\n script.innerHTML = `\n const ct__camapignId = '${targetingMsgJson.wzrk_id}';\n const ct__formatVal = (v) => {\n return v && v.trim().substring(0, 20);\n }\n const ct__parentOrigin = window.parent.origin;\n document.body.addEventListener('click', (event) => {\n const elem = event.target.closest?.('a[wzrk_c2a], button[wzrk_c2a]');\n if (elem) {\n const {innerText, id, name, value, href} = elem;\n const clickAttr = elem.getAttribute('onclick') || elem.getAttribute('click');\n const onclickURL = clickAttr?.match(/(window.open)[(\\](\\\"|')(.*)(\\\"|',)/)?.[3] || clickAttr?.match(/(location.href *= *)(\\\"|')(.*)(\\\"|')/)?.[3];\n const props = {innerText, id, name, value};\n let msgCTkv = Object.keys(props).reduce((acc, c) => {\n const formattedVal = ct__formatVal(props[c]);\n formattedVal && (acc['wzrk_click_' + c] = formattedVal);\n return acc;\n }, {});\n if(onclickURL) { msgCTkv['wzrk_click_' + 'url'] = onclickURL; }\n if(href) { msgCTkv['wzrk_click_' + 'c2a'] = href; }\n const notifData = { msgId: ct__camapignId, msgCTkv, pivotId: '${targetingMsgJson.wzrk_pivot}' };\n window.parent.clevertap.renderNotificationClicked(notifData);\n }\n });\n `\n doc.body.appendChild(script)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe-intent'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n const ifrm = (iframe.contentWindow) ? iframe.contentWindow : (iframe.contentDocument.document) ? iframe.contentDocument.document : iframe.contentDocument\n const doc = ifrm.document\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n doc.open()\n doc.write(html)\n if (targetingMsgJson.display['custom-editor']) {\n appendScriptForCustomEvent(targetingMsgJson, doc)\n }\n doc.close()\n\n const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n this.#logger.error('Error subscribing: ' + error)\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\n// import { initialiseCTBuilder } from './modules/visualBuilder/pageBuilder'\nimport { initialiseCTBuilder, renderVisualBuilder } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token) {\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n #handleMessageEvent (event) {\n if (event.data && event.data.message) {\n if (event.data.message === 'Dashboard' && event.data.url) {\n initialiseCTBuilder(event.data.url, event.data.variant ?? null)\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n }\n }\n\n pageChanged () {\n const search = window.location.search\n const parentWindow = window.opener\n\n if (search === '?ctBuilder') {\n // open in visual builder mode\n console.log('open in visual builder mode')\n window.addEventListener('message', this.#handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('builder', '*')\n }\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', this.#handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('preview', '*')\n }\n return\n }\n\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","constructor","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","dataPostPEURL","dataPostURL","recorderURL","emailURL","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","save","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","read","data","getItem","parse","e","remove","removeItem","removeCookie","name","domain","cookieStr","document","cookie","createCookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","readCookie","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","saveToLSorCookie","property","location","hostname","$ct","globalCache","readFromLSorCookie","trim","err","createBroadCookie","broadDomain","domainParts","testBroadDomain","testCookieName","tempCookie","getMetaProp","metaObj","setMetaProp","wzrkMetaObj","getAndClearMetaProp","setInstantDeleteFlagInK","k","flag","backupEvent","reqNo","backupArr","q","debug","removeBackup","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","get","item","saveCacheToLS","set","allKeys","objToArray","index","temp","getKey","getSecondLastKey","keysArr","getLastKey","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","s","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","sessionObj","getSessionCookieObject","kIdFromLS","guidFromLRUCache","lastK","lastGUID","unregisterTokenForGuid","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","_processOldValues","getDetails","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","fireRequest","skipARP","sendOULFlag","getDelayFrequency","account","randomDelay","random","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","ProfileHandler","profilesArr","getAttribute","propName","_handleIncrementDecrementValue","command","tz","profile","addSystemDataToObject","addFlags","compressedData","saveAndFireRequest","_handleMultiValueSet","arrayVal","array","toLowerCase","sendMultiValueData","_handleMultiValueAdd","propKey","propVal","_handleMultiValueRemove","_handleMultiValueDelete","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","clear","addToK","ids","g","kId","anonymousUser","foundInCache","gFromCache","Identity","cookieName","loginArr","pop","processProfile","CTWebPersonalisationBanner","HTMLElement","_details","shadow","attachShadow","mode","details","renderBanner","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","target","renderCarousel","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","button","setInterval","sliderTime","goTo","prev","cur","CTWebPopupImageOnly","_session","popup","container","resizeObserver","renderImageOnlyPopup","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","Message","config","message","wrapper","snackBar","renderMessage","createEl","part","_el","msg","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","raiseClickedEvent","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","contains","setBadgeStyle","msgCount","incomingMessages","msgs","updateInboxMessages","incomingMessagesForPreview","previewMsgs","now","buildUIForMessages","updateUnviewedBadgeCounter","connectedCallback","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","addMsgsToInboxFromLS","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","deleteMsgsFromUI","getInboxMessages","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","top","right","getBoundingClientRect","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","inbox_notifs","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","initialiseCTBuilder","variant","onContentLoad","position","overlayPath","loadOverlayScript","then","catch","loadCSS","loadTypeKit","link","rel","head","script","src","onload","Overlay","Error","onerror","kitId","scriptTimeout","h","documentElement","className","tk","onreadystatechange","Typekit","load","renderVisualBuilder","targetingMsgJson","siteUrl","selectors","selector","element","querySelector","outerHTML","intervalId","retryElement","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","onclick","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","inaObj","kvPairsEvent","CustomEvent","dispatchEvent","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","pointerCss","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","ifrm","contentWindow","contentDocument","doc","closeCampaign","Event","write","appendScriptForCustomEvent","close","adjustIFrameHeight","scrollHeight","margin","ua","inDoc","_timer","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","getTotalVisits","visitCount","getLastVisit","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","info","debugPE","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","getTimeElapsed","sessionStart","getPageCount","seqNo","requestTime","RequestManager","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","post","fetch","method","headers","response","ok","json","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","_enableWebPush","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","skipDialog","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","getValue","getdefaultValue","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","addValueChangedCallback","removeValueChangedCallback","clearStartFlag","VariableStore","syncVariables","onSyncSuccess","onSyncFailure","meta","r","status","fetchVariables","onFetchCallback","addVariablesChangedCallback","callback","addOneTimeVariablesChangedCallback","removeVariablesChangedCallback","removeOneTimeVariablesChangedCallback","callBack","CleverTap","spa","isSpa","bind","enablePersonalization","_isPersonalisationActive","ReqestManager","onUserLogin","privacy","notifications","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","handleDecrementValue","setMultiValuesForKey","addMultiValueForKey","addMultiValuesForKey","removeMultiValueForKey","removeMultiValuesForKey","removeValueForKey","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","sendLocationData","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","elements","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","parentWindow","opener","postMessage","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","setOffline","arg","defineVariable","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;EAAO,MAAMA,aAAa,GAAG,oBAAtB;EACA,MAAMC,eAAe,GAAG,QAAxB;EACA,MAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;ECAQ,MAAMC,OAAN,CAAc;EAO3BC,EAAAA,WAAW,GAAsE;EAAA,QAApE;EAAEC,MAAAA;EAAF,KAAoE,uEAA3D,EAA2D;EAAA,QAAvDC,MAAuD,uEAA9C,EAA8C;EAAA,QAA1CC,YAA0C,uEAA3BP,aAA2B;EAAA,QAAZQ,KAAY,uEAAJ,EAAI;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,aALvE;EAKuE;EAAA;EAAA;EAAA,aAJjER;EAIiE;EAAA;EAAA;EAAA,aAHjE;EAGiE;EAAA;EAAA;EAAA,aAFxE;EAEwE;EAC/E,SAAKK,EAAL,GAAUA,EAAV;;EACA,QAAIC,MAAJ,EAAY;EACV,WAAKA,MAAL,GAAcA,MAAd;EACD;;EACD,QAAIC,YAAJ,EAAkB;EAChB,WAAKA,YAAL,GAAoBA,YAApB;EACD;;EACD,QAAIC,KAAJ,EAAW;EACT,WAAKA,KAAL,GAAaA,KAAb;EACD;EACF;;EAED,MAAIH,EAAJ,GAAU;EACR,uCAAO,IAAP;EACD;;EAED,MAAIA,EAAJ,CAAQI,SAAR,EAAmB;EACjB,gEAAkBA,SAAlB;EACD;;EAED,MAAIH,MAAJ,GAAc;EACZ,uCAAO,IAA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ACxB,MAAI,KAAKqlC,wBAAL,EAAJ,EAAqC;EACnCrlC,IAAAA,IAAI,CAAC+9B,KAAL,GAAa,IAAb;EACD;EACF;;QC5xBGruB,SAAS,GAAG,IAAI28B,SAAJ,CAAczqC,MAAM,CAAC8N,SAArB;EAElB9N,MAAM,CAAC8N,SAAP,GAAmB9N,MAAM,CAAC+N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/modules/visualBuilder/pageBuilder.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/notification.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {}\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n // Initialize array\n var array = []\n\n // Check if globalProfileMap is null, initialize if needed\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n // Check if the value to be set is either string or number\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = $ct.globalProfileMap[propKey]\n array.push(typeof propVal === 'number' ? propVal : propVal.toLowerCase())\n } else {\n $ct.globalProfileMap[propKey] = propVal\n }\n } else {\n // Check if propVal is an array\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = Array.isArray($ct.globalProfileMap[propKey]) ? $ct.globalProfileMap[propKey] : [$ct.globalProfileMap[propKey]]\n }\n\n // Check for case-sensitive inputs and filter the same ones\n for (var i = 0; i < propVal.length; i++) {\n if (typeof propVal[i] === 'number' && !array.includes(propVal[i])) {\n array.push(propVal[i])\n } else if (typeof propVal[i] === 'string' && !array.includes(propVal[i].toLowerCase())) {\n array.push(propVal[i].toLowerCase())\n } else if ((typeof propVal[i] === 'number' && array.includes(propVal[i])) || (typeof propVal[i] === 'string' && array.includes(propVal[i].toLowerCase()))) {\n console.error('Values already included')\n } else {\n console.error('Array supports only string or number type values')\n }\n }\n\n // Update globalProfileMap with the array\n $ct.globalProfileMap[propKey] = array\n }\n\n // Save to local storage or cookie\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Call the sendMultiValueData function\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n var index = $ct.globalProfileMap[propKey].indexOf(propVal)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n } else {\n for (var k = 0; k < propVal.length; k++) {\n var idx = $ct.globalProfileMap[propKey].indexOf(propVal[k])\n if (idx !== -1) {\n $ct.globalProfileMap[propKey].splice(idx, 1)\n }\n }\n }\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n // console.log('Raise notification clicked event for ', item)\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","export const initialiseCTBuilder = (url, variant) => {\n document.addEventListener('DOMContentLoaded', () => onContentLoad(url, variant))\n}\n\nlet container\n\nfunction onContentLoad (url, variant) {\n document.body.innerHTML = ''\n container = document.createElement('div')\n container.id = 'overlayDiv'\n container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form\n container.style.display = 'flex'\n document.body.appendChild(container)\n const overlayPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js'\n loadOverlayScript(overlayPath, url, variant)\n .then(() => {\n console.log('Overlay script loaded successfully.')\n })\n .catch((error) => {\n console.error('Error loading overlay script:', error)\n })\n loadCSS()\n loadTypeKit()\n}\n\nfunction loadCSS () {\n var link = document.createElement('link')\n link.rel = 'stylesheet'\n link.type = 'text/css'\n link.href = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css'\n document.head.appendChild(link)\n}\n\nfunction loadOverlayScript (overlayPath, url, variant) {\n return new Promise((resolve, reject) => {\n var script = document.createElement('script')\n script.type = 'module'\n script.src = overlayPath\n script.onload = function () {\n if (typeof window.Overlay === 'function') {\n window.Overlay('#overlayDiv', url, variant)\n resolve()\n } else {\n reject(new Error('ContentLayout not found in overlay.js'))\n }\n }\n script.onerror = function (error) {\n reject(error)\n }\n document.head.appendChild(script)\n })\n}\n\nfunction loadTypeKit () {\n var config = {\n kitId: 'eqj6nom',\n scriptTimeout: 3000,\n async: true\n }\n\n var d = document\n var h = d.documentElement\n var t = setTimeout(function () {\n h.className = h.className.replace(/\\bwf-loading\\b/g, '') + ' wf-inactive'\n // $(document).trigger(\"TypeKitReady\");\n }, config.scriptTimeout)\n var tk = d.createElement('script')\n var f = false\n var s = d.getElementsByTagName('script')[0]\n var a\n\n h.className += ' wf-loading'\n tk.src = 'https://use.typekit.net/' + config.kitId + '.js'\n tk.async = true\n tk.onload = tk.onreadystatechange = function () {\n a = this.readyState\n if (f || (a && a !== 'complete' && a !== 'loaded')) return\n f = true\n clearTimeout(t)\n try {\n // eslint-disable-next-line no-undef\n Typekit.load(config)\n } catch (e) {}\n }\n\n s.parentNode.insertBefore(tk, s)\n}\n\nexport const renderVisualBuilder = (targetingMsgJson, isPreview) => {\n const details = isPreview ? targetingMsgJson[0] : targetingMsgJson.display.details[0]\n const siteUrl = Object.keys(details)[0]\n const selectors = details[siteUrl]\n\n if (siteUrl === window.location.href) {\n for (const selector in selectors) {\n const element = document.querySelector(selector)\n if (element) {\n if (selectors[selector].html) {\n element.outerHTML = selectors[selector].html\n } else {\n // Update json data\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n } else {\n let count = 0\n const intervalId = setInterval(() => {\n const retryElement = document.querySelector(selector)\n if (retryElement) {\n if (selectors[selector].html) {\n retryElement.outerHTML = selectors[selector].html\n } else {\n // Update json data\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n clearInterval(intervalId)\n } else {\n count++\n if (count >= 20) {\n console.log(`No element present on DOM with selector '${selector}'.`)\n clearInterval(intervalId)\n }\n }\n }, 500)\n }\n }\n }\n}\n// function addOverlayScript (overlayPath) {\n// const scriptTag = document.createElement('script')\n// scriptTag.setAttribute('type', 'text/javascript')\n// scriptTag.setAttribute('id', 'wzrk-alert-js')\n// scriptTag.setAttribute('src', overlayPath)\n// document.getElementsByTagName('body')[0].appendChild(scriptTag)\n// return scriptTag\n// }\n","import {\n addToLocalProfileMap,\n arp,\n getCampaignObject,\n saveCampaignObject,\n closeIframe\n} from './clevertap'\n\nimport {\n CAMP_COOKIE_NAME,\n DISPLAY,\n GLOBAL,\n EV_COOKIE,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n WZRK_PREFIX,\n WZRK_ID,\n CAMP_COOKIE_G,\n GCOOKIE_NAME\n} from './constants'\n\nimport {\n getNow,\n getToday\n} from './datetime'\n\nimport {\n compressToBase64\n} from './encoder'\n\nimport { StorageManager, $ct } from './storage'\nimport RequestDispatcher from './requestDispatcher'\nimport { CTWebPersonalisationBanner } from './web-personalisation/banner'\nimport { CTWebPersonalisationCarousel } from './web-personalisation/carousel'\nimport { CTWebPopupImageOnly } from './web-popupImageonly/popupImageonly'\nimport { checkAndRegisterWebInboxElements, initializeWebInbox, processWebInboxSettings, hasWebInboxSettingsInLS, processInboxNotifs } from '../modules/web-inbox/helper'\nimport { renderVisualBuilder } from '../modules/visualBuilder/pageBuilder'\n\nconst _tr = (msg, {\n device,\n session,\n request,\n logger\n}) => {\n const _device = device\n const _session = session\n const _request = request\n const _logger = logger\n let _wizCounter = 0\n\n // msg = {\n // arp: {\n // j_n: 'Zw==',\n // i_n: 'Y2NmewICAw==',\n // d_ts: 0,\n // dh: 0,\n // v: 1,\n // j_s: '{ }',\n // id: 'WWW-WWW-WWRZ',\n // e_ts: 0,\n // r_ts: 1649748826,\n // rc_w: 60,\n // rc_n: 5\n // },\n // inapp_notifs: [\n // {\n // msgContent: {\n // templateType: 'point-and-click',\n // type: 4\n // },\n // display: {\n // divId: 'hero-banner',\n // details: [{\n // 'http://localhost:3000/': {\n // '.heroDi1v': {\n // html: 'Hello Sonam'\n // },\n // '#selector_2': {\n // html: '

Hello Sonam

'\n // },\n // '.heroDiv2': {\n // json: {\n // name: 'Sonam',\n // identity: 1234\n // }\n // }\n // }\n // }],\n // wtarget_type: 2,\n // wmc: 1,\n // ff: 'Desktop'\n // },\n // wzrk_id: '1655316906_20220620',\n // wzrk_pivot: 'wzrk_default'\n // }\n // ]\n // }\n // Campaign House keeping\n const doCampHouseKeeping = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const today = getToday()\n\n const incrCount = (obj, campaignId, excludeFromFreqCaps) => {\n let currentCount = 0\n let totalCount = 0\n if (obj[campaignId] != null) {\n currentCount = obj[campaignId]\n }\n currentCount++\n if (obj.tc != null) {\n totalCount = obj.tc\n }\n // if exclude from caps then dont add to total counts\n if (excludeFromFreqCaps < 0) {\n totalCount++\n }\n\n obj.tc = totalCount\n obj[campaignId] = currentCount\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n delete sessionStorage[CAMP_COOKIE_NAME]\n var campTypeObj = {}\n const campObj = getCampaignObject()\n if (targetingMsgJson.display.wtarget_type === 3 && campObj.hasOwnProperty('wi')) {\n campTypeObj = campObj.wi\n } else if ((targetingMsgJson.display.wtarget_type === 0 || targetingMsgJson.display.wtarget_type === 1) && campObj.hasOwnProperty('wp')) {\n campTypeObj = campObj.wp\n } else {\n campTypeObj = {}\n }\n if (campObj.hasOwnProperty('global')) {\n campTypeObj.wp = campObj\n }\n // global session limit. default is 1\n if (targetingMsgJson[DISPLAY].wmc == null) {\n targetingMsgJson[DISPLAY].wmc = 1\n }\n\n // global session limit for web inbox. default is 1\n if (targetingMsgJson[DISPLAY].wimc == null) {\n targetingMsgJson[DISPLAY].wimc = 1\n }\n\n var excludeFromFreqCaps = -1 // efc - Exclude from frequency caps\n let campaignSessionLimit = -1 // mdc - Once per session\n let campaignDailyLimit = -1 // tdc - Once per day\n let campaignTotalLimit = -1 // tlc - Once per user for the duration of campaign\n let totalDailyLimit = -1\n let totalSessionLimit = -1 // wmc - Web Popup Global Session Limit\n let totalInboxSessionLimit = -1 // wimc - Web Inbox Global Session Limit\n\n if (targetingMsgJson[DISPLAY].efc != null) { // exclude from frequency cap\n excludeFromFreqCaps = parseInt(targetingMsgJson[DISPLAY].efc, 10)\n }\n if (targetingMsgJson[DISPLAY].mdc != null) { // Campaign Session Limit\n campaignSessionLimit = parseInt(targetingMsgJson[DISPLAY].mdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tdc != null) { // No of web popups in a day per campaign\n campaignDailyLimit = parseInt(targetingMsgJson[DISPLAY].tdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tlc != null) { // Total lifetime count\n campaignTotalLimit = parseInt(targetingMsgJson[DISPLAY].tlc, 10)\n }\n if (targetingMsgJson[DISPLAY].wmp != null) { // No of campaigns per day\n totalDailyLimit = parseInt(targetingMsgJson[DISPLAY].wmp, 10)\n }\n if (targetingMsgJson[DISPLAY].wmc != null) { // No of campaigns per session\n totalSessionLimit = parseInt(targetingMsgJson[DISPLAY].wmc, 10)\n }\n\n if (targetingMsgJson[DISPLAY].wimc != null) { // No of inbox campaigns per session\n totalInboxSessionLimit = parseInt(targetingMsgJson[DISPLAY].wimc, 10)\n }\n // session level capping\n var sessionObj = campTypeObj[_session.sessionId]\n if (sessionObj) {\n const campaignSessionCount = sessionObj[campaignId]\n const totalSessionCount = sessionObj.tc\n // dnd\n if (campaignSessionCount === 'dnd' && !$ct.dismissSpamControl) {\n return false\n }\n\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n // Inbox session\n if (totalInboxSessionLimit > 0 && totalSessionCount >= totalInboxSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n } else {\n // session\n if (totalSessionLimit > 0 && totalSessionCount >= totalSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n }\n\n // campaign session\n if (campaignSessionLimit > 0 && campaignSessionCount >= campaignSessionLimit) {\n return false\n }\n } else {\n sessionObj = {}\n campTypeObj[_session.sessionId] = sessionObj\n }\n\n // daily level capping\n var dailyObj = campTypeObj[today]\n if (dailyObj != null) {\n const campaignDailyCount = dailyObj[campaignId]\n const totalDailyCount = dailyObj.tc\n // daily\n if (totalDailyLimit > 0 && totalDailyCount >= totalDailyLimit && excludeFromFreqCaps < 0) {\n return false\n }\n // campaign daily\n if (campaignDailyLimit > 0 && campaignDailyCount >= campaignDailyLimit) {\n return false\n }\n } else {\n dailyObj = {}\n campTypeObj[today] = dailyObj\n }\n\n var globalObj = campTypeObj[GLOBAL]\n if (globalObj != null) {\n const campaignTotalCount = globalObj[campaignId]\n // campaign total\n if (campaignTotalLimit > 0 && campaignTotalCount >= campaignTotalLimit) {\n return false\n }\n } else {\n globalObj = {}\n campTypeObj[GLOBAL] = globalObj\n }\n }\n // delay\n if (targetingMsgJson[DISPLAY].delay != null && targetingMsgJson[DISPLAY].delay > 0) {\n const delay = targetingMsgJson[DISPLAY].delay\n targetingMsgJson[DISPLAY].delay = 0\n setTimeout(_tr, delay * 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n return false\n }\n\n incrCount(sessionObj, campaignId, excludeFromFreqCaps)\n incrCount(dailyObj, campaignId, excludeFromFreqCaps)\n incrCount(globalObj, campaignId, excludeFromFreqCaps)\n\n let campKey = 'wp'\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n campKey = 'wi'\n }\n // get ride of stale sessions and day entries\n const newCampObj = {}\n newCampObj[_session.sessionId] = sessionObj\n newCampObj[today] = dailyObj\n newCampObj[GLOBAL] = globalObj\n saveCampaignObject({ [campKey]: newCampObj })\n }\n\n const getCookieParams = () => {\n const gcookie = _device.getGuid()\n const scookieObj = _session.getSessionCookieObject()\n return '&t=wc&d=' + encodeURIComponent(compressToBase64(gcookie + '|' + scookieObj.p + '|' + scookieObj.s))\n }\n\n const setupClickEvent = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n if (onClick !== '' && onClick != null) {\n let ctaElement\n let jsCTAElements\n if (isLegacy) {\n ctaElement = contentDiv\n } else if (contentDiv !== null) {\n jsCTAElements = contentDiv.getElementsByClassName('jsCT_CTA')\n if (jsCTAElements != null && jsCTAElements.length === 1) {\n ctaElement = jsCTAElements[0]\n }\n }\n const jsFunc = targetingMsgJson.display.jsFunc\n const isPreview = targetingMsgJson.display.preview\n if (isPreview == null) {\n onClick += getCookieParams()\n }\n\n if (ctaElement != null) {\n ctaElement.onclick = () => {\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n if (isPreview == null) {\n RequestDispatcher.fireRequest(onClick)\n }\n invokeExternalJs(jsFunc, targetingMsgJson)\n // close iframe. using -1 for no campaignId\n closeIframe('-1', divId, _session.sessionId)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n }\n }\n\n const invokeExternalJs = (jsFunc, targetingMsgJson) => {\n const func = window.parent[jsFunc]\n if (typeof func === 'function') {\n if (targetingMsgJson.display.kv != null) {\n func(targetingMsgJson.display.kv)\n } else {\n func()\n }\n }\n }\n\n const setupClickUrl = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n incrementImpression(targetingMsgJson)\n setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy)\n }\n\n const incrementImpression = (targetingMsgJson) => {\n const data = {}\n data.type = 'event'\n data.evtName = NOTIFICATION_VIEWED\n data.evtData = { [WZRK_ID]: targetingMsgJson.wzrk_id }\n if (targetingMsgJson.wzrk_pivot) {\n data.evtData = { ...data.evtData, wzrk_pivot: targetingMsgJson.wzrk_pivot }\n }\n _request.processEvent(data)\n }\n\n const renderPersonalisationBanner = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const bannerEl = document.createElement('ct-web-personalisation-banner')\n bannerEl.msgId = targetingMsgJson.wzrk_id\n bannerEl.pivotId = targetingMsgJson.wzrk_pivot\n bannerEl.divHeight = targetingMsgJson.display.divHeight\n bannerEl.details = targetingMsgJson.display.details[0]\n const containerEl = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n containerEl.innerHTML = ''\n containerEl.appendChild(bannerEl)\n }\n\n const renderPersonalisationCarousel = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-carousel') === undefined) {\n customElements.define('ct-web-personalisation-carousel', CTWebPersonalisationCarousel)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const carousel = document.createElement('ct-web-personalisation-carousel')\n carousel.target = targetingMsgJson\n const container = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n container.innerHTML = ''\n container.appendChild(carousel)\n }\n\n const renderPopUpImageOnly = (targetingMsgJson) => {\n const divId = 'wzrkImageOnlyDiv'\n const popupImageOnly = document.createElement('ct-web-popup-imageonly')\n popupImageOnly.session = _session\n popupImageOnly.target = targetingMsgJson\n const containerEl = document.getElementById(divId)\n containerEl.innerHTML = ''\n containerEl.style.visibility = 'hidden'\n containerEl.appendChild(popupImageOnly)\n }\n\n const renderFooterNotification = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const displayObj = targetingMsgJson.display\n\n if (displayObj.wtarget_type === 2) { // Handling Web Native display\n // Logic for kv pair data\n if (targetingMsgJson.msgContent.type === 1) {\n const inaObj = {}\n\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.msgContent.kv != null) {\n inaObj.kv = targetingMsgJson.msgContent.kv\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n return\n }\n }\n if (displayObj.layout === 1) { // Handling Web Exit Intent\n return showExitIntent(undefined, targetingMsgJson)\n }\n if (displayObj.layout === 3) { // Handling Web Popup Image Only\n const divId = 'wzrkImageOnlyDiv'\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById(divId) != null || document.getElementById('intentPreview') != null) {\n return\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n document.body.appendChild(msgDiv)\n if (customElements.get('ct-web-popup-imageonly') === undefined) {\n customElements.define('ct-web-popup-imageonly', CTWebPopupImageOnly)\n }\n return renderPopUpImageOnly(targetingMsgJson)\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const divId = 'wizParDiv' + displayObj.layout\n\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n if (document.getElementById(divId) != null) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = divId\n const isBanner = displayObj.layout === 2\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n const viewHeight = window.innerHeight\n const viewWidth = window.innerWidth\n let legacy = false\n\n if (!isBanner) {\n const marginBottom = viewHeight * 5 / 100\n var contentHeight = 10\n let right = viewWidth * 5 / 100\n let bottomPosition = contentHeight + marginBottom\n let width = viewWidth * 30 / 100 + 20\n let widthPerct = 'width:30%;'\n // for small devices - mobile phones\n if ((/mobile/i.test(navigator.userAgent) || (/mini/i.test(navigator.userAgent))) && /iPad/i.test(navigator.userAgent) === false) {\n width = viewWidth * 85 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:80%;'\n // medium devices - tablets\n } else if ('ontouchstart' in window || (/tablet/i.test(navigator.userAgent))) {\n width = viewWidth * 50 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:50%;'\n }\n // legacy footer notif\n if (displayObj.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden; bottom:' + bottomPosition + 'px !important;width:' + width + 'px !important;right:' + right + 'px !important;position:fixed;z-index:2147483647;')\n } else {\n msgDiv.setAttribute('style', widthPerct + displayObj.iFrameStyle)\n }\n } else {\n msgDiv.setAttribute('style', displayObj.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n\n const borderRadius = displayObj.br === false ? '0' : '8'\n\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, leftTd, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n leftTd = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n leftTd = '#f4f4f4'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"\"\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'\" + divId + \"');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"\" +\n // \"\"+\n '' + imageTd + \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
'\n html = css + title + body\n }\n\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n const ifrm = (iframe.contentWindow) ? iframe.contentWindow : (iframe.contentDocument.document) ? iframe.contentDocument.document : iframe.contentDocument\n const doc = ifrm.document\n\n // Dispatch event for popup box/banner close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n doc.open()\n doc.write(html)\n\n if (displayObj['custom-editor']) {\n appendScriptForCustomEvent(targetingMsgJson, doc)\n }\n doc.close()\n\n const adjustIFrameHeight = () => {\n // adjust iframe and body height of html inside correctly\n contentHeight = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv').scrollHeight\n if (displayObj['custom-editor'] !== true && !isBanner) {\n contentHeight += 25\n }\n document.getElementById('wiz-iframe').contentDocument.body.style.margin = '0px'\n document.getElementById('wiz-iframe').style.height = contentHeight + 'px'\n }\n\n const ua = navigator.userAgent.toLowerCase()\n if (ua.indexOf('safari') !== -1) {\n if (ua.indexOf('chrome') > -1) {\n iframe.onload = () => {\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n } else {\n let inDoc = iframe.contentDocument || iframe.contentWindow\n if (inDoc.document) inDoc = inDoc.document\n // safari iphone 7+ needs this.\n adjustIFrameHeight()\n const _timer = setInterval(() => {\n if (inDoc.readyState === 'complete') {\n clearInterval(_timer)\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }, 10)\n }\n } else {\n iframe.onload = () => {\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }\n }\n\n const appendScriptForCustomEvent = (targetingMsgJson, doc) => {\n const script = doc.createElement('script')\n script.innerHTML = `\n const ct__camapignId = '${targetingMsgJson.wzrk_id}';\n const ct__formatVal = (v) => {\n return v && v.trim().substring(0, 20);\n }\n const ct__parentOrigin = window.parent.origin;\n document.body.addEventListener('click', (event) => {\n const elem = event.target.closest?.('a[wzrk_c2a], button[wzrk_c2a]');\n if (elem) {\n const {innerText, id, name, value, href} = elem;\n const clickAttr = elem.getAttribute('onclick') || elem.getAttribute('click');\n const onclickURL = clickAttr?.match(/(window.open)[(\\](\\\"|')(.*)(\\\"|',)/)?.[3] || clickAttr?.match(/(location.href *= *)(\\\"|')(.*)(\\\"|')/)?.[3];\n const props = {innerText, id, name, value};\n let msgCTkv = Object.keys(props).reduce((acc, c) => {\n const formattedVal = ct__formatVal(props[c]);\n formattedVal && (acc['wzrk_click_' + c] = formattedVal);\n return acc;\n }, {});\n if(onclickURL) { msgCTkv['wzrk_click_' + 'url'] = onclickURL; }\n if(href) { msgCTkv['wzrk_click_' + 'c2a'] = href; }\n const notifData = { msgId: ct__camapignId, msgCTkv, pivotId: '${targetingMsgJson.wzrk_pivot}' };\n window.parent.clevertap.renderNotificationClicked(notifData);\n }\n });\n `\n doc.body.appendChild(script)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe-intent'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n const ifrm = (iframe.contentWindow) ? iframe.contentWindow : (iframe.contentDocument.document) ? iframe.contentDocument.document : iframe.contentDocument\n const doc = ifrm.document\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n doc.open()\n doc.write(html)\n if (targetingMsgJson.display['custom-editor']) {\n appendScriptForCustomEvent(targetingMsgJson, doc)\n }\n doc.close()\n\n const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n this.#logger.error('Error subscribing: ' + error)\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\n// import { initialiseCTBuilder } from './modules/visualBuilder/pageBuilder'\nimport { initialiseCTBuilder, renderVisualBuilder } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token) {\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n #handleMessageEvent (event) {\n if (event.data && event.data.message) {\n if (event.data.message === 'Dashboard' && event.data.url) {\n initialiseCTBuilder(event.data.url, event.data.variant ?? null)\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n }\n }\n\n pageChanged () {\n const search = window.location.search\n const parentWindow = window.opener\n\n if (search === '?ctBuilder') {\n // open in visual builder mode\n console.log('open in visual builder mode')\n window.addEventListener('message', this.#handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('builder', '*')\n }\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', this.#handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('preview', '*')\n }\n return\n }\n\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","constructor","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","dataPostPEURL","dataPostURL","recorderURL","emailURL","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","save","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","read","data","getItem","parse","e","remove","removeItem","removeCookie","name","domain","cookieStr","document","cookie","createCookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","readCookie","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","saveToLSorCookie","property","location","hostname","$ct","globalCache","readFromLSorCookie","trim","err","createBroadCookie","broadDomain","domainParts","testBroadDomain","testCookieName","tempCookie","getMetaProp","metaObj","setMetaProp","wzrkMetaObj","getAndClearMetaProp","setInstantDeleteFlagInK","k","flag","backupEvent","reqNo","backupArr","q","debug","removeBackup","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","get","item","saveCacheToLS","set","allKeys","objToArray","index","temp","getKey","getSecondLastKey","keysArr","getLastKey","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","s","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","sessionObj","getSessionCookieObject","kIdFromLS","guidFromLRUCache","lastK","lastGUID","unregisterTokenForGuid","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","_processOldValues","getDetails","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","fireRequest","skipARP","sendOULFlag","getDelayFrequency","account","randomDelay","random","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","ProfileHandler","profilesArr","getAttribute","propName","_handleIncrementDecrementValue","command","tz","profile","addSystemDataToObject","addFlags","compressedData","saveAndFireRequest","_handleMultiValueSet","arrayVal","array","toLowerCase","sendMultiValueData","_handleMultiValueAdd","propKey","propVal","_handleMultiValueRemove","_handleMultiValueDelete","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","clear","addToK","ids","g","kId","anonymousUser","foundInCache","gFromCache","Identity","cookieName","loginArr","pop","processProfile","CTWebPersonalisationBanner","HTMLElement","_details","shadow","attachShadow","mode","details","renderBanner","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","target","renderCarousel","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","button","setInterval","sliderTime","goTo","prev","cur","CTWebPopupImageOnly","_session","popup","container","resizeObserver","renderImageOnlyPopup","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","Message","config","message","wrapper","snackBar","renderMessage","createEl","part","_el","msg","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","raiseClickedEvent","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","contains","setBadgeStyle","msgCount","incomingMessages","msgs","updateInboxMessages","incomingMessagesForPreview","previewMsgs","now","buildUIForMessages","updateUnviewedBadgeCounter","connectedCallback","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","addMsgsToInboxFromLS","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","deleteMsgsFromUI","getInboxMessages","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","top","right","getBoundingClientRect","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","inbox_notifs","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","initialiseCTBuilder","variant","onContentLoad","position","overlayPath","loadOverlayScript","then","catch","loadCSS","loadTypeKit","link","rel","head","script","src","onload","Overlay","Error","onerror","kitId","scriptTimeout","h","documentElement","className","tk","onreadystatechange","Typekit","load","renderVisualBuilder","targetingMsgJson","siteUrl","selectors","selector","element","querySelector","outerHTML","intervalId","retryElement","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","onclick","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","inaObj","kvPairsEvent","CustomEvent","dispatchEvent","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","pointerCss","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","ifrm","contentWindow","contentDocument","doc","closeCampaign","Event","write","appendScriptForCustomEvent","close","adjustIFrameHeight","scrollHeight","margin","ua","inDoc","_timer","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","getTotalVisits","visitCount","getLastVisit","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","info","debugPE","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","getTimeElapsed","sessionStart","getPageCount","seqNo","requestTime","RequestManager","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","post","fetch","method","headers","response","ok","json","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","_enableWebPush","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","skipDialog","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","getValue","getdefaultValue","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","addValueChangedCallback","removeValueChangedCallback","clearStartFlag","VariableStore","syncVariables","onSyncSuccess","onSyncFailure","meta","r","status","fetchVariables","onFetchCallback","addVariablesChangedCallback","callback","addOneTimeVariablesChangedCallback","removeVariablesChangedCallback","removeOneTimeVariablesChangedCallback","callBack","CleverTap","spa","isSpa","bind","enablePersonalization","_isPersonalisationActive","ReqestManager","onUserLogin","privacy","notifications","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","handleDecrementValue","setMultiValuesForKey","addMultiValueForKey","addMultiValuesForKey","removeMultiValueForKey","removeMultiValuesForKey","removeValueForKey","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","sendLocationData","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","elements","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","parentWindow","opener","postMessage","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","setOffline","arg","defineVariable","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;EAAO,MAAMA,aAAa,GAAG,oBAAtB;EACA,MAAMC,eAAe,GAAG,QAAxB;EACA,MAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;ECAQ,MAAMC,OAAN,CAAc;EAO3BC,EAAAA,WAAW,GAAsE;EAAA,QAApE;EAAEC,MAAAA;EAAF,KAAoE,uEAA3D,EAA2D;EAAA,QAAvDC,MAAuD,uEAA9C,EAA8C;EAAA,QAA1CC,YAA0C,uEAA3BP,aAA2B;EAAA,QAAZQ,KAAY,uEAAJ,EAAI;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,aALvE;EAKuE;EAAA;EAAA;EAAA,aAJjER;EAIiE;EAAA;EAAA;EAAA,aAHjE;EAGiE;EAAA;EAAA;EAAA,aAFxE;EAEwE;EAC/E,SAAKK,EAAL,GAAUA,EAAV;;EACA,QAAIC,MAAJ,EAAY;EACV,WAAKA,MAAL,GAAcA,MAAd;EACD;;EACD,QAAIC,YAAJ,EAAkB;EAChB,WAAKA,YAAL,GAAoBA,YAApB;EACD;;EACD,QAAIC,KAAJ,EAAW;EACT,WAAKA,KAAL,GAAaA,KAAb;EACD;EACF;;EAED,MAAIH,EAAJ,GAAU;EACR,uCAAO,IAAP;EACD;;EAED,MAAIA,EAAJ,CAAQI,SAAR,EAAmB;EACjB,gEAAkBA,SAAlB;EACD;;EAED,MAAIH,MAAJ,GAAc;EACZ,uCAAO,IAAP;EACD;;EAED,MAAIA,MAAJ,CAAYA,MAAZ,EAAoB;EAClB,0DAAeA,MAAf;EACD;;EAED,MAAII,YAAJ,GAAoB;EAClB,uCAAO,IAAP;EACD;;EAED,MAAIA,YAAJ,CAAkBA,YAAlB,EAAgC;EAC9B,sEAAqBA,YAArB;E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CAAczqC,MAAM,CAAC8N,SAArB;EAElB9N,MAAM,CAAC8N,SAAP,GAAmB9N,MAAM,CAAC+N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file diff --git a/clevertap.min.js b/clevertap.min.js index b0d84795..39374c7a 100644 --- a/clevertap.min.js +++ b/clevertap.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).clevertap=t()}(this,(function(){"use strict";var e=0;function t(t){return"__private_"+e+++"_"+t}function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}const o="clevertap-prod.com",n="https:";var s=t("accountId"),r=t("region"),a=t("targetDomain"),l=t("dcSdkversion"),c=t("token");class d{constructor(){let{id:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";Object.defineProperty(this,s,{writable:!0,value:void 0}),Object.defineProperty(this,r,{writable:!0,value:""}),Object.defineProperty(this,a,{writable:!0,value:o}),Object.defineProperty(this,l,{writable:!0,value:""}),Object.defineProperty(this,c,{writable:!0,value:""}),this.id=e,t&&(this.region=t),i&&(this.targetDomain=i),n&&(this.token=n)}get id(){return i(this,s)[s]}set id(e){i(this,s)[s]=e}get region(){return i(this,r)[r]}set region(e){i(this,r)[r]=e}get dcSDKVersion(){return i(this,l)[l]}set dcSDKVersion(e){i(this,l)[l]=e}get targetDomain(){return i(this,a)[a]}set targetDomain(e){i(this,a)[a]=e}get token(){return i(this,c)[c]}set token(e){i(this,c)[c]=e}get finalTargetDomain(){return this.region?"".concat(this.region,".").concat(this.targetDomain):this.targetDomain===o?"".concat("eu1",".").concat(this.targetDomain):this.targetDomain}get dataPostPEURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/defineVars")}get dataPostURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/a?t=96")}get recorderURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/r?r=1")}get emailURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/e?r=1")}}const h=new RegExp("^\\s+|\\.|:|\\$|'|\"|\\\\|\\s+$","g"),u=new RegExp("^\\s+|'|\"|\\\\|\\s+$","g"),p=new RegExp("'","g"),g="clear",f="Charged ID",v="WZRK_CHARGED_ID",b="WZRK_G",m="WZRK_K",y="WZRK_CAMP",w="WZRK_CAMP_G",C="WZRK_EV",k="WZRK_META",x="WZRK_PR",P="WZRK_ARP",S="WZRK_L",I="global",O="optOut",_="useIP",E="WZRK_X",A="push",L=31536e3,M="wzrk_",T="wzrk_id",R="Notification Viewed",j="Notification Clicked",D="WZRK_FPU",z="WZRK_PSD",B="$incr",N="$add",F="$remove",U="$delete",q="WZRK_INBOX_CONFIG",V="WZRK_INBOX",W=1e3,K="wzrk_fetch",G=["Stayed","UTM Visited","App Launched","Notification Sent",R,j],H=e=>"string"==typeof e||e instanceof String,J=e=>"[object Object]"===Object.prototype.toString.call(e),Z=e=>"object"==typeof e&&e instanceof Date,$=e=>{for(const t in e)if(e.hasOwnProperty(t))return!1;return!0},Y=e=>!isNaN(parseFloat(e))&&isFinite(e),Q=e=>/^-?[\d.]+(?:e-?\d+)?$/.test(e)&&"number"==typeof e,X=e=>null!=e&&"undefined"!==e,ee=(e,t)=>{if("object"!=typeof e){let i;return H(e)?(i=te(e,u),i.length>1024&&(i=i.substring(0,1024),t.reportError(521,i+"... length exceeded 1024 chars. Trimmed."))):i=e,i}for(const i in e)if(e.hasOwnProperty(i)){const o=ee(e[i],t);let n;n=te(i,h),n.length>1024&&(n=n.substring(0,1024),t.reportError(520,n+"... length exceeded 1024 chars. Trimmed.")),delete e[i],e[n]=o}return e},te=(e,t)=>e.replace(t,""),ie=()=>{const e=new Date;return e.getFullYear()+""+e.getMonth()+e.getDay()},oe=()=>Math.floor((new Date).getTime()/1e3),ne=e=>"$D_"+Math.round(e.getTime()/1e3),se=e=>{if(re(e))return"$D_"+e},re=e=>{const t=/^(\d{4})(\d{2})(\d{2})$/.exec(e);if(null==t)return!1;const i=t[3],o=t[2]-1,n=t[1],s=new Date(n,o,i);return s.getDate()==i&&s.getMonth()==o&&s.getFullYear()==n};class ae{static save(e,t){return!(!e||!t)&&(this._isLocalStorageSupported()?(localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),!0):void 0)}static read(e){if(!e)return!1;let t=null;if(this._isLocalStorageSupported()&&(t=localStorage.getItem(e)),null!=t)try{t=JSON.parse(t)}catch(e){}return t}static remove(e){return!!e&&(this._isLocalStorageSupported()?(localStorage.removeItem(e),!0):void 0)}static removeCookie(e,t){let i=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";t&&(i=i+" domain="+t+"; path=/"),document.cookie=i}static createCookie(e,t,i,o){let n="",s="";if(i){const e=new Date;e.setTime(e.getTime()+1e3*i),n="; expires="+e.toGMTString()}o&&(s="; domain="+o),t=encodeURIComponent(t),document.cookie=e+"="+t+n+s+"; path=/"}static readCookie(e){const t=e+"=",i=document.cookie.split(";");for(let e=0;e=0;o--){if(a=0===o?r[o]+a:"."+r[o]+a,this.readCookie(e)){var n="test_"+e+o;if(this.createCookie(n,t,10,a),!this.readCookie(n))continue;this.removeCookie(n,a)}this.createCookie(e,t,i,a);if(this.readCookie(e)==t){s=a,le.broadDomain=s;break}}}else this.createCookie(e,t,i,s)}else this.createCookie(e,t,i,o)}static getMetaProp(e){const t=this.readFromLSorCookie(k);if(null!=t)return t[e]}static setMetaProp(e,t){if(this._isLocalStorageSupported()){let i=this.readFromLSorCookie(k);null==i&&(i={}),void 0===t?delete i[e]:i[e]=t,this.saveToLSorCookie(k,i)}}static getAndClearMetaProp(e){const t=this.getMetaProp(e);return this.setMetaProp(e,void 0),t}static setInstantDeleteFlagInK(){let e=this.readFromLSorCookie(m);null==e&&(e={}),e.flag=!0,this.saveToLSorCookie(m,e)}static backupEvent(e,t,i){let o=this.readFromLSorCookie(S);void 0===o&&(o={}),o[t]={q:e},this.saveToLSorCookie(S,o),i.debug("stored in ".concat(S," reqNo : ").concat(t," -> ").concat(e))}static removeBackup(e,t){const i=this.readFromLSorCookie(S);null!=i&&void 0!==i[e]&&(t.debug("del event: ".concat(e," data-> ").concat(i[e].q)),delete i[e],this.saveToLSorCookie(S,i))}}const le={globalCache:{gcookie:null,REQ_N:0,RESP_N:0},LRU_CACHE:null,globalProfileMap:void 0,globalEventsMap:void 0,blockRequest:!1,isOptInRequest:!1,broadDomain:null,webPushEnabled:null,campaignDivMap:{},currentSessionId:null,wiz_counter:0,notifApi:{notifEnabledFromApi:!1},unsubGroups:[],updatedCategoryLong:null,inbox:null,isPrivacyArrPushed:!1,privacyArray:[],offline:!1,location:null,dismissSpamControl:!1,globalUnsubscribe:!0,flutterVersion:null,variableStore:{}};var ce=t("keyOrder"),de=t("deleteFromObject");class he{constructor(e){Object.defineProperty(this,de,{value:ue}),Object.defineProperty(this,ce,{writable:!0,value:void 0}),this.max=e;let t=ae.readFromLSorCookie(E);if(t){const e={};i(this,ce)[ce]=[],t=t.cache;for(const o in t)t.hasOwnProperty(o)&&(e[t[o][0]]=t[o][1],i(this,ce)[ce].push(t[o][0]));this.cache=e}else this.cache={},i(this,ce)[ce]=[]}get(e){const t=this.cache[e];return t&&(this.cache=i(this,de)[de](e,this.cache),this.cache[e]=t,i(this,ce)[ce].push(e)),this.saveCacheToLS(this.cache),t}set(e,t){const o=this.cache[e],n=i(this,ce)[ce];null!=o?this.cache=i(this,de)[de](e,this.cache):n.length===this.max&&(this.cache=i(this,de)[de](n[0],this.cache)),this.cache[e]=t,i(this,ce)[ce][i(this,ce)[ce]-1]!==e&&i(this,ce)[ce].push(e),this.saveCacheToLS(this.cache)}saveCacheToLS(e){const t=[],o=i(this,ce)[ce];for(const i in o)if(o.hasOwnProperty(i)){const n=[];n.push(o[i]),n.push(e[o[i]]),t.push(n)}ae.saveToLSorCookie(E,{cache:t})}getKey(e){if(null===e)return null;const t=i(this,ce)[ce];for(const i in t)if(t.hasOwnProperty(i)&&this.cache[t[i]]===e)return t[i];return null}getSecondLastKey(){const e=i(this,ce)[ce];return null!=e&&e.length>1?e[e.length-2]:-1}getLastKey(){const e=i(this,ce)[ce].length;if(e)return i(this,ce)[ce][e-1]}}var ue=function(e,t){const o=JSON.parse(JSON.stringify(i(this,ce)[ce])),n={};let s;for(const i in o)o.hasOwnProperty(i)&&(o[i]!==e?n[o[i]]=t[o[i]]:s=i);return o.splice(s,1),i(this,ce)[ce]=JSON.parse(JSON.stringify(o)),n},pe=t("logger"),ge=t("request"),fe=t("device"),ve=t("session");class be{constructor(e){let{logger:t,request:o,device:n,session:s}=e;Object.defineProperty(this,pe,{writable:!0,value:void 0}),Object.defineProperty(this,ge,{writable:!0,value:void 0}),Object.defineProperty(this,fe,{writable:!0,value:void 0}),Object.defineProperty(this,ve,{writable:!0,value:void 0}),i(this,pe)[pe]=t,i(this,ge)[ge]=o,i(this,fe)[fe]=n,i(this,ve)[ve]=s}s(e,t,o,n,s){let r=!1,a=!1;if(window.isOULInProgress&&(o||"undefined"!==n&&n===window.oulReqN)&&(window.isOULInProgress=!1,r=!0),void 0===n&&(n=0),ae.removeBackup(n,i(this,pe)[pe]),n>le.globalCache.REQ_N)return;if(X(i(this,fe)[fe].gcookie)||e&&(a=!0),!X(i(this,fe)[fe].gcookie)||o||"boolean"==typeof s){const n=i(this,ve)[ve].getSessionCookieObject();if(window.isOULInProgress||n.s&&t{if(J(e)){for(var t in e)if(e.hasOwnProperty(t)){if(J(e[t])||Array.isArray(e[t]))return!1;Z(e[t])&&(e[t]=ne(e[t]))}return!0}return!1},Re=(e,t)=>{if(J(e)){for(var i in e)if(e.hasOwnProperty(i))if("Items"===i){if(!Array.isArray(e[i]))return!1;for(var o in e[i].length>50&&t.reportError(522,"Charged Items exceed 50 limit. Actual count: "+e[i].length),e[i])if(e[i].hasOwnProperty(o)&&(!J(e[i][o])||!Te(e[i][o])))return!1}else{if(J(e[i])||Array.isArray(e[i]))return!1;Z(e[i])&&(e[i]=ne(e[i]))}if(H(e[f])||Q(e[f])){const i=e[f]+"";if(void 0===Me&&(Me=ae.readFromLSorCookie(v)),void 0!==Me&&Me.trim()===i.trim())return t.error("Duplicate charged Id - Dropped"+e),!1;Me=i,ae.saveToLSorCookie(v,i)}return!0}return!1};var je=t("logger"),De=t("oldValues"),ze=t("request"),Be=t("isPersonalisationActive"),Ne=t("processEventArray");class Fe extends Array{constructor(e,t){let{logger:o,request:n,isPersonalisationActive:s}=e;super(),Object.defineProperty(this,Ne,{value:Ue}),Object.defineProperty(this,je,{writable:!0,value:void 0}),Object.defineProperty(this,De,{writable:!0,value:void 0}),Object.defineProperty(this,ze,{writable:!0,value:void 0}),Object.defineProperty(this,Be,{writable:!0,value:void 0}),i(this,je)[je]=o,i(this,De)[De]=t,i(this,ze)[ze]=n,i(this,Be)[Be]=s}push(){for(var e=arguments.length,t=new Array(e),o=0;o0;){var t=e.shift();if(!H(t)){i(this,je)[je].error(xe);continue}if(t.length>1024&&(t=t.substring(0,1024),i(this,je)[je].reportError(510,t+"... length exceeded 1024 chars. Trimmed.")),G.includes(t)){i(this,je)[je].reportError(513,t+" is a restricted system event. It cannot be used as an event name.");continue}const o={type:"event"};if(o.evtName=te(t,h),0!==e.length){const n=e.shift();if(J(n)){if("Charged"===t){if(!Re(n,i(this,je)[je])){i(this,je)[je].reportError(511,"Charged event structure invalid. Not sent.");continue}}else if(!Te(n)){i(this,je)[je].reportError(512,t+" event structure invalid. Not sent.");continue}o.evtData=n}else e.unshift(n)}i(this,ze)[ze].processEvent(o)}};const qe=e=>{const t={},i=e.indexOf("?");if(i>1){const o=e.substring(i+1);let n;const s=/\+/g,r=/([^&=]+)=?([^&]*)/g,a=function(e){let t=e.replace(s," ");try{t=decodeURIComponent(t)}catch(e){}return t};for(n=r.exec(o);n;)t[a(n[1])]=a(n[2]),n=r.exec(o)}return t},Ve=(e,t,i)=>e+"&"+t+"="+encodeURIComponent(i),We=()=>window.location.hostname,Ke=(e,t)=>(t&&"function"==typeof t.debug&&t.debug("dobj:"+e),He(e)),Ge=(()=>{let e="",t=0;for(t=0;t<=25;t++)e+=String.fromCharCode(t+65);for(t=0;t<=25;t++)e+=String.fromCharCode(t+97);for(t=0;t<10;t++)e+=t;return e+"+/="})(),He=e=>{if(null==e)return"";var t,i,o,n,s,r,a,l="",c=0;for(e=(e=>{if(null==e)return"";let t,i,o,n={},s={},r="",a="",l="",c=2,d=3,h=2,u="",p=0,g=0,f=String.fromCharCode;for(o=0;o>=1}else{for(i=1,t=0;t>=1}c--,0==c&&(c=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;c--,0==c&&(c=Math.pow(2,h),h++),n[a]=d++,l=String(r)}if(""!==l){if(Object.prototype.hasOwnProperty.call(s,l)){if(l.charCodeAt(0)<256){for(t=0;t>=1}else{for(i=1,t=0;t>=1}c--,0==c&&(c=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;c--,0==c&&(c=Math.pow(2,h),h++)}for(i=2,t=0;t>=1;for(;;){if(p<<=1,15==g){u+=f(p);break}g++}return u})(e);c<2*e.length;)c%2==0?(t=e.charCodeAt(c/2)>>8,i=255&e.charCodeAt(c/2),o=c/2+1>8:NaN):(t=255&e.charCodeAt((c-1)/2),(c+1)/2>8,o=255&e.charCodeAt((c+1)/2)):i=o=NaN),c+=3,n=t>>2,s=(3&t)<<4|i>>4,r=(15&i)<<2|o>>6,a=63&o,isNaN(i)?r=a=64:isNaN(o)&&(a=64),l=l+Ge.charAt(n)+Ge.charAt(s)+Ge.charAt(r)+Ge.charAt(a);return l};var Je=t("fireRequest"),Ze=t("dropRequestDueToOptOut"),$e=t("addUseIPToRequest"),Ye=t("addARPToRequest");class Qe{constructor(){this.networkRetryCount=0,this.minDelayFrequency=0}static fireRequest(e,t,o,n){i(this,Je)[Je](e,1,t,o,n)}getDelayFrequency(){if(this.logger.debug("Network retry #"+this.networkRetryCount),this.networkRetryCount<10)return this.logger.debug(this.account.id,"Failure count is "+this.networkRetryCount+". Setting delay frequency to 1s"),this.minDelayFrequency=W,this.minDelayFrequency;if(null==this.account.region)return this.logger.debug(this.account.id,"Setting delay frequency to 1s"),W;{const e=1e3*(Math.floor(10*Math.random())+1);return this.minDelayFrequency+=e,this.minDelayFrequency<6e5?(this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency):(this.minDelayFrequency=W,this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency)}}}Qe.logger=void 0,Qe.device=void 0,Qe.account=void 0,Object.defineProperty(Qe,Je,{value:function(e,t,o,n,s){var r,a;if(i(this,Ze)[Ze]())return void this.logger.debug("req dropped due to optout cookie: "+this.device.gcookie);if(X(this.device.gcookie)||(le.blockRequest=!0),s&&s===K)!X(this.device.gcookie)&&le.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(this.networkRetryCount)),i(this,Je)[Je](e,void 0,o,n)}),this.getDelayFrequency());else if(!X(this.device.gcookie)&&le.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(t)),i(this,Je)[Je](e,t+1,o,n)}),50);if(n?window.isOULInProgress=!0:(X(this.device.gcookie)&&(e=Ve(e,"gc",this.device.gcookie)),e=i(this,Ye)[Ye](e,o)),e=Ve(e,"tries",t),e=i(this,$e)[$e](e),e=Ve(e,"r",(new Date).getTime()),(null===(r=window.clevertap)||void 0===r?void 0:r.hasOwnProperty("plugin"))||(null===(a=window.wizrocket)||void 0===a?void 0:a.hasOwnProperty("plugin"))){const t=window.clevertap.plugin||window.wizrocket.plugin;e=Ve(e,"ct_pl",t)}-1!==e.indexOf("chrome-extension:")&&(e=e.replace("chrome-extension:","https:"));for(var l=document.getElementsByClassName("ct-jp-cb");l[0]&&l[0].parentNode;)l[0].parentNode.removeChild(l[0]);const c=document.createElement("script");c.setAttribute("type","text/javascript"),c.setAttribute("src",e),c.setAttribute("class","ct-jp-cb"),c.setAttribute("rel","nofollow"),c.async=!0,document.getElementsByTagName("head")[0].appendChild(c),this.logger.debug("req snt -> url: "+e)}}),Object.defineProperty(Qe,Ze,{value:function(){return!le.isOptInRequest&&X(this.device.gcookie)&&H(this.device.gcookie)?":OO"===this.device.gcookie.slice(-3):(le.isOptInRequest=!1,!1)}}),Object.defineProperty(Qe,$e,{value:function(e){var t=ae.getMetaProp(_);return"boolean"!=typeof t&&(t=!1),Ve(e,_,t?"true":"false")}}),Object.defineProperty(Qe,Ye,{value:function(e,t){if(!0===t){const t={skipResARP:!0};return Ve(e,"arp",Ke(JSON.stringify(t),this.logger))}return ae._isLocalStorageSupported()&&void 0!==localStorage.getItem(P)&&null!==localStorage.getItem(P)?Ve(e,"arp",Ke(JSON.stringify(ae.readFromLSorCookie(P)),this.logger)):e}});const Xe=()=>{let e={};if(ae._isLocalStorageSupported()){let t=ae.read(y);null!=t?(t=JSON.parse(decodeURIComponent(t).replace(p,'"')),t.hasOwnProperty("global")?e.wp=t:e=t):e={}}return e},et=e=>{if(ae._isLocalStorageSupported()){const t={...Xe(),...e},i=JSON.stringify(t);ae.save(y,encodeURIComponent(i)),tt()}},tt=()=>{if(ae._isLocalStorageSupported()){let i=ae.read(b);if(X(i))try{i=JSON.parse(decodeURIComponent(ae.read(b)));const o=ae.read(w)?JSON.parse(decodeURIComponent(ae.read(w))):{};if(i&&ae._isLocalStorageSupported()){var e={},t=Xe();Object.keys(t).forEach((n=>{const s=i in o&&Object.keys(o[i]).length&&o[i][n]?o[i][n]:{},r=t[n].global,a=ie(),l=t[n][a];if(void 0!==r){const e=Object.keys(r);for(const t in e){let i=[];if(e.hasOwnProperty(t)){let o=0,n=0;const a=e[t];if("tc"===a)continue;void 0!==l&&void 0!==l[a]&&(o=l[a]),void 0!==r&&void 0!==r[a]&&(n=r[a]),i=[a,o,n],s[a]=i}}}e={...e,[n]:s}})),o[i]=e,ae.save(w,encodeURIComponent(JSON.stringify(o)))}}catch(e){console.error("Invalid clevertap Id "+e)}}},it=()=>{const e=JSON.parse(decodeURIComponent(ae.read(b)));let t={};if(ae._isLocalStorageSupported()){let i={};t=Xe();const o=ae.read(w),n=o?decodeURIComponent(o):null,s=n?JSON.parse(n):null,r=e&&null!=o&&s&&s[e]&&s[e].wp?Object.values(s[e].wp):[],a=e&&null!=o&&s&&s[e]&&s[e].wi?Object.values(s[e].wi):[],l=ie();let c=0,d=0;return t.wp&&t.wp[l]&&"undefined"!==t.wp[l].tc&&(c=t.wp[l].tc),t.wi&&t.wi[l]&&"undefined"!==t.wi[l].tc&&(d=t.wi[l].tc),i={wmp:c,wimp:d,tlc:r,witlc:a},i}},ot=(e,t)=>{let{logger:i}=t,o=!1;if(J(e))for(const t in e)if(e.hasOwnProperty(t)){o=!0;let n=e[t];if(null==n){delete e[t];continue}"Gender"!==t||n.match(/^M$|^F$/)||(o=!1,i.error(Pe)),"Employed"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Se)),"Married"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Ie)),"Education"!==t||n.match(/^School$|^College$|^Graduate$/)||(o=!1,i.error(Oe)),"Age"===t&&null!=n&&(Y(n)?e.Age=+n:(o=!1,i.error(_e))),"DOB"===t?(/^\$D_/.test(n)&&11===(n+"").length||Z(n)||(o=!1,i.error(Ee)),Z(n)&&(e[t]=ne(n))):Z(n)&&(e[t]=ne(n)),"Phone"!==t||$(n)||(n.length>8&&"+"===n.charAt(0)?(n=n.substring(1,n.length),Y(n)?e.Phone=+n:(o=!1,i.error(Le+". Removed."))):(o=!1,i.error(Le+". Removed."))),o||delete e[t]}return o},nt=e=>{const t={};t.Name=e.name,null!=e.id&&(t.FBID=e.id+""),"male"===e.gender?t.Gender="M":"female"===e.gender?t.Gender="F":t.Gender="O";null!=e.relationship_status&&(t.Married="N","Married"===e.relationship_status&&(t.Married="Y"));const i=function(e){if(null!=e){let t="",i="";for(let o=0;o0?"Y":"N",null!=e.email&&(t.Email=e.email),null!=e.birthday){const i=e.birthday.split("/");t.DOB=se(i[2]+i[0]+i[1])}return t},st=(e,t)=>{let{logger:i}=t;const o={};if(null!=e.displayName&&(o.Name=e.displayName),null!=e.id&&(o.GPID=e.id+""),null!=e.gender&&("male"===e.gender?o.Gender="M":"female"===e.gender?o.Gender="F":"other"===e.gender&&(o.Gender="O")),null!=e.image&&!1===e.image.isDefault&&(o.Photo=e.image.url.split("?sz")[0]),null!=e.emails)for(let t=0;t{if(ae._isLocalStorageSupported()){if(null==le.globalProfileMap&&(le.globalProfileMap=ae.readFromLSorCookie(x),null==le.globalProfileMap&&(le.globalProfileMap={})),null!=e._custom){const t=e._custom;for(const i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);delete e._custom}for(const i in e)if(e.hasOwnProperty(i)){if(le.globalProfileMap.hasOwnProperty(i)&&!t)continue;le.globalProfileMap[i]=e[i]}null!=le.globalProfileMap._custom&&delete le.globalProfileMap._custom,ae.saveToLSorCookie(x,le.globalProfileMap)}},at=(e,t,i)=>{if(null!=e&&"-1"!==e&&ae._isLocalStorageSupported()){const t=Xe();let o=t.wp[i];null==o&&(o={},t[i]=o),o[e]="dnd",et(t)}if(null!=le.campaignDivMap){const t=le.campaignDivMap[e];null!=t&&(document.getElementById(t).style.display="none","intentPreview"===t&&null!=document.getElementById("intentOpacityDiv")&&(document.getElementById("intentOpacityDiv").style.display="none"))}};var lt=t("logger"),ct=t("request"),dt=t("account"),ht=t("oldValues"),ut=t("isPersonalisationActive"),pt=t("processProfileArray");class gt extends Array{constructor(e,t){let{logger:o,request:n,account:s,isPersonalisationActive:r}=e;super(),Object.defineProperty(this,pt,{value:ft}),Object.defineProperty(this,lt,{writable:!0,value:void 0}),Object.defineProperty(this,ct,{writable:!0,value:void 0}),Object.defineProperty(this,dt,{writable:!0,value:void 0}),Object.defineProperty(this,ht,{writable:!0,value:void 0}),Object.defineProperty(this,ut,{writable:!0,value:void 0}),i(this,lt)[lt]=o,i(this,ct)[ct]=n,i(this,dt)[dt]=s,i(this,ht)[ht]=t,i(this,ut)[ut]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o0)for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];let n,s={};if(null!=o.Site){if(n=o.Site,$(n)||!ot(n,{logger:i(this,lt)[lt]}))return}else if(null!=o.Facebook){const e=o.Facebook;$(e)||e.error||(n=nt(e))}else if(null!=o["Google Plus"]){const e=o["Google Plus"];$(e)||e.error||(n=st(e,{logger:i(this,lt)[lt]}))}if(null!=n&&!$(n)){s.type="profile",null==n.tz&&(n.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),s.profile=n,rt(n,!0),s=i(this,ct)[ct].addSystemDataToObject(s,void 0),i(this,ct)[ct].addFlags(s);const e=Ke(JSON.stringify(s),i(this,lt)[lt]);let t=i(this,dt)[dt].dataPostURL;t=Ve(t,"type",A),t=Ve(t,"d",e),i(this,ct)[ct].saveAndFireRequest(t,le.blockRequest)}}},vt=t("request"),bt=t("logger"),mt=t("account"),yt=t("session"),wt=t("oldValues"),Ct=t("device"),kt=t("processOUL"),xt=t("handleCookieFromCache"),Pt=t("deleteUser"),St=t("processLoginArray");class It extends Array{constructor(e,t){let{request:o,account:n,session:s,logger:r,device:a}=e;super(),Object.defineProperty(this,St,{value:At}),Object.defineProperty(this,Pt,{value:Et}),Object.defineProperty(this,xt,{value:_t}),Object.defineProperty(this,kt,{value:Ot}),Object.defineProperty(this,vt,{writable:!0,value:void 0}),Object.defineProperty(this,bt,{writable:!0,value:void 0}),Object.defineProperty(this,mt,{writable:!0,value:void 0}),Object.defineProperty(this,yt,{writable:!0,value:void 0}),Object.defineProperty(this,wt,{writable:!0,value:void 0}),Object.defineProperty(this,Ct,{writable:!0,value:void 0}),i(this,vt)[vt]=o,i(this,mt)[mt]=n,i(this,yt)[yt]=s,i(this,bt)[bt]=r,i(this,wt)[wt]=t,i(this,Ct)[Ct]=a}clear(){i(this,bt)[bt].debug("clear called. Reset flag has been set."),i(this,Pt)[Pt](),ae.setMetaProp(g,!0)}push(){for(var e=arguments.length,t=new Array(e),o=0;o{let o=ae.readFromLSorCookie(m);const n=ae.readFromLSorCookie(b);let s;if(null==o)o={},s=e;else{s=o.id;let r=!1,a=!1;if(null==s&&(s=e[0],r=!0),null==le.LRU_CACHE&&ae._isLocalStorageSupported()&&(le.LRU_CACHE=new he(100)),r)null!=n&&(le.LRU_CACHE.set(s,n),le.blockRequest=!1);else for(const t in e)if(e.hasOwnProperty(t)){const i=e[t];if(le.LRU_CACHE.cache[i]){s=i,a=!0;break}}if(a){s!==le.LRU_CACHE.getLastKey()?i(this,xt)[xt]():(t=!1,ae.saveToLSorCookie(D,t));const e=le.LRU_CACHE.get(s);le.LRU_CACHE.set(s,e),ae.saveToLSorCookie(b,e),i(this,Ct)[Ct].gcookie=e;const o=le.LRU_CACHE.getSecondLastKey();if(ae.readFromLSorCookie(D)&&-1!==o){const e=le.LRU_CACHE.cache[o];i(this,vt)[vt].unregisterTokenForGuid(e)}}else r?null!=n&&(i(this,Ct)[Ct].gcookie=n,ae.saveToLSorCookie(b,n),t=!1):this.clear(),ae.saveToLSorCookie(D,!1),s=e[0]}o.id=s,ae.saveToLSorCookie(m,o)};if(Array.isArray(e)&&e.length>0)for(const n in e)if(e.hasOwnProperty(n)){const s=e[n];let r,a={};if(null!=s.Site){if(r=s.Site,$(r)||!ot(r,{logger:i(this,bt)[bt]}))return}else if(null!=s.Facebook){const e=s.Facebook;$(e)||e.error||(r=nt(e))}else if(null!=s["Google Plus"]){const e=s["Google Plus"];$(e)&&!e.error&&(r=st(e,{logger:i(this,bt)[bt]}))}if(null!=r&&!$(r)){a.type="profile",null==r.tz&&(r.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),a.profile=r;const e=[];ae._isLocalStorageSupported()&&(r.Identity&&e.push(r.Identity),r.Email&&e.push(r.Email),r.GPID&&e.push("GP:"+r.GPID),r.FBID&&e.push("FB:"+r.FBID),e.length>0&&o(e)),rt(r,!0),a=i(this,vt)[vt].addSystemDataToObject(a,void 0),i(this,vt)[vt].addFlags(a),t&&(a.isOUL=!0);const n=Ke(JSON.stringify(a),i(this,bt)[bt]);let s=i(this,mt)[mt].dataPostURL;s=Ve(s,"type",A),s=Ve(s,"d",n),i(this,vt)[vt].saveAndFireRequest(s,le.blockRequest,t)}}},_t=function(){le.blockRequest=!1,console.debug("Block request is false"),ae._isLocalStorageSupported()&&(delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),ae.removeCookie(y,We()),ae.removeCookie(i(this,yt)[yt].cookieName,le.broadDomain),ae.removeCookie(P,le.broadDomain),i(this,yt)[yt].setSessionCookieObject("")},Et=function(){le.blockRequest=!0,i(this,bt)[bt].debug("Block request is true"),le.globalCache={gcookie:null,REQ_N:0,RESP_N:0},ae._isLocalStorageSupported()&&(delete localStorage.WZRK_G,delete localStorage.WZRK_K,delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),ae.removeCookie(b,le.broadDomain),ae.removeCookie(y,We()),ae.removeCookie(m,We()),ae.removeCookie(i(this,yt)[yt].cookieName,le.broadDomain),ae.removeCookie(P,le.broadDomain),i(this,Ct)[Ct].gcookie=null,i(this,yt)[yt].setSessionCookieObject("")},At=function(e){if(Array.isArray(e)&&e.length>0){const t=e.pop();if(null!=t&&J(t)&&(null!=t.Site&&Object.keys(t.Site).length>0||null!=t.Facebook&&Object.keys(t.Facebook).length>0||null!=t["Google Plus"]&&Object.keys(t["Google Plus"]).length>0)){ae.setInstantDeleteFlagInK();try{i(this,kt)[kt]([t])}catch(e){i(this,bt)[bt].debug(e)}}else i(this,bt)[bt].error("Profile object is in incorrect format")}};class Lt extends HTMLElement{constructor(){super(),this._details=null,this.shadow=null,this.shadow=this.attachShadow({mode:"open"})}get details(){return this._details||""}set details(e){null===this._details&&(this._details=e,this.renderBanner())}renderBanner(){this.shadow.innerHTML=this.getBannerContent(),!1!==this.trackClick&&this.addEventListener("click",(()=>{const e=this.details.onClick;e&&(this.details.window?window.open(e,"_blank"):window.parent.location.href=e),window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId})}getBannerContent(){return'\n \n \n ")}}class Mt extends HTMLElement{constructor(){super(),this._target=null,this._carousel=null,this.shadow=null,this.slides=0,this.previouslySelectedItem=-1,this.selectedItem=1,this.autoSlide=null,this.stopAutoSlideTimeout=null,this.shadow=this.attachShadow({mode:"open"}),void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Lt)}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderCarousel())}get details(){return this.target.display.details}get display(){return this.target.display}renderCarousel(){this.slides=this.details.length,this.shadow.innerHTML=this.getStyles();const e=this.getCarouselContent();this.display.showNavBtns&&e.insertAdjacentHTML("beforeend",this.display.navBtnsHtml),this.display.showNavArrows&&(e.insertAdjacentHTML("beforeend",this.display.leftNavArrowHtml),e.insertAdjacentHTML("beforeend",this.display.rightNavArrowHtml)),this._carousel=e,this.shadow.appendChild(e),this.setupClick(),this.updateSelectedItem(),this.startAutoSlide(),this.setupOnHover(),window.clevertap.renderNotificationViewed({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot})}setupClick(){this._carousel.addEventListener("click",(e=>{const t=e.target.id;if(t.startsWith("carousel__button")){const e=+t.split("-")[1];e!==this.selectedItem&&(this.previouslySelectedItem=this.selectedItem,this.selectedItem=e,this.updateSelectedItem(),this.startAutoSlide())}else if(t.startsWith("carousel__arrow"))t.endsWith("right")?this.goToNext():this.goToPrev(),this.startAutoSlide();else if(t.indexOf("-")>-1){const e=+t.split("-")[1],i=e-1;window.parent.clevertap&&window.clevertap.renderNotificationClicked({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot,wzrk_slideNo:e});const o=this.details[i].onClick;""!==o&&(this.details[i].window?window.open(o,"_blank"):window.location.href=o)}}))}setupOnHover(){this._carousel.addEventListener("mouseenter",(e=>{this.stopAutoSlideTimeout=setTimeout((()=>{this.autoSlide=clearInterval(this.autoSlide)}),500)})),this._carousel.addEventListener("mouseleave",(e=>{clearTimeout(this.stopAutoSlideTimeout),void 0===this.autoSlide&&this.startAutoSlide()}))}getCarouselContent(){const e=document.createElement("div");return e.setAttribute("class","carousel"),this.details.forEach(((t,i)=>{const o=document.createElement("ct-web-personalisation-banner");o.classList.add("carousel__item"),o.trackClick=!1,o.setAttribute("id","carousel__item-".concat(i+1)),o.details=t,e.appendChild(o)})),e}getStyles(){var e,t;return"\n \n ")}updateSelectedItem(){if(-1!==this.previouslySelectedItem){const e=this.shadow.getElementById("carousel__item-".concat(this.previouslySelectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.previouslySelectedItem));e.classList.remove("carousel__item--selected"),t&&t.classList.remove("carousel__button--selected")}const e=this.shadow.getElementById("carousel__item-".concat(this.selectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.selectedItem));e.classList.add("carousel__item--selected"),t&&t.classList.add("carousel__button--selected")}startAutoSlide(){clearInterval(this.autoSlide),this.autoSlide=setInterval((()=>{this.goToNext()}),this.display.sliderTime?1e3*this.display.sliderTime:3e3)}goToNext(){this.goTo(this.selectedItem,(this.selectedItem+1)%this.slides)}goToPrev(){this.goTo(this.selectedItem,this.selectedItem-1)}goTo(e,t){this.previouslySelectedItem=e,this.selectedItem=t,0===t&&(this.selectedItem=this.slides),this.updateSelectedItem()}}class Tt extends HTMLElement{constructor(){super(),this._target=null,this._session=null,this.shadow=null,this.popup=null,this.container=null,this.resizeObserver=null,this.shadow=this.attachShadow({mode:"open"})}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderImageOnlyPopup())}get session(){return this._session||""}set session(e){this._session=e}get msgId(){return this.target.wzrk_id}get pivotId(){return this.target.wzrk_pivot}get onClickUrl(){return this.target.display.onClickUrl}renderImageOnlyPopup(){const e=this.target.wzrk_id.split("_")[0],t=this.session.sessionId;this.shadow.innerHTML=this.getImageOnlyPopupContent(),this.popup=this.shadowRoot.getElementById("imageOnlyPopup"),this.container=this.shadowRoot.getElementById("container"),this.closeIcon=this.shadowRoot.getElementById("close"),this.popup.addEventListener("load",this.updateImageAndContainerWidth()),this.resizeObserver=new ResizeObserver((()=>this.handleResize(this.popup,this.container))),this.resizeObserver.observe(this.popup),this.closeIcon.addEventListener("click",(()=>{if(this.resizeObserver.unobserve(this.popup),document.getElementById("wzrkImageOnlyDiv").style.display="none",this.remove(),null!=e&&"-1"!==e&&ae._isLocalStorageSupported()){const i=Xe();let o=i.wp[t];null==o&&(o={},i[t]=o),o[e]="dnd",et(i)}})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId}),this.onClickUrl&&this.popup.addEventListener("click",(()=>{this.target.display.window?window.open(this.onClickUrl,"_blank"):window.parent.location.href=this.onClickUrl,window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})}))}handleResize(e,t){const i=this.getRenderedImageWidth(e);t.style.setProperty("width","".concat(i,"px"))}getImageOnlyPopupContent(){return"\n ".concat(this.target.msgContent.css,"\n ").concat(this.target.msgContent.html,"\n ")}updateImageAndContainerWidth(){return()=>{const e=this.getRenderedImageWidth(this.popup);this.popup.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("height","auto"),this.container.style.setProperty("position","fixed"),this.popup.style.setProperty("visibility","visible"),this.closeIcon.style.setProperty("visibility","visible"),document.getElementById("wzrkImageOnlyDiv").style.visibility="visible"}}getRenderedImageWidth(e){const t=e.naturalWidth/e.naturalHeight;return e.height*t}}class Rt extends HTMLElement{constructor(e,t){super(),this.wrapper=null,this.snackBar=null,this.shadow=this.attachShadow({mode:"open"}),this.config=e,this.message=t,this.renderMessage(t)}get pivotId(){return this.message.wzrk_pivot}get campaignId(){return this.message.wzrk_id}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}renderMessage(e){switch(this.wrapper=this.createEl("div","messageWrapper"),e.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":{const t=this.prepareBasicMessage(e.msg[0]);this.wrapper.appendChild(t)}}const t=this.createEl("div","timeStamp");if(t.innerHTML="".concat(Wt(e.id.split("_")[1]),""),!e.viewed){const e=this.createEl("span","unreadMarker");t.appendChild(e)}this.wrapper.appendChild(t),this.shadow.appendChild(this.wrapper)}prepareBasicMessage(e){const t=this.createEl("div","message");if(e.imageUrl){const i=this.addImage(e.imageUrl,"mainImg");t.appendChild(i)}const i=this.createEl("div","iconTitleDescWrapper");if(e.iconUrl){const t=this.addImage(e.iconUrl,"iconImg");i.appendChild(t)}const o=this.createEl("div","titleDescWrapper");if(e.title){const t=this.createEl("div","title");t.innerText=e.title,o.appendChild(t)}if(e.description){const t=this.createEl("div","description");t.innerText=e.description,o.appendChild(t)}if((e.title||e.description)&&i.appendChild(o),(e.iconUrl||e.title||e.description)&&t.appendChild(i),e.buttons&&e.buttons.length){const i=this.addButtons(e.buttons);t.appendChild(i)}return t}addButtons(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.createEl("div","buttonsContainer");let i=!1;return e.forEach(((e,o)=>{const n=this.createEl("button","button-".concat(o),"button");n.innerText=e.text,o>0&&(n.style.cssText+="margin-left: 2px;"),"copy"===e.action&&(i=!0),t.appendChild(n)})),i&&this.addSnackbar(t),t}addSnackbar(e){this.snackBar=this.createEl("div","snackbar-".concat(this.campaignId),"snackbar"),this.snackBar.innerHTML=Ht;const t=this.createEl("span","snackbar-msg-".concat(this.campaignId),"snackbar-msg");t.innerText="Copied to clipboard",this.snackBar.appendChild(t),e.appendChild(this.snackBar)}addImage(e,t){const i=this.createEl("div","".concat(t,"Container")),o=this.createEl("img",t);return o.setAttribute("src",e),o.setAttribute("loading","lazy"),i.appendChild(o),i}raiseClickedEvent(e,t){switch(this.message.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":this.raiseClickedForBasicTemplates(e,t)}}raiseClickedForBasicTemplates(e,t){const i=this.message.msg[0],o={msgId:this.campaignId,pivotId:this.pivotId};if("BUTTON"===e.tagName){const t=e.id.split("-")[1],n=i.buttons[t];o.kv={wzrk_c2a:n.text},"url"===n.action?n.openUrlInNewTab?window.open(n.url,"_blank"):window.location=n.url:"copy"===n.action&&(window.focus(),navigator.clipboard.writeText(n.clipboardText),this.snackBar.style.setProperty("display","flex","important"),setTimeout((()=>{this.snackBar.style.setProperty("display","none","important")}),2e3))}else"CT-INBOX-MESSAGE"===e.tagName&&i.onClickUrl&&(i.openUrlInNewTab?window.open(i.onClickUrl,"_blank"):window.location=i.onClickUrl);t?console.log("Notifiction clicked event will be raised at run time with payload ::",o):window.clevertap.renderNotificationClicked(o)}}class jt extends HTMLElement{constructor(e){super(),this.isInboxOpen=!1,this.isInboxFromFlutter=!1,this.selectedCategory=null,this.unviewedMessages={},this.unviewedCounter=0,this.isPreview=!1,this.inboxConfigForPreview={},this.inboxSelector=null,this.inbox=null,this.emptyInboxMsg=null,this.inboxCard=null,this.unviewedBadge=null,this.observer=null,this.selectedCategoryRef=null,this.addClickListenerOnDocument=(()=>e=>{if(e.composedPath().includes(this.inbox)){const t=e.path||e.composedPath&&e.composedPath();if(t.length){const e=t[0].id;if("closeInbox"===e)this.toggleInbox();else if(e.startsWith("category-"))this.prevCategoryRef=this.selectedCategoryRef,this.selectedCategoryRef=t[0],this.updateActiveCategory(t[0].innerText);else{const e=t.filter((e=>{var t;return(null===(t=e.id)||void 0===t?void 0:t.startsWith("button-"))||"CT-INBOX-MESSAGE"===e.tagName}));if(e.length){e[e.length-1].raiseClickedEvent(e[0],this.isPreview)}}}}else(this.inboxSelector.contains(e.target)||this.isInboxOpen)&&(this.isInboxFromFlutter?this.isInboxFromFlutter=!1:this.toggleInbox(e))})(),this.setBadgeStyle=e=>{null!==this.unviewedBadge&&(this.unviewedBadge.innerText=e>9?"9+":e,this.unviewedBadge.style.display=e>0?"flex":"none")},this.logger=e,this.shadow=this.attachShadow({mode:"open"})}get incomingMessages(){return[]}set incomingMessages(e){void 0===e&&(e=[]),e.length>0&&this.inbox&&this.updateInboxMessages(e)}get incomingMessagesForPreview(){return[]}set incomingMessagesForPreview(e){void 0===e&&(e=[]);const t={};e.length>0&&this.inbox&&(this.isPreview=!0,this.unviewedCounter=0,e.forEach((e=>{const i="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=i,t[i]=e,this.unviewedMessages[i]=e,this.unviewedCounter++})),this.buildUIForMessages(t),this.updateUnviewedBadgeCounter())}connectedCallback(){this.init()}init(){this.config=this.isPreview?this.inboxConfigForPreview:ae.readFromLSorCookie(q)||{},0!==Object.keys(this.config).length&&(this.inboxSelector=document.getElementById(this.config.inboxSelector),null!==this.inboxSelector&&(this.config.styles.notificationsBadge?this.addUnviewedBadge():this.unviewedBadge&&this.unviewedBadge.remove(),this.createinbox(),document.removeEventListener("click",this.addClickListenerOnDocument),document.addEventListener("click",this.addClickListenerOnDocument),this.config.categories.length&&this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadow.innerHTML=this.getInboxStyles(),this.shadow.appendChild(this.inbox)))}addMsgsToInboxFromLS(){const e=this.deleteExpiredAndGetUnexpiredMsgs(!1),t=e?Object.keys(e):[];0!==t.length&&(t.forEach((t=>{e[t].viewed||(this.unviewedMessages[t]=e[t],this.unviewedCounter++)})),this.buildUIForMessages(e),this.updateUnviewedBadgeCounter())}deleteExpiredAndGetUnexpiredMsgs(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Nt();const i=Math.floor(Date.now()/1e3);for(const o in t)if(t[o].wzrk_ttl&&t[o].wzrk_ttl>0&&t[o].wzrk_ttl0&&(t=Object.values(t).sort(((e,t)=>t.date-e.date)).reduce(((e,t)=>(e[t.id]=t,e)),{})),Ft(t),t}updateInboxMessages(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.deleteExpiredAndGetUnexpiredMsgs(),i=Date.now(),o={};e.forEach(((e,n)=>{const s="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=s,e.date=i-n,e.viewed=0,t[s]=e,o[s]=e,this.unviewedMessages[s]=e,this.unviewedCounter++})),Ft(t),this.buildUIForMessages(o),this.updateUnviewedBadgeCounter()}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}addUnviewedBadge(){this.unviewedBadge||(this.unviewedBadge=this.createEl("div","unviewedBadge"),this.unviewedBadge.style.cssText="display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ".concat(this.config.styles.notificationsBadge.backgroundColor,"; font-size: 12px; color: ").concat(this.config.styles.notificationsBadge.textColor,"; font-weight: bold; align-items: center; justify-content: center;"),document.body.appendChild(this.unviewedBadge)),this.updateUnviewedBadgePosition(),window.addEventListener("resize",(()=>{this.updateUnviewedBadgePosition()}))}updateUnviewedBadgePosition(){const{top:e,right:t}=this.inboxSelector.getBoundingClientRect();this.unviewedBadge.style.top="".concat(e-8,"px"),this.unviewedBadge.style.left="".concat(t-8,"px")}createinbox(){this.inbox=this.createEl("div","inbox");const e=this.createEl("div","header"),t=this.createEl("div","headerTitle");t.innerText=this.config.title;const i=this.createEl("div","closeInbox");if(i.innerHTML="×",e.appendChild(t),e.appendChild(i),this.inbox.appendChild(e),this.config.categories.length){const e=this.createCategories();this.inbox.appendChild(e)}this.inboxCard=this.createEl("div","inboxCard"),this.inbox.appendChild(this.inboxCard),this.emptyInboxMsg=this.createEl("div","emptyInboxMsg"),this.emptyInboxMsg.innerText="All messages will be displayed here.",this.inboxCard.appendChild(this.emptyInboxMsg);const o={root:this.inboxCard,rootMargin:"0px",threshold:.5};this.observer=new IntersectionObserver(((e,t)=>{this.handleMessageViewed(e)}),o),this.addMsgsToInboxFromLS()}createCategories(){const e=this.createEl("div","categoriesContainer"),t=this.createEl("div","leftArrow");t.innerHTML=Gt,t.children[0].style="transform: rotate(180deg)",t.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(-70,0)})),e.appendChild(t);const i=this.createEl("div","categoriesWrapper");["All",...this.config.categories].forEach(((e,t)=>{const o=this.createEl("div","category-".concat(t),"category");o.innerText=e,0===t&&(this.selectedCategoryRef=o),i.appendChild(o)})),e.appendChild(i);const o=this.createEl("div","rightArrow");o.innerHTML=Gt,o.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(70,0)})),e.appendChild(o);const n={root:e,threshold:.9},s=i.children[0],r=i.children[this.config.categories.length];new IntersectionObserver((e=>{this.categoryObserverCb(t,e[0].intersectionRatio>=.9)}),n).observe(s);return new IntersectionObserver((e=>{this.categoryObserverCb(o,e[0].intersectionRatio>=.9)}),n).observe(r),e}categoryObserverCb(e,t){e&&(e.style.display=t?"none":"flex")}updateActiveCategory(e){this.selectedCategory=e,this.inboxCard.scrollTop=0;let t=0;this.prevCategoryRef&&this.prevCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef.setAttribute("selected","true"),this.inboxCard.childNodes.forEach((e=>{"emptyInboxMsg"!==e.getAttribute("id")&&(e.style.display="All"===this.selectedCategory||e.getAttribute("category")===this.selectedCategory?"block":"none","block"===e.style.display&&t++)})),0===t?(this.emptyInboxMsg.innerText="".concat(e," messages will be displayed here."),this.emptyInboxMsg.style.display="block"):this.emptyInboxMsg.style.display="none"}buildUIForMessages(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!this.isPreview&&this.updateTSForRenderedMsgs(),this.inboxCard.scrollTop=0;const i=null!==(e=this.config.maxMsgsInInbox)&&void 0!==e?e:15,o=this.inboxCard.firstChild,n=Object.values(t).sort(((e,t)=>t.date-e.date)).map((e=>e.id));for(const e of n){const i=new Rt(this.config,t[e]);i.setAttribute("id",t[e].id),i.setAttribute("pivot",t[e].wzrk_pivot),i.setAttribute("part","ct-inbox-message"),this.config.categories.length>0?(i.setAttribute("category",t[e].tags[0]||""),i.style.display="All"===this.selectedCategory||t[e].category===this.selectedCategory?"block":"none"):i.style.display="block",this.inboxCard.insertBefore(i,o),this.observer.observe(i)}let s=this.inboxCard.querySelectorAll("ct-inbox-message").length;for(;s>i;){const e=this.inboxCard.querySelectorAll("ct-inbox-message");e.length>0&&e[e.length-1].remove(),s--}const r=this.inboxCard.querySelectorAll('ct-inbox-message[style*="display: block"]').length;this.emptyInboxMsg.style.display=r?"none":"block"}handleMessageViewed(e){const t=!this.isPreview;this.isInboxOpen&&e.forEach((e=>{e.isIntersecting&&this.unviewedMessages.hasOwnProperty(e.target.id)&&0===e.target.message.viewed&&(e.target.message.viewed=1,t?(window.clevertap.renderNotificationViewed({msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.updateMessageInLS(e.target.id,{...e.target.message,viewed:1}),setTimeout((()=>{e.target.shadowRoot.getElementById("unreadMarker").style.display="none"}),1e3)):console.log("Notifiction viewed event will be raised at run time with payload ::",{msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.unviewedCounter--,this.updateUnviewedBadgeCounter(),delete this.unviewedMessages[e.target.id])}))}updateMessageInLS(e,t){if(!this.isPreview){const i=Nt();i[e]=t,Ft(i)}}toggleInbox(e){this.isInboxOpen=!this.isInboxOpen,this.isInboxFromFlutter=!!(null==e?void 0:e.rect),this.isInboxOpen?(this.inboxCard.scrollTop=0,!this.isPreview&&this.deleteExpiredAndGetUnexpiredMsgs(),this.inbox.style.display="block",this.inbox.style.zIndex="2147483647",this.config.categories.length&&(this.selectedCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef=this.shadowRoot.getElementById("category-0"),this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadowRoot.getElementById("categoriesWrapper").scrollLeft-=this.shadowRoot.getElementById("categoriesWrapper").scrollWidth),this.setInboxPosition(e)):this.inbox.style.display="none"}setInboxPosition(e){const t=window.outerWidth,i=getComputedStyle(le.inbox),o=i.getPropertyValue("--inbox-top"),n=i.getPropertyValue("--inbox-bottom"),s=i.getPropertyValue("--inbox-left"),r=i.getPropertyValue("--inbox-right");if(t>481&&!(o||n||s||r)){const t=Vt(e,this.inbox.clientHeight,this.inbox.clientWidth),i=t.xPos,o=t.yPos;this.inbox.style.top=o+"px",this.inbox.style.left=i+"px"}}updateUnviewedBadgeCounter(){if(this.isPreview)return void this.setBadgeStyle(this.unviewedCounter);let e=0;this.inboxCard.querySelectorAll("ct-inbox-message").forEach((t=>{const i=Nt();i[t.id]&&0===i[t.id].viewed&&e++})),this.setBadgeStyle(e)}updateTSForRenderedMsgs(){this.inboxCard.querySelectorAll("ct-inbox-message").forEach((e=>{const t=e.id.split("_")[1];e.shadow.getElementById("timeStamp").firstChild.innerText=Wt(t)}))}getInboxStyles(){const e=this.config.categories.length?64:16,t={panelBackgroundColor:this.config.styles.panelBackgroundColor,panelBorderColor:this.config.styles.panelBorderColor,headerBackgroundColor:this.config.styles.header.backgroundColor,headerTitleColor:this.config.styles.header.titleColor,closeIconColor:this.config.styles.closeIconColor,categoriesTabColor:this.config.styles.categories.tabColor,categoriesTitleColor:this.config.styles.categories.titleColor,selectedCategoryTabColor:this.config.styles.categories.selectedTab.tabColor,selectedCategoryTitleColor:this.config.styles.categories.selectedTab.titleColor,headerCategoryHeight:36+e};this.config.styles.categories.borderColor&&(t.categoriesBorderColor=this.config.styles.categories.borderColor),this.config.styles.categories.selectedTab.borderColor&&(t.selectedCategoryBorderColor=this.config.styles.categories.selectedTab.borderColor);const i=(e=>{let{panelBackgroundColor:t,panelBorderColor:i,headerBackgroundColor:o,headerTitleColor:n,closeIconColor:s,categoriesTabColor:r,categoriesTitleColor:a,categoriesBorderColor:l,selectedCategoryTabColor:c,selectedCategoryTitleColor:d,selectedCategoryBorderColor:h,headerCategoryHeight:u}=e;return'\n \n ")})(t),o=this.config.styles.cards;return i+(e=>{let{backgroundColor:t,borderColor:i,titleColor:o,descriptionColor:n,buttonColor:s,buttonTextColor:r,unreadMarkerColor:a}=e;return'\n \n ")})({backgroundColor:o.backgroundColor,borderColor:o.borderColor,titleColor:o.titleColor,descriptionColor:o.descriptionColor,buttonColor:o.buttonColor,buttonTextColor:o.buttonTextColor,unreadMarkerColor:o.unreadMarkerColor})}}const Dt=e=>{e.inbox_preview?le.inbox.incomingMessagesForPreview=e.inbox_notifs:le.inbox.incomingMessages=e},zt=e=>{qt(),le.inbox=new jt({logger:e}),document.body.appendChild(le.inbox)},Bt=e=>{const t=ae.readFromLSorCookie(V)||{};if(Object.keys(t).length>0&&Object.keys(t)[0].includes("_")){const i={};return i[e]=t,ae.saveToLSorCookie(V,i),i}return t},Nt=()=>{const e=JSON.parse(decodeURIComponent(ae.read(b)));if(!X(e))return{};const t=Bt(e);return t.hasOwnProperty(e)?t[e]:{}},Ft=e=>{const t=JSON.parse(decodeURIComponent(ae.read(b)));if(!X(t))return;const i={...Bt(t),[t]:e};ae.saveToLSorCookie(V,i)},Ut=e=>new Promise(((t,i)=>{if("complete"===document.readyState)zt(e),t();else{const i=ae.readFromLSorCookie(q)||{},o=()=>{null===le.inbox&&zt(e),t()};window.addEventListener("load",(()=>{if(document.getElementById(i.inboxSelector))o();else{let n=0;if(n<20){const s=setInterval((()=>{document.getElementById(i.inboxSelector)?(o(),clearInterval(s),t()):n>=20&&(clearInterval(s),e.debug("Failed to add inbox")),n++}),500)}}}))}})),qt=()=>{void 0===customElements.get("ct-web-inbox")&&(customElements.define("ct-web-inbox",jt),customElements.define("ct-inbox-message",Rt))},Vt=(e,t,i)=>{const o=document.scrollingElement.scrollLeft,n=document.scrollingElement.scrollTop,s=window.innerWidth+o,r=window.innerHeight+n,a=e.rect||e.target.getBoundingClientRect(),l=a.x+o,c=a.y+n,d=a.left+o,h=a.right+o,u=a.top+n,p=a.bottom,g=a.height,f=a.width;let v,b,m=!1;const y=16;if(p+t<=r){const e=r-(p+t);b=e>=y?p+y:p+e}else if(u-t>=n){const e=u-t;b=e>=y?u-t-y:u-t-e}else m=!0,b=c+g/2-t/2,br&&(b=r-t);if(m){const e=h+i;if(e<=s){v=h+(e+y<=s?y:s-e)}else{const e=d-i;v=e-(e-y>=o?y:e-o)}}else v=l+f/2-i/2,vs&&(v=h-i>=o?h-i:s-i);return{xPos:v,yPos:b}},Wt=e=>{const t=Date.now();let i=Math.floor((t-e)/6e4);return i<5?"Just now":i<60?"".concat(i," minute").concat(i>1?"s":""," ago"):(i=Math.floor(i/60),i<24?"".concat(i," hour").concat(i>1?"s":""," ago"):(i=Math.floor(i/24),"".concat(i," day").concat(i>1?"s":""," ago")))},Kt=()=>Object.keys(ae.readFromLSorCookie(q)||{}).length>0,Gt='\n\n\n',Ht='\n\n\n',Jt=(e,t)=>{document.addEventListener("DOMContentLoaded",(()=>function(e,t){document.body.innerHTML="",Zt=document.createElement("div"),Zt.id="overlayDiv",Zt.style.position="relative",Zt.style.display="flex",document.body.appendChild(Zt);(function(e,t,i){return new Promise(((o,n)=>{var s=document.createElement("script");s.type="module",s.src=e,s.onload=function(){"function"==typeof window.Overlay?(window.Overlay("#overlayDiv",t,i),o()):n(new Error("ContentLayout not found in overlay.js"))},s.onerror=function(e){n(e)},document.head.appendChild(s)}))})("https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js",e,t).then((()=>{console.log("Overlay script loaded successfully.")})).catch((e=>{console.error("Error loading overlay script:",e)})),d=document.createElement("link"),d.rel="stylesheet",d.type="text/css",d.href="https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css",document.head.appendChild(d),o={kitId:"eqj6nom",scriptTimeout:3e3,async:!0},n=document,s=n.documentElement,r=setTimeout((function(){s.className=s.className.replace(/\bwf-loading\b/g,"")+" wf-inactive"}),o.scriptTimeout),a=n.createElement("script"),l=!1,c=n.getElementsByTagName("script")[0],s.className+=" wf-loading",a.src="https://use.typekit.net/"+o.kitId+".js",a.async=!0,a.onload=a.onreadystatechange=function(){if(i=this.readyState,!(l||i&&"complete"!==i&&"loaded"!==i)){l=!0,clearTimeout(r);try{Typekit.load(o)}catch(e){}}},c.parentNode.insertBefore(a,c);var i,o,n,s,r,a,l,c;var d}(e,t)))};let Zt;const $t=(e,t)=>{const i=e.display.details[0],o=Object.keys(i)[0],n=i[o];if(o===window.location.href)for(const i in n){const o=document.querySelector(i);if(o)n[i].html&&(o.outerHTML=n[i].html),t||window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot});else{let o=0;const s=setInterval((()=>{const r=document.querySelector(i);r?(n[i].html&&(r.outerHTML=n[i].html),t||window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot}),clearInterval(s)):(o++,o>=20&&(console.log("No element present on DOM with selector '".concat(i,"'.")),clearInterval(s)))}),500)}}},Yt=(e,t)=>{let{device:i,session:o,request:n,logger:s}=t;const r=i,a=o,l=n,c=s;let d=0;const h=t=>{const i=t.wzrk_id.split("_")[0],o=ie(),n=(e,t,i)=>{let o=0,n=0;null!=e[t]&&(o=e[t]),o++,null!=e.tc&&(n=e.tc),i<0&&n++,e.tc=n,e[t]=o};if(ae._isLocalStorageSupported()){delete sessionStorage.WZRK_CAMP;var s={};const e=Xe();s=3===t.display.wtarget_type&&e.hasOwnProperty("wi")?e.wi:0!==t.display.wtarget_type&&1!==t.display.wtarget_type||!e.hasOwnProperty("wp")?{}:e.wp,e.hasOwnProperty("global")&&(s.wp=e),null==t.display.wmc&&(t.display.wmc=1),null==t.display.wimc&&(t.display.wimc=1);var d=-1;let n=-1,r=-1,l=-1,c=-1,g=-1,f=-1;null!=t.display.efc&&(d=parseInt(t.display.efc,10)),null!=t.display.mdc&&(n=parseInt(t.display.mdc,10)),null!=t.display.tdc&&(r=parseInt(t.display.tdc,10)),null!=t.display.tlc&&(l=parseInt(t.display.tlc,10)),null!=t.display.wmp&&(c=parseInt(t.display.wmp,10)),null!=t.display.wmc&&(g=parseInt(t.display.wmc,10)),null!=t.display.wimc&&(f=parseInt(t.display.wimc,10));var h=s[a.sessionId];if(h){const e=h[i],o=h.tc;if("dnd"===e&&!le.dismissSpamControl)return!1;if(3===t.display.wtarget_type){if(f>0&&o>=f&&d<0)return!1}else if(g>0&&o>=g&&d<0)return!1;if(n>0&&e>=n)return!1}else h={},s[a.sessionId]=h;var u=s[o];if(null!=u){const e=u[i],t=u.tc;if(c>0&&t>=c&&d<0)return!1;if(r>0&&e>=r)return!1}else u={},s[o]=u;var p=s.global;if(null!=p){const e=p[i];if(l>0&&e>=l)return!1}else p={},s.global=p}if(null!=t.display.delay&&t.display.delay>0){const i=t.display.delay;return t.display.delay=0,setTimeout(Yt,1e3*i,e,{device:r,session:a,request:l,logger:c}),!1}n(h,i,d),n(u,i,d),n(p,i,d);let g="wp";3===t.display.wtarget_type&&(g="wi");const f={};f[a.sessionId]=h,f[o]=u,f.global=p,et({[g]:f})},u=()=>{const e=r.getGuid(),t=a.getSessionCookieObject();return"&t=wc&d="+encodeURIComponent(He(e+"|"+t.p+"|"+t.s))},p=(e,t)=>{const i=window.parent[e];"function"==typeof i&&(null!=t.display.kv?i(t.display.kv):i())},g=(e,t,i,o,n)=>{f(t),((e,t,i,o,n)=>{if(""!==e&&null!=e){let o,s;n?o=i:null!==i&&(s=i.getElementsByClassName("jsCT_CTA"),null!=s&&1===s.length&&(o=s[0]));const r=t.display.jsFunc,l=t.display.preview;null==l&&(e+=u()),null!=o&&(o.onclick=()=>{if(null!=r)return null==l&&Qe.fireRequest(e),p(r,t),void at("-1",0,a.sessionId);1===t.display.window?window.open(e,"_blank"):window.location=e})}})(e,t,i,0,n)},f=e=>{const t={type:"event"};t.evtName=R,t.evtData={[T]:e.wzrk_id},e.wzrk_pivot&&(t.evtData={...t.evtData,wzrk_pivot:e.wzrk_pivot}),l.processEvent(t)},v=e=>{var t;void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Lt);const i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,o=document.createElement("ct-web-personalisation-banner");o.msgId=e.wzrk_id,o.pivotId=e.wzrk_pivot,o.divHeight=e.display.divHeight,o.details=e.display.details[0];const n=e.display.divId?document.getElementById(i):document.querySelector(i);n.innerHTML="",n.appendChild(o)},m=e=>{var t;void 0===customElements.get("ct-web-personalisation-carousel")&&customElements.define("ct-web-personalisation-carousel",Mt);const i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,o=document.createElement("ct-web-personalisation-carousel");o.target=e;const n=e.display.divId?document.getElementById(i):document.querySelector(i);n.innerHTML="",n.appendChild(o)},y=e=>{const t=e.wzrk_id.split("_")[0],i=e.display;if(2===i.wtarget_type&&1===e.msgContent.type){const t={};t.msgId=e.wzrk_id,e.wzrk_pivot&&(t.pivotId=e.wzrk_pivot),null!=e.msgContent.kv&&(t.kv=e.msgContent.kv);const i=new CustomEvent("CT_web_native_display",{detail:t});return void document.dispatchEvent(i)}if(1===i.layout)return O(void 0,e);if(3===i.layout){const t="wzrkImageOnlyDiv";if(!1===h(e))return;if(le.dismissSpamControl&&null!=document.getElementById(t)){document.getElementById(t).remove()}if(null!=document.getElementById(t)||null!=document.getElementById("intentPreview"))return;const i=document.createElement("div");return i.id=t,document.body.appendChild(i),void 0===customElements.get("ct-web-popup-imageonly")&&customElements.define("ct-web-popup-imageonly",Tt),(e=>{const t=document.createElement("ct-web-popup-imageonly");t.session=a,t.target=e;const i=document.getElementById("wzrkImageOnlyDiv");i.innerHTML="",i.style.visibility="hidden",i.appendChild(t)})(e)}if(!1===h(e))return;const o="wizParDiv"+i.layout;if(le.dismissSpamControl&&null!=document.getElementById(o)){document.getElementById(o).remove()}if(null!=document.getElementById(o))return;le.campaignDivMap[t]=o;const n=2===i.layout,s=document.createElement("div");s.id=o;const r=window.innerHeight,l=window.innerWidth;let c=!1;if(n)s.setAttribute("style",i.iFrameStyle);else{var d=10;let e=5*l/100,t=d+5*r/100,o=30*l/100+20,n="width:30%;";(/mobile/i.test(navigator.userAgent)||/mini/i.test(navigator.userAgent))&&!1===/iPad/i.test(navigator.userAgent)?(o=85*l/100+20,e=5*l/100,t=5*r/100,n="width:80%;"):("ontouchstart"in window||/tablet/i.test(navigator.userAgent))&&(o=50*l/100+20,e=5*l/100,t=5*r/100,n="width:50%;"),null==i.proto?(c=!0,s.setAttribute("style","display:block;overflow:hidden; bottom:"+t+"px !important;width:"+o+"px !important;right:"+e+"px !important;position:fixed;z-index:2147483647;")):s.setAttribute("style",n+i.iFrameStyle)}document.body.appendChild(s);const u=document.createElement("iframe"),p=!1===i.br?"0":"8";u.frameborder="0px",u.marginheight="0px",u.marginwidth="0px",u.scrolling="no",u.id="wiz-iframe";const f=e.display.onClick;let v,b="";if(""!==f&&null!=f&&(b="cursor:pointer;"),1===e.msgContent.type)v=e.msgContent.html,v=v.replace(/##campaignId##/g,t),v=v.replace(/##campaignId_batchId##/g,e.wzrk_id);else{const i='";let n,s,r,a,l;"dark"===e.display.theme?(n="#2d2d2e",s="#eaeaea",r="#353535",a="#353535",l="#ffffff"):(n="#ffffff",s="#000000",a="#f4f4f4",r="#a5a6a6",l="#ffffff");const c=e.msgContent.title,d=e.msgContent.description;let h="";null!=e.msgContent.imageUrl&&""!==e.msgContent.imageUrl&&(h="");v=i+("
×
"+h+"
"+c+"
")+("
"+d+"
")}u.setAttribute("style","z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;"),s.appendChild(u);const m=(u.contentWindow?u.contentWindow:u.contentDocument.document?u.contentDocument.document:u.contentDocument).document,y=new Event("CT_campaign_rendered");document.dispatchEvent(y),m.open(),m.write(v),i["custom-editor"]&&k(e,m),m.close();const w=()=>{d=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv").scrollHeight,!0===i["custom-editor"]||n||(d+=25),document.getElementById("wiz-iframe").contentDocument.body.style.margin="0px",document.getElementById("wiz-iframe").style.height=d+"px"},C=navigator.userAgent.toLowerCase();if(-1!==C.indexOf("safari"))if(C.indexOf("chrome")>-1)u.onload=()=>{w();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)};else{let t=u.contentDocument||u.contentWindow;t.document&&(t=t.document),w();const i=setInterval((()=>{if("complete"===t.readyState){clearInterval(i),w();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)}}),10)}else u.onload=()=>{w();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)}},k=(e,t)=>{const i=t.createElement("script");i.innerHTML="\n const ct__camapignId = '".concat(e.wzrk_id,"';\n const ct__formatVal = (v) => {\n return v && v.trim().substring(0, 20);\n }\n const ct__parentOrigin = window.parent.origin;\n document.body.addEventListener('click', (event) => {\n const elem = event.target.closest?.('a[wzrk_c2a], button[wzrk_c2a]');\n if (elem) {\n const {innerText, id, name, value, href} = elem;\n const clickAttr = elem.getAttribute('onclick') || elem.getAttribute('click');\n const onclickURL = clickAttr?.match(/(window.open)[(](\"|')(.*)(\"|',)/)?.[3] || clickAttr?.match(/(location.href *= *)(\"|')(.*)(\"|')/)?.[3];\n const props = {innerText, id, name, value};\n let msgCTkv = Object.keys(props).reduce((acc, c) => {\n const formattedVal = ct__formatVal(props[c]);\n formattedVal && (acc['wzrk_click_' + c] = formattedVal);\n return acc;\n }, {});\n if(onclickURL) { msgCTkv['wzrk_click_' + 'url'] = onclickURL; }\n if(href) { msgCTkv['wzrk_click_' + 'c2a'] = href; }\n const notifData = { msgId: ct__camapignId, msgCTkv, pivotId: '").concat(e.wzrk_pivot,"' };\n window.parent.clevertap.renderNotificationClicked(notifData);\n }\n });\n "),t.body.appendChild(i)};let x=!1;const S=e=>{let t=e.display.onClick;if(window.clevertap.hasOwnProperty("notificationCallback")&&void 0!==window.clevertap.notificationCallback&&"function"==typeof window.clevertap.notificationCallback){const i=window.clevertap.notificationCallback;if(!x){const o={};o.msgContent=e.msgContent,o.msgId=e.wzrk_id,e.wzrk_pivot&&(o.pivotId=e.wzrk_pivot),null!=e.display.kv&&(o.kv=e.display.kv),window.clevertap.raiseNotificationClicked=()=>{if(""!==t&&null!=t){const i=e.display.jsFunc;if(t+=u(),null!=i)return Qe.fireRequest(t),void p(i,e);1===e.display.window?window.open(t,"_blank"):window.location=t}},window.clevertap.raiseNotificationViewed=()=>{f(e)},i(o),x=!0}}else if(window.clevertap.popupCurrentWzrkId=e.wzrk_id,y(e),window.clevertap.hasOwnProperty("popupCallbacks")&&void 0!==window.clevertap.popupCallbacks&&"function"==typeof window.clevertap.popupCallbacks[e.wzrk_id]){const t=window.clevertap.popupCallbacks[e.wzrk_id],n={};n.msgContent=e.msgContent,n.msgId=e.wzrk_id,e.wzrk_pivot&&(n.pivotId=e.wzrk_pivot);var i=[];for(var o in e)if(o.startsWith(M)&&o!==T){const t={[o]:e[o]};i.push(t)}i.length>0&&(n.msgCTkv=i),null!=e.display.kv&&(n.kv=e.display.kv),window.clevertap.raisePopupNotificationClicked=t=>{if(!t||!t.msgId)return;const i={type:"event"};if(i.evtName=j,i.evtData={[T]:t.msgId},e.wzrk_pivot&&(i.evtData={...i.evtData,wzrk_pivot:t.pivotId}),t.msgCTkv)for(var o of t.msgCTkv)i.evtData={...i.evtData,...o};l.processEvent(i)},t(n)}};let I;const O=(e,t)=>{let i;if(null!=e&&e.clientY>0)return;if(i=null==t?I:t,le.dismissSpamControl&&0===i.display.wtarget_type&&null!=document.getElementById("intentPreview")&&null!=document.getElementById("intentOpacityDiv")){document.getElementById("intentPreview").remove(),document.getElementById("intentOpacityDiv").remove()}if(null!=document.getElementById("intentPreview")||null!=document.getElementById("wzrkImageOnlyDiv"))return;if(null==i.display.layout&&(/mobile/i.test(navigator.userAgent)||/mini/i.test(navigator.userAgent)||/iPad/i.test(navigator.userAgent)||"ontouchstart"in window||/tablet/i.test(navigator.userAgent)))return;if(!1===h(i))return;const o=i.wzrk_id.split("_")[0];le.campaignDivMap[o]="intentPreview";let n=!1;const s=document.createElement("div");s.id="intentOpacityDiv";const r=i.display.opacity||.7,a="rgba(0,0,0,".concat(r,")");s.setAttribute("style","position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ".concat(a,";")),document.body.appendChild(s);const l=document.createElement("div");l.id="intentPreview",null==i.display.proto?(n=!0,l.setAttribute("style","display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;")):l.setAttribute("style",i.display.iFrameStyle),document.body.appendChild(l);const c=document.createElement("iframe"),d=!1===i.display.br?"0":"8";c.frameborder="0px",c.marginheight="0px",c.marginwidth="0px",c.scrolling="no",c.id="wiz-iframe-intent";const u=i.display.onClick;let p,f="";if(""!==u&&null!=u&&(f="cursor:pointer;"),1===i.msgContent.type)p=i.msgContent.html,p=p.replace(/##campaignId##/g,o),p=p.replace(/##campaignId_batchId##/g,i.wzrk_id);else{const e='";let t,n,s,r;"dark"===i.display.theme?(t="#2d2d2e",n="#eaeaea",s="#353535",r="#ffffff"):(t="#ffffff",n="#000000",s="#a5a6a6",r="#ffffff");const a=i.msgContent.title,l=i.msgContent.description;let c="";null!=i.msgContent.ctaText&&""!==i.msgContent.ctaText&&(c="");let h="";null!=i.msgContent.imageUrl&&""!==i.msgContent.imageUrl&&(h="
+a+
");p=e+("
×
"+a+"
")+("
"+l+"
"+h+c+"
")}c.setAttribute("style","z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;"),l.appendChild(c);const v=(c.contentWindow?c.contentWindow:c.contentDocument.document?c.contentDocument.document:c.contentDocument).document,b=new Event("CT_campaign_rendered");document.dispatchEvent(b),v.open(),v.write(p),i.display["custom-editor"]&&k(i,v),v.close();const m=document.getElementById("wiz-iframe-intent").contentDocument.getElementById("contentDiv");g(u,i,m,0,n)};if(!document.body)return void(d<6&&(d++,setTimeout(Yt,1e3,e,{device:r,session:a,request:l,logger:c})));const _=e=>{Object.keys(e).map((t=>{var i,o;e[t].display.divId?(i=e[t].display.divId,o=document.getElementById(i)):(i=e[t].display.divSelector,o=document.querySelector(i)),null!==o&&(2===e[t].msgContent.type?v(e[t]):m(e[t]),delete e[t])}))};if(null!=e.inapp_notifs){const t={};for(let i=0;i{window.addEventListener("load",(()=>{let t=0;if(t<20){const i=setInterval((()=>{_(e),0!==Object.keys(e).length&&20!==t||(clearInterval(i),e={}),t++}),500)}}))})(t))}const E=()=>{if(e.inbox_preview)Dt(e);else if(e.inbox_notifs){const t=[];for(let i=0;i1&&void 0!==arguments[1]&&arguments[1];const i=ae.readFromLSorCookie(q)||{};t?(le.inbox.inboxConfigForPreview=e,le.inbox.isPreview=!0,le.inbox&&le.inbox.init()):JSON.stringify(i)!==JSON.stringify(e)&&(ae.saveToLSorCookie(q,e),le.inbox&&le.inbox.init())}(e.webInboxSetting),Ut(c).then((()=>{E()})).catch((e=>{}))):E()),e.vars)return void le.variableStore.mergeVariables(e.vars);const A=(e,t)=>{const i=Xe(),o=i[t].global;if(null!=o&&t)for(const i in e)if(e.hasOwnProperty(i)&&(delete o[e[i]],ae.read(w))){const o=JSON.parse(decodeURIComponent(ae.read(w))),n=JSON.parse(decodeURIComponent(ae.read(b)));o[n]&&o[n][t]&&o[n][t][e[i]]&&(delete o[n][t][e[i]],ae.save(w,encodeURIComponent(JSON.stringify(o))))}et(i)};if(ae._isLocalStorageSupported())try{if(null!=e.evpr){const t=e.evpr.events,i=e.evpr.profile,o=e.evpr.expires_in,n=oe();ae.setMetaProp("lsTime",n),ae.setMetaProp("exTs",o),(e=>{if(null!=le.globalEventsMap||(le.globalEventsMap=ae.readFromLSorCookie(C),null!=le.globalEventsMap)){for(const t in e)if(e.hasOwnProperty(t)){const i=le.globalEventsMap[t],o=e[t];null!=le.globalEventsMap[t]?null!=o[0]&&o[0]>i[0]&&(le.globalEventsMap[t]=o):le.globalEventsMap[t]=o}}else le.globalEventsMap=e})(t),ae.saveToLSorCookie(C,le.globalEventsMap),null==le.globalProfileMap?rt(i,!0):rt(i,!1)}null!=e.arp&&(e=>{if(null!=e.skipResARP&&e.skipResARP)return console.debug("Update ARP Request rejected",e),null;const t=!0===e.isOUL;if(ae._isLocalStorageSupported())try{let i=ae.readFromLSorCookie(P);if(null==i||t){i={};for(const t in e)e.hasOwnProperty(t)&&(-1===e[t]?delete i[t]:i[t]=e[t]);ae.saveToLSorCookie(P,i)}}catch(e){console.error("Unable to parse ARP JSON: "+e)}})(e.arp),null!=e.inapp_stale&&e.inapp_stale.length>0&&A(e.inapp_stale,"wp"),null!=e.inbox_stale&&e.inbox_stale.length>0&&A(e.inbox_stale,"wi")}catch(e){c.error("Unable to persist evrp/arp: "+e)}};var Qt=t("isPersonalisationActive");class Xt{constructor(e){let{isPersonalisationActive:t}=e;Object.defineProperty(this,Qt,{writable:!0,value:void 0}),i(this,Qt)[Qt]=t}getTotalVisits(){if(!i(this,Qt)[Qt]())return;let e=ae.getMetaProp("sc");return null==e&&(e=1),e}getLastVisit(){if(!i(this,Qt)[Qt]())return;const e=ae.getMetaProp("ps");return null!=e?new Date(1e3*e):void 0}}const ei=1,ti=2,ii=3,oi=4;var ni=t("logLevel"),si=t("log"),ri=t("isLegacyDebug");class ai{constructor(e){Object.defineProperty(this,ri,{get:ci,set:void 0}),Object.defineProperty(this,si,{value:li}),Object.defineProperty(this,ni,{writable:!0,value:void 0}),this.wzrkError={},i(this,ni)[ni]=null==e?e:ti,this.wzrkError={}}get logLevel(){return i(this,ni)[ni]}set logLevel(e){i(this,ni)[ni]=e}error(e){i(this,ni)[ni]>=ei&&i(this,si)[si]("error",e)}info(e){i(this,ni)[ni]>=ti&&i(this,si)[si]("log",e)}debug(e){(i(this,ni)[ni]>=ii||i(this,ri)[ri])&&i(this,si)[si]("debug",e)}debugPE(e){i(this,ni)[ni]>=oi&&i(this,si)[si]("debug_pe",e)}reportError(e,t){this.wzrkError.c=e,this.wzrkError.d=t,this.error("".concat(Ce," ").concat(e,": ").concat(t))}}var li=function(e,t){if(window.console)try{const i=(new Date).getTime();console[e]("CleverTap [".concat(i,"]: ").concat(t))}catch(e){}},ci=function(){return"undefined"!=typeof sessionStorage&&""===sessionStorage.WZRK_D},di=t("logger"),hi=t("sessionId"),ui=t("isPersonalisationActive");class pi{constructor(e){let{logger:t,isPersonalisationActive:o}=e;Object.defineProperty(this,di,{writable:!0,value:void 0}),Object.defineProperty(this,hi,{writable:!0,value:void 0}),Object.defineProperty(this,ui,{writable:!0,value:void 0}),this.cookieName=void 0,this.scookieObj=void 0,this.sessionId=ae.getMetaProp("cs"),i(this,di)[di]=t,i(this,ui)[ui]=o}get sessionId(){return i(this,hi)[hi]}set sessionId(e){i(this,hi)[hi]=e}getSessionCookieObject(){let e=ae.readCookie(this.cookieName),t={};if(null!=e)if(e=e.replace(p,'"'),t=JSON.parse(e),J(t)){if(void 0!==t.t){const e=t.t;oe()-e>1260&&(t={})}}else t={};return this.scookieObj=t,t}setSessionCookieObject(e){const t=JSON.stringify(e);ae.createBroadCookie(this.cookieName,t,1200,We())}manageSession(e){if(void 0===this.sessionId||this.sessionId!==e){const t=ae.getMetaProp("cs");if(void 0===t)ae.setMetaProp("ps",e),ae.setMetaProp("cs",e),ae.setMetaProp("sc",1);else if(t!==e){ae.setMetaProp("ps",t),ae.setMetaProp("cs",e);let i=ae.getMetaProp("sc");void 0===i&&(i=0),ae.setMetaProp("sc",i+1)}this.sessionId=e}}getTimeElapsed(){if(!i(this,ui)[ui]())return;null!=this.scookieObj&&(this.scookieObj=this.getSessionCookieObject());const e=this.scookieObj.s;if(null!=e){const t=oe();return Math.floor(t-e)}}getPageCount(){if(i(this,ui)[ui]())return null!=this.scookieObj&&(this.scookieObj=this.getSessionCookieObject()),this.scookieObj.p}}let gi=0,fi=0;var vi=t("logger"),bi=t("account"),mi=t("device"),yi=t("session"),wi=t("isPersonalisationActive"),Ci=t("clearCookie"),ki=t("addToLocalEventMap");class xi{constructor(e){let{logger:t,account:o,device:n,session:s,isPersonalisationActive:r}=e;Object.defineProperty(this,ki,{value:Pi}),Object.defineProperty(this,vi,{writable:!0,value:void 0}),Object.defineProperty(this,bi,{writable:!0,value:void 0}),Object.defineProperty(this,mi,{writable:!0,value:void 0}),Object.defineProperty(this,yi,{writable:!0,value:void 0}),Object.defineProperty(this,wi,{writable:!0,value:void 0}),Object.defineProperty(this,Ci,{writable:!0,value:!1}),this.processingBackup=!1,i(this,vi)[vi]=t,i(this,bi)[bi]=o,i(this,mi)[mi]=n,i(this,yi)[yi]=s,i(this,wi)[wi]=r,Qe.logger=t,Qe.device=n,Qe.account=o}processBackupEvents(){const e=ae.readFromLSorCookie(S);if(null!=e){this.processingBackup=!0;for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];void 0===o.fired&&(i(this,vi)[vi].debug("Processing backup event : "+o.q),void 0!==o.q&&Qe.fireRequest(o.q),o.fired=!0)}ae.saveToLSorCookie(S,e),this.processingBackup=!1}}addSystemDataToObject(e,t){void 0===t&&(e=ee(e,i(this,vi)[vi])),$(i(this,vi)[vi].wzrkError)||(e.wzrk_error=i(this,vi)[vi].wzrkError,i(this,vi)[vi].wzrkError={}),e.id=i(this,bi)[bi].id,X(i(this,mi)[mi].gcookie)&&(e.g=i(this,mi)[mi].gcookie);const o=i(this,yi)[yi].getSessionCookieObject();e.s=o.s,e.pg=void 0===o.p?1:o.p;let n=document.location.protocol;return n=n.replace(":",""),e.af={lib:"web-sdk-v1.7.3",protocol:n,...le.flutterVersion},sessionStorage.hasOwnProperty("WZRK_D")&&(e.debug=!0),e}addFlags(e){if(i(this,Ci)[Ci]=ae.getAndClearMetaProp(g),void 0!==i(this,Ci)[Ci]&&i(this,Ci)[Ci]&&(e.rc=!0,i(this,vi)[vi].debug("reset cookie sent in request and cleared from meta for future requests.")),i(this,wi)[wi]()){const t=ae.getMetaProp("lsTime"),i=ae.getMetaProp("exTs");if(void 0===t||void 0===i)return void(e.dsync=!0);t+i{if(e.ok)return e.json();throw e})).then((e=>(i(this,vi)[vi].debug("Sync data successful",e),e))).catch((e=>{throw i(this,vi)[vi].debug("Error in syncing variables",e),e}))}}var Pi=function(e){if(ae._isLocalStorageSupported()){void 0===le.globalEventsMap&&(le.globalEventsMap=ae.readFromLSorCookie(C),void 0===le.globalEventsMap&&(le.globalEventsMap={}));const t=oe();let i=le.globalEventsMap[e];void 0!==i?(i[2]=t,i[0]++):(i=[],i.push(1),i.push(t),i.push(t)),le.globalEventsMap[e]=i,ae.saveToLSorCookie(C,le.globalEventsMap)}},Si=t("request"),Ii=t("account"),Oi=t("oldValues"),_i=t("logger"),Ei=t("processPrivacyArray");class Ai extends Array{constructor(e,t){let{request:o,account:n,logger:s}=e;super(),Object.defineProperty(this,Ei,{value:Li}),Object.defineProperty(this,Si,{writable:!0,value:void 0}),Object.defineProperty(this,Ii,{writable:!0,value:void 0}),Object.defineProperty(this,Oi,{writable:!0,value:void 0}),Object.defineProperty(this,_i,{writable:!0,value:void 0}),i(this,_i)[_i]=s,i(this,Si)[Si]=o,i(this,Ii)[Ii]=n,i(this,Oi)[Oi]=t}push(){for(var e=arguments.length,t=new Array(e),o=0;o0?le.privacyArray:t):le.privacyArray.push(...t),0}_processOldValues(){i(this,Oi)[Oi]&&i(this,Ei)[Ei](i(this,Oi)[Oi]),i(this,Oi)[Oi]=null}}var Li=function(e){if(Array.isArray(e)&&e.length>0){const o=e.reduce(((e,t)=>({...e,...t})),{});let n={};const s={};var t=!1;if(o.hasOwnProperty(O)&&"boolean"==typeof(t=o.optOut)&&(s.ct_optout=t,le.isOptInRequest=!t),o.hasOwnProperty(_)){const e=o.useIP,t="boolean"==typeof e&&e;ae.setMetaProp(_,t)}if(!$(s)){n.type="profile",n.profile=s,n=i(this,Si)[Si].addSystemDataToObject(n,void 0);const o=Ke(JSON.stringify(n),i(this,_i)[_i]);let r=i(this,Ii)[Ii].dataPostURL;r=Ve(r,"type",A),r=Ve(r,"d",o),r=Ve(r,O,t?"true":"false"),i(this,Si)[Si].saveAndFireRequest(r,le.blockRequest),e.splice(0,e.length)}}},Mi=t("oldValues"),Ti=t("logger"),Ri=t("request"),ji=t("account"),Di=t("wizAlertJSPath"),zi=t("fcmPublicKey"),Bi=t("setUpWebPush"),Ni=t("setUpWebPushNotifications"),Fi=t("setApplicationServerKey"),Ui=t("setUpSafariNotifications"),qi=t("setUpChromeFirefoxNotifications"),Vi=t("addWizAlertJS"),Wi=t("removeWizAlertJS"),Ki=t("handleNotificationRegistration");class Gi extends Array{constructor(e,t){let{logger:o,session:n,request:s,account:r}=e;super(),Object.defineProperty(this,Ki,{value:eo}),Object.defineProperty(this,Wi,{value:Xi}),Object.defineProperty(this,Vi,{value:Qi}),Object.defineProperty(this,qi,{value:Yi}),Object.defineProperty(this,Ui,{value:$i}),Object.defineProperty(this,Fi,{value:Zi}),Object.defineProperty(this,Ni,{value:Ji}),Object.defineProperty(this,Bi,{value:Hi}),Object.defineProperty(this,Mi,{writable:!0,value:void 0}),Object.defineProperty(this,Ti,{writable:!0,value:void 0}),Object.defineProperty(this,Ri,{writable:!0,value:void 0}),Object.defineProperty(this,ji,{writable:!0,value:void 0}),Object.defineProperty(this,Di,{writable:!0,value:void 0}),Object.defineProperty(this,zi,{writable:!0,value:void 0}),i(this,Di)[Di]="https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js",i(this,zi)[zi]=null,i(this,Mi)[Mi]=t,i(this,Ti)[Ti]=o,i(this,Ri)[Ri]=s,i(this,ji)[ji]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o0?i(this,Ki)[Ki](e):null==le.webPushEnabled&&e.length>0?(le.notifApi.notifEnabledFromApi=!0,le.notifApi.displayArgs=e.slice()):!1===le.webPushEnabled&&e.length>0&&i(this,Ti)[Ti].error("Make sure push notifications are fully enabled and integrated")},Ji=function(e,t,o,n){-1!==navigator.userAgent.indexOf("Chrome")||-1!==navigator.userAgent.indexOf("Firefox")?i(this,qi)[qi](e,t):-1!==navigator.userAgent.indexOf("Safari")&&i(this,Ui)[Ui](e,o,n)},Zi=function(e){i(this,zi)[zi]=e},$i=function(e,t,o){void 0===t&&i(this,Ti)[Ti].error("Ensure that APNS Web Push ID is supplied"),void 0===o&&i(this,Ti)[Ti].error("Ensure that APNS Web Push service path is supplied"),"safari"in window&&"pushNotification"in window.safari&&window.safari.pushNotification.requestPermission(o,t,{},(e=>{if("granted"===e.permission){const t=JSON.parse(JSON.stringify(e));t.endpoint=e.deviceToken,t.browser="Safari",ae.saveToLSorCookie(z,t),i(this,Ri)[Ri].registerToken(t),i(this,Ti)[Ti].info("Safari Web Push registered. Device Token: "+e.deviceToken)}else"denied"===e.permission&&i(this,Ti)[Ti].info("Error subscribing to Safari web push")}))},Yi=function(e,t){let o="";"serviceWorker"in navigator&&navigator.serviceWorker.register(t).then((e=>{if("undefined"!=typeof __wzrk_account_id)return new Promise((t=>setTimeout((()=>t(e)),5e3)));o=e.scope;return/^(\.?)(\/?)([^/]*).js$/.test(t)?navigator.serviceWorker.ready:-1!==navigator.userAgent.indexOf("Chrome")?new Promise((t=>setTimeout((()=>t(e)),5e3))):navigator.serviceWorker.getRegistrations()})).then((t=>{-1!==navigator.userAgent.indexOf("Firefox")&&Array.isArray(t)&&(t=t.filter((e=>e.scope===o))[0]);const n={userVisibleOnly:!0};null!=i(this,zi)[zi]&&(n.applicationServerKey=(e=>{let t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),i=window.atob(t),o=[];for(let e=0;e{i(this,Ti)[Ti].info("Service Worker registered. Endpoint: "+t.endpoint);const o=JSON.parse(JSON.stringify(t));-1!==navigator.userAgent.indexOf("Chrome")?(o.endpoint=o.endpoint.split("/").pop(),o.browser="Chrome"):-1!==navigator.userAgent.indexOf("Firefox")&&(o.endpoint=o.endpoint.split("/").pop(),o.browser="Firefox"),ae.saveToLSorCookie(z,o),i(this,Ri)[Ri].registerToken(o),void 0!==e&&"function"==typeof e&&e()})).catch((e=>{i(this,Ti)[Ti].error("Error subscribing: "+e),t.pushManager.getSubscription().then((e=>{null!==e&&e.unsubscribe().then((e=>{i(this,Ti)[Ti].info("Unsubscription successful")})).catch((e=>{i(this,Ti)[Ti].error("Error unsubscribing: "+e)}))}))}))})).catch((e=>{i(this,Ti)[Ti].error("error registering service worker: "+e)}))},Qi=function(){const e=document.createElement("script");return e.setAttribute("type","text/javascript"),e.setAttribute("id","wzrk-alert-js"),e.setAttribute("src",i(this,Di)[Di]),document.getElementsByTagName("body")[0].appendChild(e),e},Xi=function(){const e=document.getElementById("wzrk-alert-js");e.parentNode.removeChild(e)},eo=function(e){let t,o,n,s,r,a,l,c,d,h,u,p,g,f,v;if(1===e.length){if(J(e[0])){const i=e[0];t=i.titleText,o=i.bodyText,n=i.okButtonText,s=i.rejectButtonText,r=i.okButtonColor,a=i.skipDialog,l=i.askAgainTimeInSeconds,c=i.okCallback,d=i.rejectCallback,h=i.subscriptionCallback,u=i.serviceWorkerPath,p=i.httpsPopupPath,g=i.httpsIframePath,f=i.apnsWebPushId,v=i.apnsWebPushServiceUrl}}else t=e[0],o=e[1],n=e[2],s=e[3],r=e[4],a=e[5],l=e[6];if(null==a&&(a=!1),null==u&&(u="/clevertap_sw.js"),void 0===navigator.serviceWorker)return;const b=null!=p&&null!=g;if("https:"!==window.location.protocol&&"localhost"!==document.location.hostname&&!b)return void i(this,Ti)[Ti].error("Make sure you are https or localhost to register for notifications");if(-1!==navigator.userAgent.indexOf("Chrome")){const e=navigator.userAgent.match(/Chrome\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}else if(-1!==navigator.userAgent.indexOf("Firefox")){const e=navigator.userAgent.match(/Firefox\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}else{if(-1===navigator.userAgent.indexOf("Safari"))return;{const e=navigator.userAgent.match(/Safari\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}}if(!b){if(null==Notification)return;if("granted"===Notification.permission)return void i(this,Ni)[Ni](h,u,f,v);if("denied"===Notification.permission)return;if(a)return void i(this,Ni)[Ni](h,u,f,v)}if(!(t&&o&&n&&s))return void i(this,Ti)[Ti].error("Missing input parameters; please specify title, body, ok button and cancel button text");null!=r&&r.match(/^#[a-f\d]{6}$/i)||(r="#f28046");const m=(new Date).getTime()/1e3;if(null==ae.getMetaProp("notif_last_time"))ae.setMetaProp("notif_last_time",m);else{if(null==l&&(l=604800),m-ae.getMetaProp("notif_last_time"){if(null!=e.data){let a={};try{a=JSON.parse(e.data)}catch(e){return}null!=a.state&&"ct"===a.from&&"not"===a.state&&(i(this,Vi)[Vi]().onload=()=>{window.wzrkPermissionPopup.wizAlert({title:t,body:o,confirmButtonText:n,confirmButtonColor:r,rejectButtonText:s},(e=>{e?("function"==typeof c&&c(),window.open(p)):"function"==typeof d&&d(),i(this,Wi)[Wi]()}))})}}),!1)}else i(this,Vi)[Vi]().onload=()=>{window.wzrkPermissionPopup.wizAlert({title:t,body:o,confirmButtonText:n,confirmButtonColor:r,rejectButtonText:s},(e=>{e?("function"==typeof c&&c(),i(this,Ni)[Ni](h,u,f,v)):"function"==typeof d&&d(),i(this,Wi)[Wi]()}))}},to=t("variableStore");class io{constructor(e){let{variableStore:t}=e;Object.defineProperty(this,to,{writable:!0,value:void 0}),this.name=null,this.defaultValue=null,this.value=null,this.type=null,this.hadStarted=!1,this.valueChangedCallbacks=[],i(this,to)[to]=t}getValue(){return this.value}getdefaultValue(){return this.defaultValue}static define(e,t,i){if(!e||"string"!=typeof e)return console.error("Empty or invalid name parameter provided."),null;if(e.startsWith(".")||e.endsWith("."))return console.error("Variable name starts or ends with a `.` which is not allowed: "+e),null;const o=typeof t;if("string"!==o&&"number"!==o&&"boolean"!==o)return console.error("Only primitive types (string, number, boolean) are accepted as value"),null;const n=i.getVariable(e);if(n)return n;const s=new io({variableStore:i});try{s.name=e,s.defaultValue=t,s.value=t,s.type=o,i.registerVariable(s),s.update(t)}catch(e){console.error(e)}return s}update(e){const t=this.value;this.value=e,null===e&&null===t||null!==e&&e===t&&this.hadStarted||i(this,to)[to].hasVarsRequestCompleted()&&(this.hadStarted=!0,this.triggerValueChanged())}triggerValueChanged(){this.valueChangedCallbacks.forEach((e=>{e(this)}))}addValueChangedCallback(e){e?(this.valueChangedCallbacks.push(e),i(this,to)[to].hasVarsRequestCompleted()&&e(this)):console.log("Invalid callback parameter provided.")}removeValueChangedCallback(e){const t=this.valueChangedCallbacks.indexOf(e);-1!==t&&this.valueChangedCallbacks.splice(t,1)}clearStartFlag(){this.hadStarted=!1}}var oo=t("logger"),no=t("account"),so=t("request"),ro=t("event"),ao=t("variables"),lo=t("remoteVariables"),co=t("fetchCallback"),ho=t("variablesChangedCallbacks"),uo=t("oneTimeVariablesChangedCallbacks"),po=t("hasVarsRequestCompleted"),go=t("runVariablesChangedCallback");class fo{constructor(e){let{logger:t,request:o,account:n,event:s}=e;Object.defineProperty(this,go,{value:vo}),Object.defineProperty(this,oo,{writable:!0,value:void 0}),Object.defineProperty(this,no,{writable:!0,value:void 0}),Object.defineProperty(this,so,{writable:!0,value:void 0}),Object.defineProperty(this,ro,{writable:!0,value:void 0}),Object.defineProperty(this,ao,{writable:!0,value:void 0}),Object.defineProperty(this,lo,{writable:!0,value:void 0}),Object.defineProperty(this,co,{writable:!0,value:void 0}),Object.defineProperty(this,ho,{writable:!0,value:void 0}),Object.defineProperty(this,uo,{writable:!0,value:void 0}),Object.defineProperty(this,po,{writable:!0,value:!1}),i(this,oo)[oo]=t,i(this,no)[no]=n,i(this,so)[so]=o,i(this,ro)[ro]=s,i(this,ao)[ao]={},i(this,lo)[lo]={},i(this,ho)[ho]=[],i(this,uo)[uo]=[],le.variableStore=this}registerVariable(e){const{name:t}=e;i(this,ao)[ao][t]=e,console.log("registerVariable",i(this,ao)[ao])}getVariable(e){return i(this,ao)[ao][e]}hasVarsRequestCompleted(){return i(this,po)[po]}syncVariables(e,t){if(!i(this,no)[no].token){const e="Account token is missing.";return i(this,oo)[oo].error(e),Promise.reject(new Error(e))}const o={type:"varsPayload",vars:{}};for(const e in i(this,ao)[ao])o.vars[e]={defaultValue:i(this,ao)[ao][e].defaultValue,type:i(this,ao)[ao][e].type};if(0===Object.keys(o.vars).length){const e="No variables are defined.";return i(this,oo)[oo].error(e),Promise.reject(new Error(e))}let n={};n=i(this,so)[so].addSystemDataToObject(n,void 0),n.tk=i(this,no)[no].token,n.type="meta";const s=JSON.stringify([n,o]),r=i(this,no)[no].dataPostPEURL;return i(this,so)[so].post(r,s).then((t=>(e&&"function"==typeof e&&e(t),t))).catch((e=>{throw t&&"function"==typeof t&&t(e),400===e.status?i(this,oo)[oo].error("Invalid sync payload or clear the existing draft"):401===e.status?i(this,oo)[oo].error("This is not a test profile"):i(this,oo)[oo].error("Sync variable failed"),e}))}fetchVariables(e){i(this,ro)[ro].push(K,{t:4}),e&&"function"==typeof e&&(i(this,co)[co]=e)}mergeVariables(e){console.log("msg vars is ",e),i(this,po)[po]=!0,ae.saveToLSorCookie("WZRK_PE",e),i(this,lo)[lo]=e;for(const t in i(this,ao)[ao])e.hasOwnProperty(t)&&i(this,ao)[ao][t].update(e[t]);i(this,co)[co]&&i(this,co)[co](),i(this,go)[go]()}addVariablesChangedCallback(e){e&&"function"==typeof e?(i(this,ho)[ho].push(e),this.hasVarsRequestCompleted()&&e()):i(this,oo)[oo].error("callback is not a function")}addOneTimeVariablesChangedCallback(e){e&&"function"==typeof e&&(this.hasVarsRequestCompleted()?e():i(this,uo)[uo].push(e))}removeVariablesChangedCallback(e){const t=i(this,ho)[ho].indexOf(e);-1!==t&&i(this,ho)[ho].splice(t,1)}removeOneTimeVariablesChangedCallback(e){const t=i(this,uo)[uo].indexOf(e);-1!==t&&i(this,uo)[uo].splice(t,1)}}var vo=function(){for(var e of i(this,ho)[ho])e();for(var t of i(this,uo)[uo])t();i(this,uo)[uo].length=0},bo=t("logger"),mo=t("api"),yo=t("onloadcalled"),wo=t("device"),Co=t("session"),ko=t("account"),xo=t("request"),Po=t("variableStore"),So=t("isSpa"),Io=t("previousUrl"),Oo=t("boundCheckPageChanged"),_o=t("dismissSpamControl"),Eo=t("processOldValues"),Ao=t("debounce"),Lo=t("checkPageChanged"),Mo=t("handleMessageEvent"),To=t("pingRequest"),Ro=t("isPingContinuous"),jo=t("overrideDSyncFlag");var Do=function(){this.onUserLogin._processOldValues(),this.privacy._processOldValues(),this.event._processOldValues(),this.profile._processOldValues(),this.notifications._processOldValues()},zo=function(e){let t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300;return function(){clearTimeout(t),t=setTimeout(e,i)}},Bo=function(){i(this,Ao)[Ao]((()=>{i(this,Io)[Io]!==location.href&&this.pageChanged()}))()},No=function(e){var t;e.data&&e.data.message&&("Dashboard"===e.data.message&&e.data.url?Jt(e.data.url,null!==(t=e.data.variant)&&void 0!==t?t:null):"Overlay"===e.data.message&&$t(e.data,!0))},Fo=function(){let e=i(this,ko)[ko].dataPostURL,t={};t=i(this,xo)[xo].addSystemDataToObject(t,void 0),e=Ve(e,"type","ping"),e=Ve(e,"d",Ke(JSON.stringify(t),i(this,bo)[bo])),i(this,xo)[xo].saveAndFireRequest(e,le.blockRequest)},Uo=function(){return void 0!==window.wzrk_d&&"continuous"===window.wzrk_d.ping},qo=function(e){this._isPersonalisationActive()&&(e.dsync=!0)};const Vo=new class{get spa(){return i(this,So)[So]}set spa(e){const t=!0===e;i(this,So)[So]!==t&&1===i(this,yo)[yo]&&(t?document.addEventListener("click",i(this,Oo)[Oo]):document.removeEventListener("click",i(this,Oo)[Oo])),i(this,So)[So]=t}get dismissSpamControl(){return i(this,_o)[_o]}set dismissSpamControl(e){const t=!0===e;i(this,_o)[_o]=t,le.dismissSpamControl=t}constructor(){var e,t,o,n,s;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.defineProperty(this,jo,{value:qo}),Object.defineProperty(this,Ro,{value:Uo}),Object.defineProperty(this,To,{value:Fo}),Object.defineProperty(this,Mo,{value:No}),Object.defineProperty(this,Lo,{value:Bo}),Object.defineProperty(this,Ao,{value:zo}),Object.defineProperty(this,Eo,{value:Do}),Object.defineProperty(this,bo,{writable:!0,value:void 0}),Object.defineProperty(this,mo,{writable:!0,value:void 0}),Object.defineProperty(this,yo,{writable:!0,value:void 0}),Object.defineProperty(this,wo,{writable:!0,value:void 0}),Object.defineProperty(this,Co,{writable:!0,value:void 0}),Object.defineProperty(this,ko,{writable:!0,value:void 0}),Object.defineProperty(this,xo,{writable:!0,value:void 0}),Object.defineProperty(this,Po,{writable:!0,value:void 0}),Object.defineProperty(this,So,{writable:!0,value:void 0}),Object.defineProperty(this,Io,{writable:!0,value:void 0}),Object.defineProperty(this,Oo,{writable:!0,value:i(this,Lo)[Lo].bind(this)}),Object.defineProperty(this,_o,{writable:!0,value:void 0}),this.enablePersonalization=void 0,this.popupCallbacks={},this.popupCurrentWzrkId="",i(this,yo)[yo]=0,this._isPersonalisationActive=this._isPersonalisationActive.bind(this),this.raiseNotificationClicked=()=>{},i(this,bo)[bo]=new ai(ti),i(this,ko)[ko]=new d(null===(e=r.account)||void 0===e?void 0:e[0],r.region||(null===(t=r.account)||void 0===t?void 0:t[1]),r.targetDomain||(null===(o=r.account)||void 0===o?void 0:o[2]),r.token||(null===(n=r.account)||void 0===n?void 0:n[3])),i(this,wo)[wo]=new ye({logger:i(this,bo)[bo]}),i(this,_o)[_o]=r.dismissSpamControl||!1,i(this,Co)[Co]=new pi({logger:i(this,bo)[bo],isPersonalisationActive:this._isPersonalisationActive}),i(this,xo)[xo]=new xi({logger:i(this,bo)[bo],account:i(this,ko)[ko],device:i(this,wo)[wo],session:i(this,Co)[Co],isPersonalisationActive:this._isPersonalisationActive}),this.enablePersonalization=r.enablePersonalization||!1,this.event=new Fe({logger:i(this,bo)[bo],request:i(this,xo)[xo],isPersonalisationActive:this._isPersonalisationActive},r.event),this.profile=new gt({logger:i(this,bo)[bo],request:i(this,xo)[xo],account:i(this,ko)[ko],isPersonalisationActive:this._isPersonalisationActive},r.profile),this.onUserLogin=new It({request:i(this,xo)[xo],account:i(this,ko)[ko],session:i(this,Co)[Co],logger:i(this,bo)[bo],device:i(this,wo)[wo]},r.onUserLogin),this.privacy=new Ai({request:i(this,xo)[xo],account:i(this,ko)[ko],logger:i(this,bo)[bo]},r.privacy),this.notifications=new Gi({logger:i(this,bo)[bo],request:i(this,xo)[xo],account:i(this,ko)[ko]},r.notifications),i(this,Po)[Po]=new fo({logger:i(this,bo)[bo],request:i(this,xo)[xo],account:i(this,ko)[ko],event:this.event}),i(this,mo)[mo]=new be({logger:i(this,bo)[bo],request:i(this,xo)[xo],device:i(this,wo)[wo],session:i(this,Co)[Co]}),this.spa=r.spa,this.dismissSpamControl=r.dismissSpamControl,this.user=new Xt({isPersonalisationActive:this._isPersonalisationActive}),this.session={getTimeElapsed:()=>i(this,Co)[Co].getTimeElapsed(),getPageCount:()=>i(this,Co)[Co].getPageCount()},this.logout=()=>{i(this,bo)[bo].debug("logout called"),ae.setInstantDeleteFlagInK()},this.clear=()=>{this.onUserLogin.clear()},this.getCleverTapID=()=>i(this,wo)[wo].getGuid(),this.getAccountID=()=>i(this,ko)[ko].id,this.getSCDomain=()=>i(this,ko)[ko].finalTargetDomain,this.setLibrary=(e,t)=>{le.flutterVersion={[e]:t}},this.setSCSDKVersion=e=>{i(this,ko)[ko].scSDKVersion=e;const t={};t.af={scv:"sc-sdk-v"+i(this,ko)[ko].scSDKVersion};let o=i(this,ko)[ko].dataPostURL;o=Ve(o,"type","page"),o=Ve(o,"d",Ke(JSON.stringify(t),i(this,bo)[bo])),i(this,xo)[xo].saveAndFireRequest(o,le.blockRequest)},Kt()&&(qt(),Ut(i(this,bo)[bo])),this.getInboxMessageCount=()=>{const e=Nt();return Object.keys(e).length},this.getInboxMessageUnreadCount=()=>{if(le.inbox)return le.inbox.unviewedCounter;i(this,bo)[bo].debug("No unread messages")},this.getAllInboxMessages=()=>Nt(),this.getUnreadInboxMessages=()=>{if(le.inbox)return le.inbox.unviewedMessages;i(this,bo)[bo].debug("No unread messages")},this.getInboxMessageForId=e=>{const t=Nt();if((null!==e||""!==e)&&t.hasOwnProperty(e))return t[e];i(this,bo)[bo].error("No message available for message Id "+e)},this.deleteInboxMessage=e=>{const t=Nt();if(null===e&&""===e||!t.hasOwnProperty(e))i(this,bo)[bo].error("No message available for message Id "+e);else{const i=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);0===t[e].viewed&&(le.inbox.unviewedCounter--,delete le.inbox.unviewedMessages[e],document.getElementById("unviewedBadge").innerText=le.inbox.unviewedCounter,document.getElementById("unviewedBadge").style.display=le.inbox.unviewedCounter>0?"flex":"none"),i&&i.remove(),delete t[e],Ft(t)}},this.markReadInboxMessage=e=>{const t=le.inbox.unviewedMessages,o=Nt();if(null===e&&""===e||!t.hasOwnProperty(e))i(this,bo)[bo].error("No message available for message Id "+e);else{const t=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);if(null!==t&&(t.shadowRoot.getElementById("unreadMarker").style.display="none"),o[e].viewed=1,document.getElementById("unviewedBadge")){var n=parseInt(document.getElementById("unviewedBadge").innerText)-1;document.getElementById("unviewedBadge").innerText=n,document.getElementById("unviewedBadge").style.display=n>0?"flex":"none"}window.clevertap.renderNotificationViewed({msgId:o[e].wzrk_id,pivotId:o[e].pivotId}),le.inbox.unviewedCounter--,delete le.inbox.unviewedMessages[e],Ft(o)}},this.markReadInboxMessagesForIds=e=>{if(Array.isArray(e))for(var t=0;t{const e=le.inbox.unviewedMessages,t=Nt();if(Object.keys(e).length>0){Object.keys(e).forEach((e=>{const i=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);null!==i&&(i.shadowRoot.getElementById("unreadMarker").style.display="none"),t[e].viewed=1,window.clevertap.renderNotificationViewed({msgId:t[e].wzrk_id,pivotId:t[e].wzrk_pivot})})),document.getElementById("unviewedBadge").innerText=0,document.getElementById("unviewedBadge").style.display="none",Ft(t),le.inbox.unviewedCounter=0,le.inbox.unviewedMessages={}}else i(this,bo)[bo].debug("All messages are already read")},this.toggleInbox=e=>{var t;return null===(t=le.inbox)||void 0===t?void 0:t.toggleInbox(e)},this.renderNotificationViewed=e=>{a(R,e)},this.renderNotificationClicked=e=>{a(j,e)};const a=(e,t)=>{if(!t||!t.msgId)return;const o={type:"event"};if(o.evtName=e,o.evtData={[T]:t.msgId},t.pivotId&&(o.evtData={...o.evtData,wzrk_pivot:t.pivotId}),t.wzrk_slideNo&&(o.evtData={...o.evtData,wzrk_slideNo:t.wzrk_slideNo}),t.kv&&null!==t.kv&&void 0!==t.kv)for(const e in t.kv)e.startsWith(M)&&(o.evtData={...o.evtData,[e]:t.kv[e]});if(t.msgCTkv&&null!==t.msgCTkv&&void 0!==t.msgCTkv)for(const e in t.msgCTkv)e.startsWith(M)&&(o.evtData={...o.evtData,[e]:t.msgCTkv[e]});i(this,xo)[xo].processEvent(o)};this.setLogLevel=e=>{i(this,bo)[bo].logLevel=Number(e),3===e?sessionStorage.WZRK_D="":delete sessionStorage.WZRK_D},this.handleIncrementValue=(e,t)=>{this.profile._handleIncrementDecrementValue(e,t,B)},this.handleDecrementValue=(e,t)=>{this.profile._handleIncrementDecrementValue(e,t,"$decr")},this.setMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueSet(e,t,"$set"):console.error("setMultiValuesForKey should be called with a value of type array")},this.addMultiValueForKey=(e,t)=>{"string"==typeof t||"number"==typeof t?this.profile._handleMultiValueAdd(e,t,N):console.error("addMultiValueForKey should be called with a value of type string or number.")},this.addMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueAdd(e,t,N):console.error("addMultiValuesForKey should be called with a value of type array.")},this.removeMultiValueForKey=(e,t)=>{"string"==typeof t||"number"==typeof t?this.profile._handleMultiValueRemove(e,t,F):console.error("removeMultiValueForKey should be called with a value of type string or number.")},this.removeMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueRemove(e,t,F):console.error("removeMultiValuesForKey should be called with a value of type array.")},this.removeValueForKey=e=>{this.profile._handleMultiValueDelete(e,U)};const l=(e,t,o)=>{((e,t,i,o,n)=>{const s=qe(location.href),r=s.e,a=s.p,l=s.page_type;if(void 0!==r){const s={};s.id=o.id,s.unsubGroups=le.unsubGroups,le.updatedCategoryLong&&(s.cUsY=le.updatedCategoryLong);let c=o.emailURL;i&&(c=Ve(c,"fetchGroups",i)),t&&(c=Ve(c,"encoded",t)),c=Ve(c,"e",r),c=Ve(c,"d",Ke(JSON.stringify(s),n)),a&&(c=Ve(c,"p",a)),"-1"!==e&&(c=Ve(c,"sub",e)),l&&(le.globalUnsubscribe=l===I,c=Ve(c,"page_type",l)),Qe.fireRequest(c)}})(e,t,o,i(this,ko)[ko],i(this,bo)[bo])};function c(e){var t=e.coords.latitude,i=e.coords.longitude;le.location={Latitude:t,Longitude:i},this.sendLocationData({Latitude:t,Longitude:i})}function h(e){switch(e.code){case e.PERMISSION_DENIED:console.log("User denied the request for Geolocation.");break;case e.POSITION_UNAVAILABLE:console.log("Location information is unavailable.");break;case e.TIMEOUT:console.log("The request to get user location timed out.");break;case e.UNKNOWN_ERROR:console.log("An unknown error occurred.")}}this.getLocation=function(e,t){if(e&&"number"!=typeof e||t&&"number"!=typeof t)console.log("Latitude and Longitude must be of number type");else if(e&&t){if(e<=-90||e>90)return void console.log("A vaid latitude must range between -90 and 90");if(t<=-180||t>180)return void console.log("A valid longitude must range between -180 and 180");le.location={Latitude:e,Longitude:t},this.sendLocationData({Latitude:e,Longitude:t})}else navigator.geolocation?navigator.geolocation.getCurrentPosition(c.bind(this),h):console.log("Geolocation is not supported by this browser.")};const u=i(this,mo)[mo];u.logout=this.logout,u.clear=this.clear,u.closeIframe=(e,t)=>{at(e,0,i(this,Co)[Co].sessionId)},u.enableWebPush=(e,t)=>{this.notifications._enableWebPush(e,t)},u.tr=e=>{Yt(e,{device:i(this,wo)[wo],session:i(this,Co)[Co],request:i(this,xo)[xo],logger:i(this,bo)[bo]})},u.setEnum=e=>{((e,t)=>{if(H(e)||Q(e))return"$E_"+e;t.error(Ae)})(e,i(this,bo)[bo])},u.is_onloadcalled=()=>1===i(this,yo)[yo],u.subEmail=e=>{l("1",e)},u.getEmail=(e,t)=>{l("-1",e,t)},u.unSubEmail=e=>{l("0",e)},u.unsubEmailGroups=e=>{le.unsubGroups=[];const t=document.getElementsByClassName("ct-unsub-group-input-item");for(let e=0;e{le.unsubGroups=e},u.getSubscriptionGroups=()=>le.unsubGroups,u.changeSubscriptionGroups=(e,t)=>{u.setSubscriptionGroups(t),l("2",e)},u.isGlobalUnsubscribe=()=>le.globalUnsubscribe,u.setIsGlobalUnsubscribe=e=>{le.globalUnsubscribe=e},u.setUpdatedCategoryLong=e=>{e.cUsY&&(le.updatedCategoryLong=e.cUsY)},window.$CLTP_WR=window.$WZRK_WR=u,(null===(s=r.account)||void 0===s?void 0:s[0].id)&&this.init()}init(e,t,o,n){if(1===i(this,yo)[yo])return;if(ae.removeCookie("WZRK_P",window.location.hostname),!i(this,ko)[ko].id){if(!e)return void i(this,bo)[bo].error(ke);i(this,ko)[ko].id=e}i(this,Co)[Co].cookieName="WZRK_S_"+i(this,ko)[ko].id,t&&(i(this,ko)[ko].region=t),o&&(i(this,ko)[ko].targetDomain=o),n&&(i(this,ko)[ko].token=n);const s=location.href,r=qe(s.toLowerCase());if(void 0!==r.e&&"0"==r.wzrk_ex)return;le.isPrivacyArrPushed=!0,le.privacyArray.length>0&&this.privacy.push(le.privacyArray),i(this,Eo)[Eo](),this.pageChanged();const a=setInterval((()=>{i(this,wo)[wo].gcookie&&(clearInterval(a),i(this,xo)[xo].processBackupEvents())}),3e3);i(this,So)[So]?document.addEventListener("click",i(this,Oo)[Oo]):document.removeEventListener("click",i(this,Oo)[Oo]),i(this,yo)[yo]=1}pageChanged(){const e=window.location.search,t=window.opener;if("?ctBuilder"===e)return console.log("open in visual builder mode"),window.addEventListener("message",i(this,Mo)[Mo],!1),void(t&&t.postMessage("builder","*"));if("?ctBuilderPreview"===e)return window.addEventListener("message",i(this,Mo)[Mo],!1),void(t&&t.postMessage("preview","*"));const o=window.location.href,n=qe(o.toLowerCase()),s=i(this,Co)[Co].getSessionCookieObject();let r=void 0===s.p?0:s.p;s.p=++r,i(this,Co)[Co].setSessionCookieObject(s);let a={},l=(e=>{if(""===e)return"";var t=document.createElement("a");return t.href=e,t.hostname})(document.referrer);if(window.location.hostname!==l){const e=120;""!==l&&(l=l.length>e?l.substring(0,e):l,a.referrer=l);let t=n.utm_source||n.wzrk_source;void 0!==t&&(t=t.length>e?t.substring(0,e):t,a.us=t);let i=n.utm_medium||n.wzrk_medium;void 0!==i&&(i=i.length>e?i.substring(0,e):i,a.um=i);let o=n.utm_campaign||n.wzrk_campaign;if(void 0!==o&&(o=o.length>e?o.substring(0,e):o,a.uc=o),void 0!==n.wzrk_medium){const e=n.wzrk_medium;e.match(/^email$|^social$|^search$/)&&(a.wm=e)}}a=i(this,xo)[xo].addSystemDataToObject(a,void 0),a.cpg=o,a.WZRK_CAMP=it();let c=i(this,ko)[ko].dataPostURL;i(this,xo)[xo].addFlags(a),1===parseInt(a.pg)&&i(this,jo)[jo](a),c=Ve(c,"type","page"),c=Ve(c,"d",Ke(JSON.stringify(a),i(this,bo)[bo])),i(this,xo)[xo].saveAndFireRequest(c,le.blockRequest),1===parseInt(a.pg)&&this.event.push(K,{t:4}),i(this,Io)[Io]=o,setTimeout((()=>{r<=3&&i(this,To)[To](),i(this,Ro)[Ro]()&&setInterval((()=>{i(this,To)[To]()}),3e5)}),12e4)}_isPersonalisationActive(){return ae._isLocalStorageSupported()&&this.enablePersonalization}set popupCallback(e){this.popupCallbacks[this.popupCurrentWzrkId]=e}sendLocationData(e){let t={af:{}};const o={};if(t.type="profile",null==o.tz&&(o.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),t.profile=o,e){Object.keys(e).forEach((i=>{t.af[i]=e[i]}))}le.location&&(t.af={...t.af,...le.location}),t=i(this,xo)[xo].addSystemDataToObject(t,!0),i(this,xo)[xo].addFlags(t);const n=Ke(JSON.stringify(t),i(this,bo)[bo]);let s=i(this,ko)[ko].dataPostURL;s=Ve(s,"type",A),s=Ve(s,"d",n),i(this,xo)[xo].saveAndFireRequest(s,le.blockRequest)}setOffline(e){"boolean"==typeof e?(le.offline=e,e||i(this,xo)[xo].processBackupEvents()):console.error("setOffline should be called with a value of type boolean")}defineVariable(e,t){return io.define(e,t,i(this,Po)[Po])}syncVariables(e,t){if(4===i(this,bo)[bo].logLevel)return i(this,Po)[Po].syncVariables(e,t);{const e="App log level is not set to 4";return i(this,bo)[bo].error(e),Promise.reject(new Error(e))}}fetchVariables(e){i(this,Po)[Po].fetchVariables(e)}addVariablesChangedCallback(e){i(this,Po)[Po].addVariablesChangedCallback(e)}addOneTimeVariablesChangedCallback(e){i(this,Po)[Po].addOneTimeVariablesChangedCallback(e)}}(window.clevertap);return window.clevertap=window.wizrocket=Vo,Vo})); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).clevertap=t()}(this,(function(){"use strict";var e=0;function t(t){return"__private_"+e+++"_"+t}function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}const o="clevertap-prod.com",n="https:";var s=t("accountId"),r=t("region"),a=t("targetDomain"),l=t("dcSdkversion"),c=t("token");class d{constructor(){let{id:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";Object.defineProperty(this,s,{writable:!0,value:void 0}),Object.defineProperty(this,r,{writable:!0,value:""}),Object.defineProperty(this,a,{writable:!0,value:o}),Object.defineProperty(this,l,{writable:!0,value:""}),Object.defineProperty(this,c,{writable:!0,value:""}),this.id=e,t&&(this.region=t),i&&(this.targetDomain=i),n&&(this.token=n)}get id(){return i(this,s)[s]}set id(e){i(this,s)[s]=e}get region(){return i(this,r)[r]}set region(e){i(this,r)[r]=e}get dcSDKVersion(){return i(this,l)[l]}set dcSDKVersion(e){i(this,l)[l]=e}get targetDomain(){return i(this,a)[a]}set targetDomain(e){i(this,a)[a]=e}get token(){return i(this,c)[c]}set token(e){i(this,c)[c]=e}get finalTargetDomain(){return this.region?"".concat(this.region,".").concat(this.targetDomain):this.targetDomain===o?"".concat("eu1",".").concat(this.targetDomain):this.targetDomain}get dataPostPEURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/defineVars")}get dataPostURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/a?t=96")}get recorderURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/r?r=1")}get emailURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/e?r=1")}}const h=new RegExp("^\\s+|\\.|:|\\$|'|\"|\\\\|\\s+$","g"),u=new RegExp("^\\s+|'|\"|\\\\|\\s+$","g"),p=new RegExp("'","g"),g="clear",f="Charged ID",v="WZRK_CHARGED_ID",b="WZRK_G",m="WZRK_K",y="WZRK_CAMP",w="WZRK_CAMP_G",C="WZRK_EV",k="WZRK_META",x="WZRK_PR",P="WZRK_ARP",S="WZRK_L",I="global",O="optOut",_="useIP",E="WZRK_X",A="push",L=31536e3,M="wzrk_",T="wzrk_id",R="Notification Viewed",j="Notification Clicked",D="WZRK_FPU",z="WZRK_PSD",B="$incr",N="$add",F="$remove",U="$delete",q="WZRK_INBOX_CONFIG",V="WZRK_INBOX",W=1e3,K="wzrk_fetch",G=["Stayed","UTM Visited","App Launched","Notification Sent",R,j],H=e=>"string"==typeof e||e instanceof String,J=e=>"[object Object]"===Object.prototype.toString.call(e),Z=e=>"object"==typeof e&&e instanceof Date,$=e=>{for(const t in e)if(e.hasOwnProperty(t))return!1;return!0},Y=e=>!isNaN(parseFloat(e))&&isFinite(e),Q=e=>/^-?[\d.]+(?:e-?\d+)?$/.test(e)&&"number"==typeof e,X=e=>null!=e&&"undefined"!==e,ee=(e,t)=>{if("object"!=typeof e){let i;return H(e)?(i=te(e,u),i.length>1024&&(i=i.substring(0,1024),t.reportError(521,i+"... length exceeded 1024 chars. Trimmed."))):i=e,i}for(const i in e)if(e.hasOwnProperty(i)){const o=ee(e[i],t);let n;n=te(i,h),n.length>1024&&(n=n.substring(0,1024),t.reportError(520,n+"... length exceeded 1024 chars. Trimmed.")),delete e[i],e[n]=o}return e},te=(e,t)=>e.replace(t,""),ie=()=>{const e=new Date;return e.getFullYear()+""+e.getMonth()+e.getDay()},oe=()=>Math.floor((new Date).getTime()/1e3),ne=e=>"$D_"+Math.round(e.getTime()/1e3),se=e=>{if(re(e))return"$D_"+e},re=e=>{const t=/^(\d{4})(\d{2})(\d{2})$/.exec(e);if(null==t)return!1;const i=t[3],o=t[2]-1,n=t[1],s=new Date(n,o,i);return s.getDate()==i&&s.getMonth()==o&&s.getFullYear()==n};class ae{static save(e,t){return!(!e||!t)&&(this._isLocalStorageSupported()?(localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),!0):void 0)}static read(e){if(!e)return!1;let t=null;if(this._isLocalStorageSupported()&&(t=localStorage.getItem(e)),null!=t)try{t=JSON.parse(t)}catch(e){}return t}static remove(e){return!!e&&(this._isLocalStorageSupported()?(localStorage.removeItem(e),!0):void 0)}static removeCookie(e,t){let i=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";t&&(i=i+" domain="+t+"; path=/"),document.cookie=i}static createCookie(e,t,i,o){let n="",s="";if(i){const e=new Date;e.setTime(e.getTime()+1e3*i),n="; expires="+e.toGMTString()}o&&(s="; domain="+o),t=encodeURIComponent(t),document.cookie=e+"="+t+n+s+"; path=/"}static readCookie(e){const t=e+"=",i=document.cookie.split(";");for(let e=0;e=0;o--){if(a=0===o?r[o]+a:"."+r[o]+a,this.readCookie(e)){var n="test_"+e+o;if(this.createCookie(n,t,10,a),!this.readCookie(n))continue;this.removeCookie(n,a)}this.createCookie(e,t,i,a);if(this.readCookie(e)==t){s=a,le.broadDomain=s;break}}}else this.createCookie(e,t,i,s)}else this.createCookie(e,t,i,o)}static getMetaProp(e){const t=this.readFromLSorCookie(k);if(null!=t)return t[e]}static setMetaProp(e,t){if(this._isLocalStorageSupported()){let i=this.readFromLSorCookie(k);null==i&&(i={}),void 0===t?delete i[e]:i[e]=t,this.saveToLSorCookie(k,i)}}static getAndClearMetaProp(e){const t=this.getMetaProp(e);return this.setMetaProp(e,void 0),t}static setInstantDeleteFlagInK(){let e=this.readFromLSorCookie(m);null==e&&(e={}),e.flag=!0,this.saveToLSorCookie(m,e)}static backupEvent(e,t,i){let o=this.readFromLSorCookie(S);void 0===o&&(o={}),o[t]={q:e},this.saveToLSorCookie(S,o),i.debug("stored in ".concat(S," reqNo : ").concat(t," -> ").concat(e))}static removeBackup(e,t){const i=this.readFromLSorCookie(S);null!=i&&void 0!==i[e]&&(t.debug("del event: ".concat(e," data-> ").concat(i[e].q)),delete i[e],this.saveToLSorCookie(S,i))}}const le={globalCache:{gcookie:null,REQ_N:0,RESP_N:0},LRU_CACHE:null,globalProfileMap:void 0,globalEventsMap:void 0,blockRequest:!1,isOptInRequest:!1,broadDomain:null,webPushEnabled:null,campaignDivMap:{},currentSessionId:null,wiz_counter:0,notifApi:{notifEnabledFromApi:!1},unsubGroups:[],updatedCategoryLong:null,inbox:null,isPrivacyArrPushed:!1,privacyArray:[],offline:!1,location:null,dismissSpamControl:!1,globalUnsubscribe:!0,flutterVersion:null,variableStore:{}};var ce=t("keyOrder"),de=t("deleteFromObject");class he{constructor(e){Object.defineProperty(this,de,{value:ue}),Object.defineProperty(this,ce,{writable:!0,value:void 0}),this.max=e;let t=ae.readFromLSorCookie(E);if(t){const e={};i(this,ce)[ce]=[],t=t.cache;for(const o in t)t.hasOwnProperty(o)&&(e[t[o][0]]=t[o][1],i(this,ce)[ce].push(t[o][0]));this.cache=e}else this.cache={},i(this,ce)[ce]=[]}get(e){const t=this.cache[e];return t&&(this.cache=i(this,de)[de](e,this.cache),this.cache[e]=t,i(this,ce)[ce].push(e)),this.saveCacheToLS(this.cache),t}set(e,t){const o=this.cache[e],n=i(this,ce)[ce];null!=o?this.cache=i(this,de)[de](e,this.cache):n.length===this.max&&(this.cache=i(this,de)[de](n[0],this.cache)),this.cache[e]=t,i(this,ce)[ce][i(this,ce)[ce]-1]!==e&&i(this,ce)[ce].push(e),this.saveCacheToLS(this.cache)}saveCacheToLS(e){const t=[],o=i(this,ce)[ce];for(const i in o)if(o.hasOwnProperty(i)){const n=[];n.push(o[i]),n.push(e[o[i]]),t.push(n)}ae.saveToLSorCookie(E,{cache:t})}getKey(e){if(null===e)return null;const t=i(this,ce)[ce];for(const i in t)if(t.hasOwnProperty(i)&&this.cache[t[i]]===e)return t[i];return null}getSecondLastKey(){const e=i(this,ce)[ce];return null!=e&&e.length>1?e[e.length-2]:-1}getLastKey(){const e=i(this,ce)[ce].length;if(e)return i(this,ce)[ce][e-1]}}var ue=function(e,t){const o=JSON.parse(JSON.stringify(i(this,ce)[ce])),n={};let s;for(const i in o)o.hasOwnProperty(i)&&(o[i]!==e?n[o[i]]=t[o[i]]:s=i);return o.splice(s,1),i(this,ce)[ce]=JSON.parse(JSON.stringify(o)),n},pe=t("logger"),ge=t("request"),fe=t("device"),ve=t("session");class be{constructor(e){let{logger:t,request:o,device:n,session:s}=e;Object.defineProperty(this,pe,{writable:!0,value:void 0}),Object.defineProperty(this,ge,{writable:!0,value:void 0}),Object.defineProperty(this,fe,{writable:!0,value:void 0}),Object.defineProperty(this,ve,{writable:!0,value:void 0}),i(this,pe)[pe]=t,i(this,ge)[ge]=o,i(this,fe)[fe]=n,i(this,ve)[ve]=s}s(e,t,o,n,s){let r=!1,a=!1;if(window.isOULInProgress&&(o||"undefined"!==n&&n===window.oulReqN)&&(window.isOULInProgress=!1,r=!0),void 0===n&&(n=0),ae.removeBackup(n,i(this,pe)[pe]),n>le.globalCache.REQ_N)return;if(X(i(this,fe)[fe].gcookie)||e&&(a=!0),!X(i(this,fe)[fe].gcookie)||o||"boolean"==typeof s){const n=i(this,ve)[ve].getSessionCookieObject();if(window.isOULInProgress||n.s&&t{if(J(e)){for(var t in e)if(e.hasOwnProperty(t)){if(J(e[t])||Array.isArray(e[t]))return!1;Z(e[t])&&(e[t]=ne(e[t]))}return!0}return!1},Re=(e,t)=>{if(J(e)){for(var i in e)if(e.hasOwnProperty(i))if("Items"===i){if(!Array.isArray(e[i]))return!1;for(var o in e[i].length>50&&t.reportError(522,"Charged Items exceed 50 limit. Actual count: "+e[i].length),e[i])if(e[i].hasOwnProperty(o)&&(!J(e[i][o])||!Te(e[i][o])))return!1}else{if(J(e[i])||Array.isArray(e[i]))return!1;Z(e[i])&&(e[i]=ne(e[i]))}if(H(e[f])||Q(e[f])){const i=e[f]+"";if(void 0===Me&&(Me=ae.readFromLSorCookie(v)),void 0!==Me&&Me.trim()===i.trim())return t.error("Duplicate charged Id - Dropped"+e),!1;Me=i,ae.saveToLSorCookie(v,i)}return!0}return!1};var je=t("logger"),De=t("oldValues"),ze=t("request"),Be=t("isPersonalisationActive"),Ne=t("processEventArray");class Fe extends Array{constructor(e,t){let{logger:o,request:n,isPersonalisationActive:s}=e;super(),Object.defineProperty(this,Ne,{value:Ue}),Object.defineProperty(this,je,{writable:!0,value:void 0}),Object.defineProperty(this,De,{writable:!0,value:void 0}),Object.defineProperty(this,ze,{writable:!0,value:void 0}),Object.defineProperty(this,Be,{writable:!0,value:void 0}),i(this,je)[je]=o,i(this,De)[De]=t,i(this,ze)[ze]=n,i(this,Be)[Be]=s}push(){for(var e=arguments.length,t=new Array(e),o=0;o0;){var t=e.shift();if(!H(t)){i(this,je)[je].error(xe);continue}if(t.length>1024&&(t=t.substring(0,1024),i(this,je)[je].reportError(510,t+"... length exceeded 1024 chars. Trimmed.")),G.includes(t)){i(this,je)[je].reportError(513,t+" is a restricted system event. It cannot be used as an event name.");continue}const o={type:"event"};if(o.evtName=te(t,h),0!==e.length){const n=e.shift();if(J(n)){if("Charged"===t){if(!Re(n,i(this,je)[je])){i(this,je)[je].reportError(511,"Charged event structure invalid. Not sent.");continue}}else if(!Te(n)){i(this,je)[je].reportError(512,t+" event structure invalid. Not sent.");continue}o.evtData=n}else e.unshift(n)}i(this,ze)[ze].processEvent(o)}};const qe=e=>{const t={},i=e.indexOf("?");if(i>1){const o=e.substring(i+1);let n;const s=/\+/g,r=/([^&=]+)=?([^&]*)/g,a=function(e){let t=e.replace(s," ");try{t=decodeURIComponent(t)}catch(e){}return t};for(n=r.exec(o);n;)t[a(n[1])]=a(n[2]),n=r.exec(o)}return t},Ve=(e,t,i)=>e+"&"+t+"="+encodeURIComponent(i),We=()=>window.location.hostname,Ke=(e,t)=>(t&&"function"==typeof t.debug&&t.debug("dobj:"+e),He(e)),Ge=(()=>{let e="",t=0;for(t=0;t<=25;t++)e+=String.fromCharCode(t+65);for(t=0;t<=25;t++)e+=String.fromCharCode(t+97);for(t=0;t<10;t++)e+=t;return e+"+/="})(),He=e=>{if(null==e)return"";var t,i,o,n,s,r,a,l="",c=0;for(e=(e=>{if(null==e)return"";let t,i,o,n={},s={},r="",a="",l="",c=2,d=3,h=2,u="",p=0,g=0,f=String.fromCharCode;for(o=0;o>=1}else{for(i=1,t=0;t>=1}c--,0==c&&(c=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;c--,0==c&&(c=Math.pow(2,h),h++),n[a]=d++,l=String(r)}if(""!==l){if(Object.prototype.hasOwnProperty.call(s,l)){if(l.charCodeAt(0)<256){for(t=0;t>=1}else{for(i=1,t=0;t>=1}c--,0==c&&(c=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;c--,0==c&&(c=Math.pow(2,h),h++)}for(i=2,t=0;t>=1;for(;;){if(p<<=1,15==g){u+=f(p);break}g++}return u})(e);c<2*e.length;)c%2==0?(t=e.charCodeAt(c/2)>>8,i=255&e.charCodeAt(c/2),o=c/2+1>8:NaN):(t=255&e.charCodeAt((c-1)/2),(c+1)/2>8,o=255&e.charCodeAt((c+1)/2)):i=o=NaN),c+=3,n=t>>2,s=(3&t)<<4|i>>4,r=(15&i)<<2|o>>6,a=63&o,isNaN(i)?r=a=64:isNaN(o)&&(a=64),l=l+Ge.charAt(n)+Ge.charAt(s)+Ge.charAt(r)+Ge.charAt(a);return l};var Je=t("fireRequest"),Ze=t("dropRequestDueToOptOut"),$e=t("addUseIPToRequest"),Ye=t("addARPToRequest");class Qe{constructor(){this.networkRetryCount=0,this.minDelayFrequency=0}static fireRequest(e,t,o,n){i(this,Je)[Je](e,1,t,o,n)}getDelayFrequency(){if(this.logger.debug("Network retry #"+this.networkRetryCount),this.networkRetryCount<10)return this.logger.debug(this.account.id,"Failure count is "+this.networkRetryCount+". Setting delay frequency to 1s"),this.minDelayFrequency=W,this.minDelayFrequency;if(null==this.account.region)return this.logger.debug(this.account.id,"Setting delay frequency to 1s"),W;{const e=1e3*(Math.floor(10*Math.random())+1);return this.minDelayFrequency+=e,this.minDelayFrequency<6e5?(this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency):(this.minDelayFrequency=W,this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency)}}}Qe.logger=void 0,Qe.device=void 0,Qe.account=void 0,Object.defineProperty(Qe,Je,{value:function(e,t,o,n,s){var r,a;if(i(this,Ze)[Ze]())return void this.logger.debug("req dropped due to optout cookie: "+this.device.gcookie);if(X(this.device.gcookie)||(le.blockRequest=!0),s&&s===K)!X(this.device.gcookie)&&le.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(this.networkRetryCount)),i(this,Je)[Je](e,void 0,o,n)}),this.getDelayFrequency());else if(!X(this.device.gcookie)&&le.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(t)),i(this,Je)[Je](e,t+1,o,n)}),50);if(n?window.isOULInProgress=!0:(X(this.device.gcookie)&&(e=Ve(e,"gc",this.device.gcookie)),e=i(this,Ye)[Ye](e,o)),e=Ve(e,"tries",t),e=i(this,$e)[$e](e),e=Ve(e,"r",(new Date).getTime()),(null===(r=window.clevertap)||void 0===r?void 0:r.hasOwnProperty("plugin"))||(null===(a=window.wizrocket)||void 0===a?void 0:a.hasOwnProperty("plugin"))){const t=window.clevertap.plugin||window.wizrocket.plugin;e=Ve(e,"ct_pl",t)}-1!==e.indexOf("chrome-extension:")&&(e=e.replace("chrome-extension:","https:"));for(var l=document.getElementsByClassName("ct-jp-cb");l[0]&&l[0].parentNode;)l[0].parentNode.removeChild(l[0]);const c=document.createElement("script");c.setAttribute("type","text/javascript"),c.setAttribute("src",e),c.setAttribute("class","ct-jp-cb"),c.setAttribute("rel","nofollow"),c.async=!0,document.getElementsByTagName("head")[0].appendChild(c),this.logger.debug("req snt -> url: "+e)}}),Object.defineProperty(Qe,Ze,{value:function(){return!le.isOptInRequest&&X(this.device.gcookie)&&H(this.device.gcookie)?":OO"===this.device.gcookie.slice(-3):(le.isOptInRequest=!1,!1)}}),Object.defineProperty(Qe,$e,{value:function(e){var t=ae.getMetaProp(_);return"boolean"!=typeof t&&(t=!1),Ve(e,_,t?"true":"false")}}),Object.defineProperty(Qe,Ye,{value:function(e,t){if(!0===t){const t={skipResARP:!0};return Ve(e,"arp",Ke(JSON.stringify(t),this.logger))}return ae._isLocalStorageSupported()&&void 0!==localStorage.getItem(P)&&null!==localStorage.getItem(P)?Ve(e,"arp",Ke(JSON.stringify(ae.readFromLSorCookie(P)),this.logger)):e}});const Xe=()=>{let e={};if(ae._isLocalStorageSupported()){let t=ae.read(y);null!=t?(t=JSON.parse(decodeURIComponent(t).replace(p,'"')),t.hasOwnProperty("global")?e.wp=t:e=t):e={}}return e},et=e=>{if(ae._isLocalStorageSupported()){const t={...Xe(),...e},i=JSON.stringify(t);ae.save(y,encodeURIComponent(i)),tt()}},tt=()=>{if(ae._isLocalStorageSupported()){let i=ae.read(b);if(X(i))try{i=JSON.parse(decodeURIComponent(ae.read(b)));const o=ae.read(w)?JSON.parse(decodeURIComponent(ae.read(w))):{};if(i&&ae._isLocalStorageSupported()){var e={},t=Xe();Object.keys(t).forEach((n=>{const s=i in o&&Object.keys(o[i]).length&&o[i][n]?o[i][n]:{},r=t[n].global,a=ie(),l=t[n][a];if(void 0!==r){const e=Object.keys(r);for(const t in e){let i=[];if(e.hasOwnProperty(t)){let o=0,n=0;const a=e[t];if("tc"===a)continue;void 0!==l&&void 0!==l[a]&&(o=l[a]),void 0!==r&&void 0!==r[a]&&(n=r[a]),i=[a,o,n],s[a]=i}}}e={...e,[n]:s}})),o[i]=e,ae.save(w,encodeURIComponent(JSON.stringify(o)))}}catch(e){console.error("Invalid clevertap Id "+e)}}},it=()=>{const e=JSON.parse(decodeURIComponent(ae.read(b)));let t={};if(ae._isLocalStorageSupported()){let i={};t=Xe();const o=ae.read(w),n=o?decodeURIComponent(o):null,s=n?JSON.parse(n):null,r=e&&null!=o&&s&&s[e]&&s[e].wp?Object.values(s[e].wp):[],a=e&&null!=o&&s&&s[e]&&s[e].wi?Object.values(s[e].wi):[],l=ie();let c=0,d=0;return t.wp&&t.wp[l]&&"undefined"!==t.wp[l].tc&&(c=t.wp[l].tc),t.wi&&t.wi[l]&&"undefined"!==t.wi[l].tc&&(d=t.wi[l].tc),i={wmp:c,wimp:d,tlc:r,witlc:a},i}},ot=(e,t)=>{let{logger:i}=t,o=!1;if(J(e))for(const t in e)if(e.hasOwnProperty(t)){o=!0;let n=e[t];if(null==n){delete e[t];continue}"Gender"!==t||n.match(/^M$|^F$/)||(o=!1,i.error(Pe)),"Employed"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Se)),"Married"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Ie)),"Education"!==t||n.match(/^School$|^College$|^Graduate$/)||(o=!1,i.error(Oe)),"Age"===t&&null!=n&&(Y(n)?e.Age=+n:(o=!1,i.error(_e))),"DOB"===t?(/^\$D_/.test(n)&&11===(n+"").length||Z(n)||(o=!1,i.error(Ee)),Z(n)&&(e[t]=ne(n))):Z(n)&&(e[t]=ne(n)),"Phone"!==t||$(n)||(n.length>8&&"+"===n.charAt(0)?(n=n.substring(1,n.length),Y(n)?e.Phone=+n:(o=!1,i.error(Le+". Removed."))):(o=!1,i.error(Le+". Removed."))),o||delete e[t]}return o},nt=e=>{const t={};t.Name=e.name,null!=e.id&&(t.FBID=e.id+""),"male"===e.gender?t.Gender="M":"female"===e.gender?t.Gender="F":t.Gender="O";null!=e.relationship_status&&(t.Married="N","Married"===e.relationship_status&&(t.Married="Y"));const i=function(e){if(null!=e){let t="",i="";for(let o=0;o0?"Y":"N",null!=e.email&&(t.Email=e.email),null!=e.birthday){const i=e.birthday.split("/");t.DOB=se(i[2]+i[0]+i[1])}return t},st=(e,t)=>{let{logger:i}=t;const o={};if(null!=e.displayName&&(o.Name=e.displayName),null!=e.id&&(o.GPID=e.id+""),null!=e.gender&&("male"===e.gender?o.Gender="M":"female"===e.gender?o.Gender="F":"other"===e.gender&&(o.Gender="O")),null!=e.image&&!1===e.image.isDefault&&(o.Photo=e.image.url.split("?sz")[0]),null!=e.emails)for(let t=0;t{if(ae._isLocalStorageSupported()){if(null==le.globalProfileMap&&(le.globalProfileMap=ae.readFromLSorCookie(x),null==le.globalProfileMap&&(le.globalProfileMap={})),null!=e._custom){const t=e._custom;for(const i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);delete e._custom}for(const i in e)if(e.hasOwnProperty(i)){if(le.globalProfileMap.hasOwnProperty(i)&&!t)continue;le.globalProfileMap[i]=e[i]}null!=le.globalProfileMap._custom&&delete le.globalProfileMap._custom,ae.saveToLSorCookie(x,le.globalProfileMap)}},at=(e,t,i)=>{if(null!=e&&"-1"!==e&&ae._isLocalStorageSupported()){const t=Xe();let o=t.wp[i];null==o&&(o={},t[i]=o),o[e]="dnd",et(t)}if(null!=le.campaignDivMap){const t=le.campaignDivMap[e];null!=t&&(document.getElementById(t).style.display="none","intentPreview"===t&&null!=document.getElementById("intentOpacityDiv")&&(document.getElementById("intentOpacityDiv").style.display="none"))}};var lt=t("logger"),ct=t("request"),dt=t("account"),ht=t("oldValues"),ut=t("isPersonalisationActive"),pt=t("processProfileArray");class gt extends Array{constructor(e,t){let{logger:o,request:n,account:s,isPersonalisationActive:r}=e;super(),Object.defineProperty(this,pt,{value:ft}),Object.defineProperty(this,lt,{writable:!0,value:void 0}),Object.defineProperty(this,ct,{writable:!0,value:void 0}),Object.defineProperty(this,dt,{writable:!0,value:void 0}),Object.defineProperty(this,ht,{writable:!0,value:void 0}),Object.defineProperty(this,ut,{writable:!0,value:void 0}),i(this,lt)[lt]=o,i(this,ct)[ct]=n,i(this,dt)[dt]=s,i(this,ht)[ht]=t,i(this,ut)[ut]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o0)for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];let n,s={};if(null!=o.Site){if(n=o.Site,$(n)||!ot(n,{logger:i(this,lt)[lt]}))return}else if(null!=o.Facebook){const e=o.Facebook;$(e)||e.error||(n=nt(e))}else if(null!=o["Google Plus"]){const e=o["Google Plus"];$(e)||e.error||(n=st(e,{logger:i(this,lt)[lt]}))}if(null!=n&&!$(n)){s.type="profile",null==n.tz&&(n.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),s.profile=n,rt(n,!0),s=i(this,ct)[ct].addSystemDataToObject(s,void 0),i(this,ct)[ct].addFlags(s);const e=Ke(JSON.stringify(s),i(this,lt)[lt]);let t=i(this,dt)[dt].dataPostURL;t=Ve(t,"type",A),t=Ve(t,"d",e),i(this,ct)[ct].saveAndFireRequest(t,le.blockRequest)}}},vt=t("request"),bt=t("logger"),mt=t("account"),yt=t("session"),wt=t("oldValues"),Ct=t("device"),kt=t("processOUL"),xt=t("handleCookieFromCache"),Pt=t("deleteUser"),St=t("processLoginArray");class It extends Array{constructor(e,t){let{request:o,account:n,session:s,logger:r,device:a}=e;super(),Object.defineProperty(this,St,{value:At}),Object.defineProperty(this,Pt,{value:Et}),Object.defineProperty(this,xt,{value:_t}),Object.defineProperty(this,kt,{value:Ot}),Object.defineProperty(this,vt,{writable:!0,value:void 0}),Object.defineProperty(this,bt,{writable:!0,value:void 0}),Object.defineProperty(this,mt,{writable:!0,value:void 0}),Object.defineProperty(this,yt,{writable:!0,value:void 0}),Object.defineProperty(this,wt,{writable:!0,value:void 0}),Object.defineProperty(this,Ct,{writable:!0,value:void 0}),i(this,vt)[vt]=o,i(this,mt)[mt]=n,i(this,yt)[yt]=s,i(this,bt)[bt]=r,i(this,wt)[wt]=t,i(this,Ct)[Ct]=a}clear(){i(this,bt)[bt].debug("clear called. Reset flag has been set."),i(this,Pt)[Pt](),ae.setMetaProp(g,!0)}push(){for(var e=arguments.length,t=new Array(e),o=0;o{let o=ae.readFromLSorCookie(m);const n=ae.readFromLSorCookie(b);let s;if(null==o)o={},s=e;else{s=o.id;let r=!1,a=!1;if(null==s&&(s=e[0],r=!0),null==le.LRU_CACHE&&ae._isLocalStorageSupported()&&(le.LRU_CACHE=new he(100)),r)null!=n&&(le.LRU_CACHE.set(s,n),le.blockRequest=!1);else for(const t in e)if(e.hasOwnProperty(t)){const i=e[t];if(le.LRU_CACHE.cache[i]){s=i,a=!0;break}}if(a){s!==le.LRU_CACHE.getLastKey()?i(this,xt)[xt]():(t=!1,ae.saveToLSorCookie(D,t));const e=le.LRU_CACHE.get(s);le.LRU_CACHE.set(s,e),ae.saveToLSorCookie(b,e),i(this,Ct)[Ct].gcookie=e;const o=le.LRU_CACHE.getSecondLastKey();if(ae.readFromLSorCookie(D)&&-1!==o){const e=le.LRU_CACHE.cache[o];i(this,vt)[vt].unregisterTokenForGuid(e)}}else r?null!=n&&(i(this,Ct)[Ct].gcookie=n,ae.saveToLSorCookie(b,n),t=!1):this.clear(),ae.saveToLSorCookie(D,!1),s=e[0]}o.id=s,ae.saveToLSorCookie(m,o)};if(Array.isArray(e)&&e.length>0)for(const n in e)if(e.hasOwnProperty(n)){const s=e[n];let r,a={};if(null!=s.Site){if(r=s.Site,$(r)||!ot(r,{logger:i(this,bt)[bt]}))return}else if(null!=s.Facebook){const e=s.Facebook;$(e)||e.error||(r=nt(e))}else if(null!=s["Google Plus"]){const e=s["Google Plus"];$(e)&&!e.error&&(r=st(e,{logger:i(this,bt)[bt]}))}if(null!=r&&!$(r)){a.type="profile",null==r.tz&&(r.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),a.profile=r;const e=[];ae._isLocalStorageSupported()&&(r.Identity&&e.push(r.Identity),r.Email&&e.push(r.Email),r.GPID&&e.push("GP:"+r.GPID),r.FBID&&e.push("FB:"+r.FBID),e.length>0&&o(e)),rt(r,!0),a=i(this,vt)[vt].addSystemDataToObject(a,void 0),i(this,vt)[vt].addFlags(a),t&&(a.isOUL=!0);const n=Ke(JSON.stringify(a),i(this,bt)[bt]);let s=i(this,mt)[mt].dataPostURL;s=Ve(s,"type",A),s=Ve(s,"d",n),i(this,vt)[vt].saveAndFireRequest(s,le.blockRequest,t)}}},_t=function(){le.blockRequest=!1,console.debug("Block request is false"),ae._isLocalStorageSupported()&&(delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),ae.removeCookie(y,We()),ae.removeCookie(i(this,yt)[yt].cookieName,le.broadDomain),ae.removeCookie(P,le.broadDomain),i(this,yt)[yt].setSessionCookieObject("")},Et=function(){le.blockRequest=!0,i(this,bt)[bt].debug("Block request is true"),le.globalCache={gcookie:null,REQ_N:0,RESP_N:0},ae._isLocalStorageSupported()&&(delete localStorage.WZRK_G,delete localStorage.WZRK_K,delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),ae.removeCookie(b,le.broadDomain),ae.removeCookie(y,We()),ae.removeCookie(m,We()),ae.removeCookie(i(this,yt)[yt].cookieName,le.broadDomain),ae.removeCookie(P,le.broadDomain),i(this,Ct)[Ct].gcookie=null,i(this,yt)[yt].setSessionCookieObject("")},At=function(e){if(Array.isArray(e)&&e.length>0){const t=e.pop();if(null!=t&&J(t)&&(null!=t.Site&&Object.keys(t.Site).length>0||null!=t.Facebook&&Object.keys(t.Facebook).length>0||null!=t["Google Plus"]&&Object.keys(t["Google Plus"]).length>0)){ae.setInstantDeleteFlagInK();try{i(this,kt)[kt]([t])}catch(e){i(this,bt)[bt].debug(e)}}else i(this,bt)[bt].error("Profile object is in incorrect format")}};class Lt extends HTMLElement{constructor(){super(),this._details=null,this.shadow=null,this.shadow=this.attachShadow({mode:"open"})}get details(){return this._details||""}set details(e){null===this._details&&(this._details=e,this.renderBanner())}renderBanner(){this.shadow.innerHTML=this.getBannerContent(),!1!==this.trackClick&&this.addEventListener("click",(()=>{const e=this.details.onClick;e&&(this.details.window?window.open(e,"_blank"):window.parent.location.href=e),window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId})}getBannerContent(){return'\n \n \n ")}}class Mt extends HTMLElement{constructor(){super(),this._target=null,this._carousel=null,this.shadow=null,this.slides=0,this.previouslySelectedItem=-1,this.selectedItem=1,this.autoSlide=null,this.stopAutoSlideTimeout=null,this.shadow=this.attachShadow({mode:"open"}),void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Lt)}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderCarousel())}get details(){return this.target.display.details}get display(){return this.target.display}renderCarousel(){this.slides=this.details.length,this.shadow.innerHTML=this.getStyles();const e=this.getCarouselContent();this.display.showNavBtns&&e.insertAdjacentHTML("beforeend",this.display.navBtnsHtml),this.display.showNavArrows&&(e.insertAdjacentHTML("beforeend",this.display.leftNavArrowHtml),e.insertAdjacentHTML("beforeend",this.display.rightNavArrowHtml)),this._carousel=e,this.shadow.appendChild(e),this.setupClick(),this.updateSelectedItem(),this.startAutoSlide(),this.setupOnHover(),window.clevertap.renderNotificationViewed({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot})}setupClick(){this._carousel.addEventListener("click",(e=>{const t=e.target.id;if(t.startsWith("carousel__button")){const e=+t.split("-")[1];e!==this.selectedItem&&(this.previouslySelectedItem=this.selectedItem,this.selectedItem=e,this.updateSelectedItem(),this.startAutoSlide())}else if(t.startsWith("carousel__arrow"))t.endsWith("right")?this.goToNext():this.goToPrev(),this.startAutoSlide();else if(t.indexOf("-")>-1){const e=+t.split("-")[1],i=e-1;window.parent.clevertap&&window.clevertap.renderNotificationClicked({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot,wzrk_slideNo:e});const o=this.details[i].onClick;""!==o&&(this.details[i].window?window.open(o,"_blank"):window.location.href=o)}}))}setupOnHover(){this._carousel.addEventListener("mouseenter",(e=>{this.stopAutoSlideTimeout=setTimeout((()=>{this.autoSlide=clearInterval(this.autoSlide)}),500)})),this._carousel.addEventListener("mouseleave",(e=>{clearTimeout(this.stopAutoSlideTimeout),void 0===this.autoSlide&&this.startAutoSlide()}))}getCarouselContent(){const e=document.createElement("div");return e.setAttribute("class","carousel"),this.details.forEach(((t,i)=>{const o=document.createElement("ct-web-personalisation-banner");o.classList.add("carousel__item"),o.trackClick=!1,o.setAttribute("id","carousel__item-".concat(i+1)),o.details=t,e.appendChild(o)})),e}getStyles(){var e,t;return"\n \n ")}updateSelectedItem(){if(-1!==this.previouslySelectedItem){const e=this.shadow.getElementById("carousel__item-".concat(this.previouslySelectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.previouslySelectedItem));e.classList.remove("carousel__item--selected"),t&&t.classList.remove("carousel__button--selected")}const e=this.shadow.getElementById("carousel__item-".concat(this.selectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.selectedItem));e.classList.add("carousel__item--selected"),t&&t.classList.add("carousel__button--selected")}startAutoSlide(){clearInterval(this.autoSlide),this.autoSlide=setInterval((()=>{this.goToNext()}),this.display.sliderTime?1e3*this.display.sliderTime:3e3)}goToNext(){this.goTo(this.selectedItem,(this.selectedItem+1)%this.slides)}goToPrev(){this.goTo(this.selectedItem,this.selectedItem-1)}goTo(e,t){this.previouslySelectedItem=e,this.selectedItem=t,0===t&&(this.selectedItem=this.slides),this.updateSelectedItem()}}class Tt extends HTMLElement{constructor(){super(),this._target=null,this._session=null,this.shadow=null,this.popup=null,this.container=null,this.resizeObserver=null,this.shadow=this.attachShadow({mode:"open"})}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderImageOnlyPopup())}get session(){return this._session||""}set session(e){this._session=e}get msgId(){return this.target.wzrk_id}get pivotId(){return this.target.wzrk_pivot}get onClickUrl(){return this.target.display.onClickUrl}renderImageOnlyPopup(){const e=this.target.wzrk_id.split("_")[0],t=this.session.sessionId;this.shadow.innerHTML=this.getImageOnlyPopupContent(),this.popup=this.shadowRoot.getElementById("imageOnlyPopup"),this.container=this.shadowRoot.getElementById("container"),this.closeIcon=this.shadowRoot.getElementById("close"),this.popup.addEventListener("load",this.updateImageAndContainerWidth()),this.resizeObserver=new ResizeObserver((()=>this.handleResize(this.popup,this.container))),this.resizeObserver.observe(this.popup),this.closeIcon.addEventListener("click",(()=>{if(this.resizeObserver.unobserve(this.popup),document.getElementById("wzrkImageOnlyDiv").style.display="none",this.remove(),null!=e&&"-1"!==e&&ae._isLocalStorageSupported()){const i=Xe();let o=i.wp[t];null==o&&(o={},i[t]=o),o[e]="dnd",et(i)}})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId}),this.onClickUrl&&this.popup.addEventListener("click",(()=>{this.target.display.window?window.open(this.onClickUrl,"_blank"):window.parent.location.href=this.onClickUrl,window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})}))}handleResize(e,t){const i=this.getRenderedImageWidth(e);t.style.setProperty("width","".concat(i,"px"))}getImageOnlyPopupContent(){return"\n ".concat(this.target.msgContent.css,"\n ").concat(this.target.msgContent.html,"\n ")}updateImageAndContainerWidth(){return()=>{const e=this.getRenderedImageWidth(this.popup);this.popup.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("height","auto"),this.container.style.setProperty("position","fixed"),this.popup.style.setProperty("visibility","visible"),this.closeIcon.style.setProperty("visibility","visible"),document.getElementById("wzrkImageOnlyDiv").style.visibility="visible"}}getRenderedImageWidth(e){const t=e.naturalWidth/e.naturalHeight;return e.height*t}}class Rt extends HTMLElement{constructor(e,t){super(),this.wrapper=null,this.snackBar=null,this.shadow=this.attachShadow({mode:"open"}),this.config=e,this.message=t,this.renderMessage(t)}get pivotId(){return this.message.wzrk_pivot}get campaignId(){return this.message.wzrk_id}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}renderMessage(e){switch(this.wrapper=this.createEl("div","messageWrapper"),e.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":{const t=this.prepareBasicMessage(e.msg[0]);this.wrapper.appendChild(t)}}const t=this.createEl("div","timeStamp");if(t.innerHTML="".concat(Wt(e.id.split("_")[1]),""),!e.viewed){const e=this.createEl("span","unreadMarker");t.appendChild(e)}this.wrapper.appendChild(t),this.shadow.appendChild(this.wrapper)}prepareBasicMessage(e){const t=this.createEl("div","message");if(e.imageUrl){const i=this.addImage(e.imageUrl,"mainImg");t.appendChild(i)}const i=this.createEl("div","iconTitleDescWrapper");if(e.iconUrl){const t=this.addImage(e.iconUrl,"iconImg");i.appendChild(t)}const o=this.createEl("div","titleDescWrapper");if(e.title){const t=this.createEl("div","title");t.innerText=e.title,o.appendChild(t)}if(e.description){const t=this.createEl("div","description");t.innerText=e.description,o.appendChild(t)}if((e.title||e.description)&&i.appendChild(o),(e.iconUrl||e.title||e.description)&&t.appendChild(i),e.buttons&&e.buttons.length){const i=this.addButtons(e.buttons);t.appendChild(i)}return t}addButtons(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.createEl("div","buttonsContainer");let i=!1;return e.forEach(((e,o)=>{const n=this.createEl("button","button-".concat(o),"button");n.innerText=e.text,o>0&&(n.style.cssText+="margin-left: 2px;"),"copy"===e.action&&(i=!0),t.appendChild(n)})),i&&this.addSnackbar(t),t}addSnackbar(e){this.snackBar=this.createEl("div","snackbar-".concat(this.campaignId),"snackbar"),this.snackBar.innerHTML=Ht;const t=this.createEl("span","snackbar-msg-".concat(this.campaignId),"snackbar-msg");t.innerText="Copied to clipboard",this.snackBar.appendChild(t),e.appendChild(this.snackBar)}addImage(e,t){const i=this.createEl("div","".concat(t,"Container")),o=this.createEl("img",t);return o.setAttribute("src",e),o.setAttribute("loading","lazy"),i.appendChild(o),i}raiseClickedEvent(e,t){switch(this.message.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":this.raiseClickedForBasicTemplates(e,t)}}raiseClickedForBasicTemplates(e,t){const i=this.message.msg[0],o={msgId:this.campaignId,pivotId:this.pivotId};if("BUTTON"===e.tagName){const t=e.id.split("-")[1],n=i.buttons[t];o.kv={wzrk_c2a:n.text},"url"===n.action?n.openUrlInNewTab?window.open(n.url,"_blank"):window.location=n.url:"copy"===n.action&&(window.focus(),navigator.clipboard.writeText(n.clipboardText),this.snackBar.style.setProperty("display","flex","important"),setTimeout((()=>{this.snackBar.style.setProperty("display","none","important")}),2e3))}else"CT-INBOX-MESSAGE"===e.tagName&&i.onClickUrl&&(i.openUrlInNewTab?window.open(i.onClickUrl,"_blank"):window.location=i.onClickUrl);t?console.log("Notifiction clicked event will be raised at run time with payload ::",o):window.clevertap.renderNotificationClicked(o)}}class jt extends HTMLElement{constructor(e){super(),this.isInboxOpen=!1,this.isInboxFromFlutter=!1,this.selectedCategory=null,this.unviewedMessages={},this.unviewedCounter=0,this.isPreview=!1,this.inboxConfigForPreview={},this.inboxSelector=null,this.inbox=null,this.emptyInboxMsg=null,this.inboxCard=null,this.unviewedBadge=null,this.observer=null,this.selectedCategoryRef=null,this.addClickListenerOnDocument=(()=>e=>{if(e.composedPath().includes(this.inbox)){const t=e.path||e.composedPath&&e.composedPath();if(t.length){const e=t[0].id;if("closeInbox"===e)this.toggleInbox();else if(e.startsWith("category-"))this.prevCategoryRef=this.selectedCategoryRef,this.selectedCategoryRef=t[0],this.updateActiveCategory(t[0].innerText);else{const e=t.filter((e=>{var t;return(null===(t=e.id)||void 0===t?void 0:t.startsWith("button-"))||"CT-INBOX-MESSAGE"===e.tagName}));if(e.length){e[e.length-1].raiseClickedEvent(e[0],this.isPreview)}}}}else(this.inboxSelector.contains(e.target)||this.isInboxOpen)&&(this.isInboxFromFlutter?this.isInboxFromFlutter=!1:this.toggleInbox(e))})(),this.setBadgeStyle=e=>{null!==this.unviewedBadge&&(this.unviewedBadge.innerText=e>9?"9+":e,this.unviewedBadge.style.display=e>0?"flex":"none")},this.logger=e,this.shadow=this.attachShadow({mode:"open"})}get incomingMessages(){return[]}set incomingMessages(e){void 0===e&&(e=[]),e.length>0&&this.inbox&&this.updateInboxMessages(e)}get incomingMessagesForPreview(){return[]}set incomingMessagesForPreview(e){void 0===e&&(e=[]);const t={};e.length>0&&this.inbox&&(this.isPreview=!0,this.unviewedCounter=0,e.forEach((e=>{const i="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=i,t[i]=e,this.unviewedMessages[i]=e,this.unviewedCounter++})),this.buildUIForMessages(t),this.updateUnviewedBadgeCounter())}connectedCallback(){this.init()}init(){this.config=this.isPreview?this.inboxConfigForPreview:ae.readFromLSorCookie(q)||{},0!==Object.keys(this.config).length&&(this.inboxSelector=document.getElementById(this.config.inboxSelector),null!==this.inboxSelector&&(this.config.styles.notificationsBadge?this.addUnviewedBadge():this.unviewedBadge&&this.unviewedBadge.remove(),this.createinbox(),document.removeEventListener("click",this.addClickListenerOnDocument),document.addEventListener("click",this.addClickListenerOnDocument),this.config.categories.length&&this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadow.innerHTML=this.getInboxStyles(),this.shadow.appendChild(this.inbox)))}addMsgsToInboxFromLS(){const e=this.deleteExpiredAndGetUnexpiredMsgs(!1),t=e?Object.keys(e):[];0!==t.length&&(t.forEach((t=>{e[t].viewed||(this.unviewedMessages[t]=e[t],this.unviewedCounter++)})),this.buildUIForMessages(e),this.updateUnviewedBadgeCounter())}deleteExpiredAndGetUnexpiredMsgs(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Nt();const i=Math.floor(Date.now()/1e3);for(const o in t)if(t[o].wzrk_ttl&&t[o].wzrk_ttl>0&&t[o].wzrk_ttl0&&(t=Object.values(t).sort(((e,t)=>t.date-e.date)).reduce(((e,t)=>(e[t.id]=t,e)),{})),Ft(t),t}updateInboxMessages(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.deleteExpiredAndGetUnexpiredMsgs(),i=Date.now(),o={};e.forEach(((e,n)=>{const s="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=s,e.date=i-n,e.viewed=0,t[s]=e,o[s]=e,this.unviewedMessages[s]=e,this.unviewedCounter++})),Ft(t),this.buildUIForMessages(o),this.updateUnviewedBadgeCounter()}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}addUnviewedBadge(){this.unviewedBadge||(this.unviewedBadge=this.createEl("div","unviewedBadge"),this.unviewedBadge.style.cssText="display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ".concat(this.config.styles.notificationsBadge.backgroundColor,"; font-size: 12px; color: ").concat(this.config.styles.notificationsBadge.textColor,"; font-weight: bold; align-items: center; justify-content: center;"),document.body.appendChild(this.unviewedBadge)),this.updateUnviewedBadgePosition(),window.addEventListener("resize",(()=>{this.updateUnviewedBadgePosition()}))}updateUnviewedBadgePosition(){const{top:e,right:t}=this.inboxSelector.getBoundingClientRect();this.unviewedBadge.style.top="".concat(e-8,"px"),this.unviewedBadge.style.left="".concat(t-8,"px")}createinbox(){this.inbox=this.createEl("div","inbox");const e=this.createEl("div","header"),t=this.createEl("div","headerTitle");t.innerText=this.config.title;const i=this.createEl("div","closeInbox");if(i.innerHTML="×",e.appendChild(t),e.appendChild(i),this.inbox.appendChild(e),this.config.categories.length){const e=this.createCategories();this.inbox.appendChild(e)}this.inboxCard=this.createEl("div","inboxCard"),this.inbox.appendChild(this.inboxCard),this.emptyInboxMsg=this.createEl("div","emptyInboxMsg"),this.emptyInboxMsg.innerText="All messages will be displayed here.",this.inboxCard.appendChild(this.emptyInboxMsg);const o={root:this.inboxCard,rootMargin:"0px",threshold:.5};this.observer=new IntersectionObserver(((e,t)=>{this.handleMessageViewed(e)}),o),this.addMsgsToInboxFromLS()}createCategories(){const e=this.createEl("div","categoriesContainer"),t=this.createEl("div","leftArrow");t.innerHTML=Gt,t.children[0].style="transform: rotate(180deg)",t.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(-70,0)})),e.appendChild(t);const i=this.createEl("div","categoriesWrapper");["All",...this.config.categories].forEach(((e,t)=>{const o=this.createEl("div","category-".concat(t),"category");o.innerText=e,0===t&&(this.selectedCategoryRef=o),i.appendChild(o)})),e.appendChild(i);const o=this.createEl("div","rightArrow");o.innerHTML=Gt,o.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(70,0)})),e.appendChild(o);const n={root:e,threshold:.9},s=i.children[0],r=i.children[this.config.categories.length];new IntersectionObserver((e=>{this.categoryObserverCb(t,e[0].intersectionRatio>=.9)}),n).observe(s);return new IntersectionObserver((e=>{this.categoryObserverCb(o,e[0].intersectionRatio>=.9)}),n).observe(r),e}categoryObserverCb(e,t){e&&(e.style.display=t?"none":"flex")}updateActiveCategory(e){this.selectedCategory=e,this.inboxCard.scrollTop=0;let t=0;this.prevCategoryRef&&this.prevCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef.setAttribute("selected","true"),this.inboxCard.childNodes.forEach((e=>{"emptyInboxMsg"!==e.getAttribute("id")&&(e.style.display="All"===this.selectedCategory||e.getAttribute("category")===this.selectedCategory?"block":"none","block"===e.style.display&&t++)})),0===t?(this.emptyInboxMsg.innerText="".concat(e," messages will be displayed here."),this.emptyInboxMsg.style.display="block"):this.emptyInboxMsg.style.display="none"}buildUIForMessages(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!this.isPreview&&this.updateTSForRenderedMsgs(),this.inboxCard.scrollTop=0;const i=null!==(e=this.config.maxMsgsInInbox)&&void 0!==e?e:15,o=this.inboxCard.firstChild,n=Object.values(t).sort(((e,t)=>t.date-e.date)).map((e=>e.id));for(const e of n){const i=new Rt(this.config,t[e]);i.setAttribute("id",t[e].id),i.setAttribute("pivot",t[e].wzrk_pivot),i.setAttribute("part","ct-inbox-message"),this.config.categories.length>0?(i.setAttribute("category",t[e].tags[0]||""),i.style.display="All"===this.selectedCategory||t[e].category===this.selectedCategory?"block":"none"):i.style.display="block",this.inboxCard.insertBefore(i,o),this.observer.observe(i)}let s=this.inboxCard.querySelectorAll("ct-inbox-message").length;for(;s>i;){const e=this.inboxCard.querySelectorAll("ct-inbox-message");e.length>0&&e[e.length-1].remove(),s--}const r=this.inboxCard.querySelectorAll('ct-inbox-message[style*="display: block"]').length;this.emptyInboxMsg.style.display=r?"none":"block"}handleMessageViewed(e){const t=!this.isPreview;this.isInboxOpen&&e.forEach((e=>{e.isIntersecting&&this.unviewedMessages.hasOwnProperty(e.target.id)&&0===e.target.message.viewed&&(e.target.message.viewed=1,t?(window.clevertap.renderNotificationViewed({msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.updateMessageInLS(e.target.id,{...e.target.message,viewed:1}),setTimeout((()=>{e.target.shadowRoot.getElementById("unreadMarker").style.display="none"}),1e3)):console.log("Notifiction viewed event will be raised at run time with payload ::",{msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.unviewedCounter--,this.updateUnviewedBadgeCounter(),delete this.unviewedMessages[e.target.id])}))}updateMessageInLS(e,t){if(!this.isPreview){const i=Nt();i[e]=t,Ft(i)}}toggleInbox(e){this.isInboxOpen=!this.isInboxOpen,this.isInboxFromFlutter=!!(null==e?void 0:e.rect),this.isInboxOpen?(this.inboxCard.scrollTop=0,!this.isPreview&&this.deleteExpiredAndGetUnexpiredMsgs(),this.inbox.style.display="block",this.inbox.style.zIndex="2147483647",this.config.categories.length&&(this.selectedCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef=this.shadowRoot.getElementById("category-0"),this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadowRoot.getElementById("categoriesWrapper").scrollLeft-=this.shadowRoot.getElementById("categoriesWrapper").scrollWidth),this.setInboxPosition(e)):this.inbox.style.display="none"}setInboxPosition(e){const t=window.outerWidth,i=getComputedStyle(le.inbox),o=i.getPropertyValue("--inbox-top"),n=i.getPropertyValue("--inbox-bottom"),s=i.getPropertyValue("--inbox-left"),r=i.getPropertyValue("--inbox-right");if(t>481&&!(o||n||s||r)){const t=Vt(e,this.inbox.clientHeight,this.inbox.clientWidth),i=t.xPos,o=t.yPos;this.inbox.style.top=o+"px",this.inbox.style.left=i+"px"}}updateUnviewedBadgeCounter(){if(this.isPreview)return void this.setBadgeStyle(this.unviewedCounter);let e=0;this.inboxCard.querySelectorAll("ct-inbox-message").forEach((t=>{const i=Nt();i[t.id]&&0===i[t.id].viewed&&e++})),this.setBadgeStyle(e)}updateTSForRenderedMsgs(){this.inboxCard.querySelectorAll("ct-inbox-message").forEach((e=>{const t=e.id.split("_")[1];e.shadow.getElementById("timeStamp").firstChild.innerText=Wt(t)}))}getInboxStyles(){const e=this.config.categories.length?64:16,t={panelBackgroundColor:this.config.styles.panelBackgroundColor,panelBorderColor:this.config.styles.panelBorderColor,headerBackgroundColor:this.config.styles.header.backgroundColor,headerTitleColor:this.config.styles.header.titleColor,closeIconColor:this.config.styles.closeIconColor,categoriesTabColor:this.config.styles.categories.tabColor,categoriesTitleColor:this.config.styles.categories.titleColor,selectedCategoryTabColor:this.config.styles.categories.selectedTab.tabColor,selectedCategoryTitleColor:this.config.styles.categories.selectedTab.titleColor,headerCategoryHeight:36+e};this.config.styles.categories.borderColor&&(t.categoriesBorderColor=this.config.styles.categories.borderColor),this.config.styles.categories.selectedTab.borderColor&&(t.selectedCategoryBorderColor=this.config.styles.categories.selectedTab.borderColor);const i=(e=>{let{panelBackgroundColor:t,panelBorderColor:i,headerBackgroundColor:o,headerTitleColor:n,closeIconColor:s,categoriesTabColor:r,categoriesTitleColor:a,categoriesBorderColor:l,selectedCategoryTabColor:c,selectedCategoryTitleColor:d,selectedCategoryBorderColor:h,headerCategoryHeight:u}=e;return'\n \n ")})(t),o=this.config.styles.cards;return i+(e=>{let{backgroundColor:t,borderColor:i,titleColor:o,descriptionColor:n,buttonColor:s,buttonTextColor:r,unreadMarkerColor:a}=e;return'\n \n ")})({backgroundColor:o.backgroundColor,borderColor:o.borderColor,titleColor:o.titleColor,descriptionColor:o.descriptionColor,buttonColor:o.buttonColor,buttonTextColor:o.buttonTextColor,unreadMarkerColor:o.unreadMarkerColor})}}const Dt=e=>{e.inbox_preview?le.inbox.incomingMessagesForPreview=e.inbox_notifs:le.inbox.incomingMessages=e},zt=e=>{qt(),le.inbox=new jt({logger:e}),document.body.appendChild(le.inbox)},Bt=e=>{const t=ae.readFromLSorCookie(V)||{};if(Object.keys(t).length>0&&Object.keys(t)[0].includes("_")){const i={};return i[e]=t,ae.saveToLSorCookie(V,i),i}return t},Nt=()=>{const e=JSON.parse(decodeURIComponent(ae.read(b)));if(!X(e))return{};const t=Bt(e);return t.hasOwnProperty(e)?t[e]:{}},Ft=e=>{const t=JSON.parse(decodeURIComponent(ae.read(b)));if(!X(t))return;const i={...Bt(t),[t]:e};ae.saveToLSorCookie(V,i)},Ut=e=>new Promise(((t,i)=>{if("complete"===document.readyState)zt(e),t();else{const i=ae.readFromLSorCookie(q)||{},o=()=>{null===le.inbox&&zt(e),t()};window.addEventListener("load",(()=>{if(document.getElementById(i.inboxSelector))o();else{let n=0;if(n<20){const s=setInterval((()=>{document.getElementById(i.inboxSelector)?(o(),clearInterval(s),t()):n>=20&&(clearInterval(s),e.debug("Failed to add inbox")),n++}),500)}}}))}})),qt=()=>{void 0===customElements.get("ct-web-inbox")&&(customElements.define("ct-web-inbox",jt),customElements.define("ct-inbox-message",Rt))},Vt=(e,t,i)=>{const o=document.scrollingElement.scrollLeft,n=document.scrollingElement.scrollTop,s=window.innerWidth+o,r=window.innerHeight+n,a=e.rect||e.target.getBoundingClientRect(),l=a.x+o,c=a.y+n,d=a.left+o,h=a.right+o,u=a.top+n,p=a.bottom,g=a.height,f=a.width;let v,b,m=!1;const y=16;if(p+t<=r){const e=r-(p+t);b=e>=y?p+y:p+e}else if(u-t>=n){const e=u-t;b=e>=y?u-t-y:u-t-e}else m=!0,b=c+g/2-t/2,br&&(b=r-t);if(m){const e=h+i;if(e<=s){v=h+(e+y<=s?y:s-e)}else{const e=d-i;v=e-(e-y>=o?y:e-o)}}else v=l+f/2-i/2,vs&&(v=h-i>=o?h-i:s-i);return{xPos:v,yPos:b}},Wt=e=>{const t=Date.now();let i=Math.floor((t-e)/6e4);return i<5?"Just now":i<60?"".concat(i," minute").concat(i>1?"s":""," ago"):(i=Math.floor(i/60),i<24?"".concat(i," hour").concat(i>1?"s":""," ago"):(i=Math.floor(i/24),"".concat(i," day").concat(i>1?"s":""," ago")))},Kt=()=>Object.keys(ae.readFromLSorCookie(q)||{}).length>0,Gt='\n\n\n',Ht='\n\n\n',Jt=(e,t)=>{document.addEventListener("DOMContentLoaded",(()=>function(e,t){document.body.innerHTML="",Zt=document.createElement("div"),Zt.id="overlayDiv",Zt.style.position="relative",Zt.style.display="flex",document.body.appendChild(Zt);(function(e,t,i){return new Promise(((o,n)=>{var s=document.createElement("script");s.type="module",s.src=e,s.onload=function(){"function"==typeof window.Overlay?(window.Overlay("#overlayDiv",t,i),o()):n(new Error("ContentLayout not found in overlay.js"))},s.onerror=function(e){n(e)},document.head.appendChild(s)}))})("https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js",e,t).then((()=>{console.log("Overlay script loaded successfully.")})).catch((e=>{console.error("Error loading overlay script:",e)})),d=document.createElement("link"),d.rel="stylesheet",d.type="text/css",d.href="https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css",document.head.appendChild(d),o={kitId:"eqj6nom",scriptTimeout:3e3,async:!0},n=document,s=n.documentElement,r=setTimeout((function(){s.className=s.className.replace(/\bwf-loading\b/g,"")+" wf-inactive"}),o.scriptTimeout),a=n.createElement("script"),l=!1,c=n.getElementsByTagName("script")[0],s.className+=" wf-loading",a.src="https://use.typekit.net/"+o.kitId+".js",a.async=!0,a.onload=a.onreadystatechange=function(){if(i=this.readyState,!(l||i&&"complete"!==i&&"loaded"!==i)){l=!0,clearTimeout(r);try{Typekit.load(o)}catch(e){}}},c.parentNode.insertBefore(a,c);var i,o,n,s,r,a,l,c;var d}(e,t)))};let Zt;const $t=(e,t)=>{const i=t?e[0]:e.display.details[0],o=Object.keys(i)[0],n=i[o];if(o===window.location.href)for(const i in n){const o=document.querySelector(i);if(o)n[i].html&&(o.outerHTML=n[i].html),t||window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot});else{let o=0;const s=setInterval((()=>{const r=document.querySelector(i);r?(n[i].html&&(r.outerHTML=n[i].html),t||window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot}),clearInterval(s)):(o++,o>=20&&(console.log("No element present on DOM with selector '".concat(i,"'.")),clearInterval(s)))}),500)}}},Yt=(e,t)=>{let{device:i,session:o,request:n,logger:s}=t;const r=i,a=o,l=n,c=s;let d=0;const h=t=>{const i=t.wzrk_id.split("_")[0],o=ie(),n=(e,t,i)=>{let o=0,n=0;null!=e[t]&&(o=e[t]),o++,null!=e.tc&&(n=e.tc),i<0&&n++,e.tc=n,e[t]=o};if(ae._isLocalStorageSupported()){delete sessionStorage.WZRK_CAMP;var s={};const e=Xe();s=3===t.display.wtarget_type&&e.hasOwnProperty("wi")?e.wi:0!==t.display.wtarget_type&&1!==t.display.wtarget_type||!e.hasOwnProperty("wp")?{}:e.wp,e.hasOwnProperty("global")&&(s.wp=e),null==t.display.wmc&&(t.display.wmc=1),null==t.display.wimc&&(t.display.wimc=1);var d=-1;let n=-1,r=-1,l=-1,c=-1,g=-1,f=-1;null!=t.display.efc&&(d=parseInt(t.display.efc,10)),null!=t.display.mdc&&(n=parseInt(t.display.mdc,10)),null!=t.display.tdc&&(r=parseInt(t.display.tdc,10)),null!=t.display.tlc&&(l=parseInt(t.display.tlc,10)),null!=t.display.wmp&&(c=parseInt(t.display.wmp,10)),null!=t.display.wmc&&(g=parseInt(t.display.wmc,10)),null!=t.display.wimc&&(f=parseInt(t.display.wimc,10));var h=s[a.sessionId];if(h){const e=h[i],o=h.tc;if("dnd"===e&&!le.dismissSpamControl)return!1;if(3===t.display.wtarget_type){if(f>0&&o>=f&&d<0)return!1}else if(g>0&&o>=g&&d<0)return!1;if(n>0&&e>=n)return!1}else h={},s[a.sessionId]=h;var u=s[o];if(null!=u){const e=u[i],t=u.tc;if(c>0&&t>=c&&d<0)return!1;if(r>0&&e>=r)return!1}else u={},s[o]=u;var p=s.global;if(null!=p){const e=p[i];if(l>0&&e>=l)return!1}else p={},s.global=p}if(null!=t.display.delay&&t.display.delay>0){const i=t.display.delay;return t.display.delay=0,setTimeout(Yt,1e3*i,e,{device:r,session:a,request:l,logger:c}),!1}n(h,i,d),n(u,i,d),n(p,i,d);let g="wp";3===t.display.wtarget_type&&(g="wi");const f={};f[a.sessionId]=h,f[o]=u,f.global=p,et({[g]:f})},u=()=>{const e=r.getGuid(),t=a.getSessionCookieObject();return"&t=wc&d="+encodeURIComponent(He(e+"|"+t.p+"|"+t.s))},p=(e,t)=>{const i=window.parent[e];"function"==typeof i&&(null!=t.display.kv?i(t.display.kv):i())},g=(e,t,i,o,n)=>{f(t),((e,t,i,o,n)=>{if(""!==e&&null!=e){let o,s;n?o=i:null!==i&&(s=i.getElementsByClassName("jsCT_CTA"),null!=s&&1===s.length&&(o=s[0]));const r=t.display.jsFunc,l=t.display.preview;null==l&&(e+=u()),null!=o&&(o.onclick=()=>{if(null!=r)return null==l&&Qe.fireRequest(e),p(r,t),void at("-1",0,a.sessionId);1===t.display.window?window.open(e,"_blank"):window.location=e})}})(e,t,i,0,n)},f=e=>{const t={type:"event"};t.evtName=R,t.evtData={[T]:e.wzrk_id},e.wzrk_pivot&&(t.evtData={...t.evtData,wzrk_pivot:e.wzrk_pivot}),l.processEvent(t)},v=e=>{var t;void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Lt);const i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,o=document.createElement("ct-web-personalisation-banner");o.msgId=e.wzrk_id,o.pivotId=e.wzrk_pivot,o.divHeight=e.display.divHeight,o.details=e.display.details[0];const n=e.display.divId?document.getElementById(i):document.querySelector(i);n.innerHTML="",n.appendChild(o)},m=e=>{var t;void 0===customElements.get("ct-web-personalisation-carousel")&&customElements.define("ct-web-personalisation-carousel",Mt);const i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,o=document.createElement("ct-web-personalisation-carousel");o.target=e;const n=e.display.divId?document.getElementById(i):document.querySelector(i);n.innerHTML="",n.appendChild(o)},y=e=>{const t=e.wzrk_id.split("_")[0],i=e.display;if(2===i.wtarget_type&&1===e.msgContent.type){const t={};t.msgId=e.wzrk_id,e.wzrk_pivot&&(t.pivotId=e.wzrk_pivot),null!=e.msgContent.kv&&(t.kv=e.msgContent.kv);const i=new CustomEvent("CT_web_native_display",{detail:t});return void document.dispatchEvent(i)}if(1===i.layout)return O(void 0,e);if(3===i.layout){const t="wzrkImageOnlyDiv";if(!1===h(e))return;if(le.dismissSpamControl&&null!=document.getElementById(t)){document.getElementById(t).remove()}if(null!=document.getElementById(t)||null!=document.getElementById("intentPreview"))return;const i=document.createElement("div");return i.id=t,document.body.appendChild(i),void 0===customElements.get("ct-web-popup-imageonly")&&customElements.define("ct-web-popup-imageonly",Tt),(e=>{const t=document.createElement("ct-web-popup-imageonly");t.session=a,t.target=e;const i=document.getElementById("wzrkImageOnlyDiv");i.innerHTML="",i.style.visibility="hidden",i.appendChild(t)})(e)}if(!1===h(e))return;const o="wizParDiv"+i.layout;if(le.dismissSpamControl&&null!=document.getElementById(o)){document.getElementById(o).remove()}if(null!=document.getElementById(o))return;le.campaignDivMap[t]=o;const n=2===i.layout,s=document.createElement("div");s.id=o;const r=window.innerHeight,l=window.innerWidth;let c=!1;if(n)s.setAttribute("style",i.iFrameStyle);else{var d=10;let e=5*l/100,t=d+5*r/100,o=30*l/100+20,n="width:30%;";(/mobile/i.test(navigator.userAgent)||/mini/i.test(navigator.userAgent))&&!1===/iPad/i.test(navigator.userAgent)?(o=85*l/100+20,e=5*l/100,t=5*r/100,n="width:80%;"):("ontouchstart"in window||/tablet/i.test(navigator.userAgent))&&(o=50*l/100+20,e=5*l/100,t=5*r/100,n="width:50%;"),null==i.proto?(c=!0,s.setAttribute("style","display:block;overflow:hidden; bottom:"+t+"px !important;width:"+o+"px !important;right:"+e+"px !important;position:fixed;z-index:2147483647;")):s.setAttribute("style",n+i.iFrameStyle)}document.body.appendChild(s);const u=document.createElement("iframe"),p=!1===i.br?"0":"8";u.frameborder="0px",u.marginheight="0px",u.marginwidth="0px",u.scrolling="no",u.id="wiz-iframe";const f=e.display.onClick;let v,b="";if(""!==f&&null!=f&&(b="cursor:pointer;"),1===e.msgContent.type)v=e.msgContent.html,v=v.replace(/##campaignId##/g,t),v=v.replace(/##campaignId_batchId##/g,e.wzrk_id);else{const i='";let n,s,r,a,l;"dark"===e.display.theme?(n="#2d2d2e",s="#eaeaea",r="#353535",a="#353535",l="#ffffff"):(n="#ffffff",s="#000000",a="#f4f4f4",r="#a5a6a6",l="#ffffff");const c=e.msgContent.title,d=e.msgContent.description;let h="";null!=e.msgContent.imageUrl&&""!==e.msgContent.imageUrl&&(h="");v=i+("
×
"+h+"
"+c+"
")+("
"+d+"
")}u.setAttribute("style","z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;"),s.appendChild(u);const m=(u.contentWindow?u.contentWindow:u.contentDocument.document?u.contentDocument.document:u.contentDocument).document,y=new Event("CT_campaign_rendered");document.dispatchEvent(y),m.open(),m.write(v),i["custom-editor"]&&k(e,m),m.close();const w=()=>{d=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv").scrollHeight,!0===i["custom-editor"]||n||(d+=25),document.getElementById("wiz-iframe").contentDocument.body.style.margin="0px",document.getElementById("wiz-iframe").style.height=d+"px"},C=navigator.userAgent.toLowerCase();if(-1!==C.indexOf("safari"))if(C.indexOf("chrome")>-1)u.onload=()=>{w();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)};else{let t=u.contentDocument||u.contentWindow;t.document&&(t=t.document),w();const i=setInterval((()=>{if("complete"===t.readyState){clearInterval(i),w();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)}}),10)}else u.onload=()=>{w();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)}},k=(e,t)=>{const i=t.createElement("script");i.innerHTML="\n const ct__camapignId = '".concat(e.wzrk_id,"';\n const ct__formatVal = (v) => {\n return v && v.trim().substring(0, 20);\n }\n const ct__parentOrigin = window.parent.origin;\n document.body.addEventListener('click', (event) => {\n const elem = event.target.closest?.('a[wzrk_c2a], button[wzrk_c2a]');\n if (elem) {\n const {innerText, id, name, value, href} = elem;\n const clickAttr = elem.getAttribute('onclick') || elem.getAttribute('click');\n const onclickURL = clickAttr?.match(/(window.open)[(](\"|')(.*)(\"|',)/)?.[3] || clickAttr?.match(/(location.href *= *)(\"|')(.*)(\"|')/)?.[3];\n const props = {innerText, id, name, value};\n let msgCTkv = Object.keys(props).reduce((acc, c) => {\n const formattedVal = ct__formatVal(props[c]);\n formattedVal && (acc['wzrk_click_' + c] = formattedVal);\n return acc;\n }, {});\n if(onclickURL) { msgCTkv['wzrk_click_' + 'url'] = onclickURL; }\n if(href) { msgCTkv['wzrk_click_' + 'c2a'] = href; }\n const notifData = { msgId: ct__camapignId, msgCTkv, pivotId: '").concat(e.wzrk_pivot,"' };\n window.parent.clevertap.renderNotificationClicked(notifData);\n }\n });\n "),t.body.appendChild(i)};let x=!1;const S=e=>{let t=e.display.onClick;if(window.clevertap.hasOwnProperty("notificationCallback")&&void 0!==window.clevertap.notificationCallback&&"function"==typeof window.clevertap.notificationCallback){const i=window.clevertap.notificationCallback;if(!x){const o={};o.msgContent=e.msgContent,o.msgId=e.wzrk_id,e.wzrk_pivot&&(o.pivotId=e.wzrk_pivot),null!=e.display.kv&&(o.kv=e.display.kv),window.clevertap.raiseNotificationClicked=()=>{if(""!==t&&null!=t){const i=e.display.jsFunc;if(t+=u(),null!=i)return Qe.fireRequest(t),void p(i,e);1===e.display.window?window.open(t,"_blank"):window.location=t}},window.clevertap.raiseNotificationViewed=()=>{f(e)},i(o),x=!0}}else if(window.clevertap.popupCurrentWzrkId=e.wzrk_id,y(e),window.clevertap.hasOwnProperty("popupCallbacks")&&void 0!==window.clevertap.popupCallbacks&&"function"==typeof window.clevertap.popupCallbacks[e.wzrk_id]){const t=window.clevertap.popupCallbacks[e.wzrk_id],n={};n.msgContent=e.msgContent,n.msgId=e.wzrk_id,e.wzrk_pivot&&(n.pivotId=e.wzrk_pivot);var i=[];for(var o in e)if(o.startsWith(M)&&o!==T){const t={[o]:e[o]};i.push(t)}i.length>0&&(n.msgCTkv=i),null!=e.display.kv&&(n.kv=e.display.kv),window.clevertap.raisePopupNotificationClicked=t=>{if(!t||!t.msgId)return;const i={type:"event"};if(i.evtName=j,i.evtData={[T]:t.msgId},e.wzrk_pivot&&(i.evtData={...i.evtData,wzrk_pivot:t.pivotId}),t.msgCTkv)for(var o of t.msgCTkv)i.evtData={...i.evtData,...o};l.processEvent(i)},t(n)}};let I;const O=(e,t)=>{let i;if(null!=e&&e.clientY>0)return;if(i=null==t?I:t,le.dismissSpamControl&&0===i.display.wtarget_type&&null!=document.getElementById("intentPreview")&&null!=document.getElementById("intentOpacityDiv")){document.getElementById("intentPreview").remove(),document.getElementById("intentOpacityDiv").remove()}if(null!=document.getElementById("intentPreview")||null!=document.getElementById("wzrkImageOnlyDiv"))return;if(null==i.display.layout&&(/mobile/i.test(navigator.userAgent)||/mini/i.test(navigator.userAgent)||/iPad/i.test(navigator.userAgent)||"ontouchstart"in window||/tablet/i.test(navigator.userAgent)))return;if(!1===h(i))return;const o=i.wzrk_id.split("_")[0];le.campaignDivMap[o]="intentPreview";let n=!1;const s=document.createElement("div");s.id="intentOpacityDiv";const r=i.display.opacity||.7,a="rgba(0,0,0,".concat(r,")");s.setAttribute("style","position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ".concat(a,";")),document.body.appendChild(s);const l=document.createElement("div");l.id="intentPreview",null==i.display.proto?(n=!0,l.setAttribute("style","display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;")):l.setAttribute("style",i.display.iFrameStyle),document.body.appendChild(l);const c=document.createElement("iframe"),d=!1===i.display.br?"0":"8";c.frameborder="0px",c.marginheight="0px",c.marginwidth="0px",c.scrolling="no",c.id="wiz-iframe-intent";const u=i.display.onClick;let p,f="";if(""!==u&&null!=u&&(f="cursor:pointer;"),1===i.msgContent.type)p=i.msgContent.html,p=p.replace(/##campaignId##/g,o),p=p.replace(/##campaignId_batchId##/g,i.wzrk_id);else{const e='";let t,n,s,r;"dark"===i.display.theme?(t="#2d2d2e",n="#eaeaea",s="#353535",r="#ffffff"):(t="#ffffff",n="#000000",s="#a5a6a6",r="#ffffff");const a=i.msgContent.title,l=i.msgContent.description;let c="";null!=i.msgContent.ctaText&&""!==i.msgContent.ctaText&&(c="");let h="";null!=i.msgContent.imageUrl&&""!==i.msgContent.imageUrl&&(h="
+a+
");p=e+("
×
"+a+"
")+("
"+l+"
"+h+c+"
")}c.setAttribute("style","z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;"),l.appendChild(c);const v=(c.contentWindow?c.contentWindow:c.contentDocument.document?c.contentDocument.document:c.contentDocument).document,b=new Event("CT_campaign_rendered");document.dispatchEvent(b),v.open(),v.write(p),i.display["custom-editor"]&&k(i,v),v.close();const m=document.getElementById("wiz-iframe-intent").contentDocument.getElementById("contentDiv");g(u,i,m,0,n)};if(!document.body)return void(d<6&&(d++,setTimeout(Yt,1e3,e,{device:r,session:a,request:l,logger:c})));const _=e=>{Object.keys(e).map((t=>{var i,o;e[t].display.divId?(i=e[t].display.divId,o=document.getElementById(i)):(i=e[t].display.divSelector,o=document.querySelector(i)),null!==o&&(2===e[t].msgContent.type?v(e[t]):m(e[t]),delete e[t])}))};if(null!=e.inapp_notifs){const t={};for(let i=0;i{window.addEventListener("load",(()=>{let t=0;if(t<20){const i=setInterval((()=>{_(e),0!==Object.keys(e).length&&20!==t||(clearInterval(i),e={}),t++}),500)}}))})(t))}const E=()=>{if(e.inbox_preview)Dt(e);else if(e.inbox_notifs){const t=[];for(let i=0;i1&&void 0!==arguments[1]&&arguments[1];const i=ae.readFromLSorCookie(q)||{};t?(le.inbox.inboxConfigForPreview=e,le.inbox.isPreview=!0,le.inbox&&le.inbox.init()):JSON.stringify(i)!==JSON.stringify(e)&&(ae.saveToLSorCookie(q,e),le.inbox&&le.inbox.init())}(e.webInboxSetting),Ut(c).then((()=>{E()})).catch((e=>{}))):E()),e.vars)return void le.variableStore.mergeVariables(e.vars);const A=(e,t)=>{const i=Xe(),o=i[t].global;if(null!=o&&t)for(const i in e)if(e.hasOwnProperty(i)&&(delete o[e[i]],ae.read(w))){const o=JSON.parse(decodeURIComponent(ae.read(w))),n=JSON.parse(decodeURIComponent(ae.read(b)));o[n]&&o[n][t]&&o[n][t][e[i]]&&(delete o[n][t][e[i]],ae.save(w,encodeURIComponent(JSON.stringify(o))))}et(i)};if(ae._isLocalStorageSupported())try{if(null!=e.evpr){const t=e.evpr.events,i=e.evpr.profile,o=e.evpr.expires_in,n=oe();ae.setMetaProp("lsTime",n),ae.setMetaProp("exTs",o),(e=>{if(null!=le.globalEventsMap||(le.globalEventsMap=ae.readFromLSorCookie(C),null!=le.globalEventsMap)){for(const t in e)if(e.hasOwnProperty(t)){const i=le.globalEventsMap[t],o=e[t];null!=le.globalEventsMap[t]?null!=o[0]&&o[0]>i[0]&&(le.globalEventsMap[t]=o):le.globalEventsMap[t]=o}}else le.globalEventsMap=e})(t),ae.saveToLSorCookie(C,le.globalEventsMap),null==le.globalProfileMap?rt(i,!0):rt(i,!1)}null!=e.arp&&(e=>{if(null!=e.skipResARP&&e.skipResARP)return console.debug("Update ARP Request rejected",e),null;const t=!0===e.isOUL;if(ae._isLocalStorageSupported())try{let i=ae.readFromLSorCookie(P);if(null==i||t){i={};for(const t in e)e.hasOwnProperty(t)&&(-1===e[t]?delete i[t]:i[t]=e[t]);ae.saveToLSorCookie(P,i)}}catch(e){console.error("Unable to parse ARP JSON: "+e)}})(e.arp),null!=e.inapp_stale&&e.inapp_stale.length>0&&A(e.inapp_stale,"wp"),null!=e.inbox_stale&&e.inbox_stale.length>0&&A(e.inbox_stale,"wi")}catch(e){c.error("Unable to persist evrp/arp: "+e)}};var Qt=t("isPersonalisationActive");class Xt{constructor(e){let{isPersonalisationActive:t}=e;Object.defineProperty(this,Qt,{writable:!0,value:void 0}),i(this,Qt)[Qt]=t}getTotalVisits(){if(!i(this,Qt)[Qt]())return;let e=ae.getMetaProp("sc");return null==e&&(e=1),e}getLastVisit(){if(!i(this,Qt)[Qt]())return;const e=ae.getMetaProp("ps");return null!=e?new Date(1e3*e):void 0}}const ei=1,ti=2,ii=3,oi=4;var ni=t("logLevel"),si=t("log"),ri=t("isLegacyDebug");class ai{constructor(e){Object.defineProperty(this,ri,{get:ci,set:void 0}),Object.defineProperty(this,si,{value:li}),Object.defineProperty(this,ni,{writable:!0,value:void 0}),this.wzrkError={},i(this,ni)[ni]=null==e?e:ti,this.wzrkError={}}get logLevel(){return i(this,ni)[ni]}set logLevel(e){i(this,ni)[ni]=e}error(e){i(this,ni)[ni]>=ei&&i(this,si)[si]("error",e)}info(e){i(this,ni)[ni]>=ti&&i(this,si)[si]("log",e)}debug(e){(i(this,ni)[ni]>=ii||i(this,ri)[ri])&&i(this,si)[si]("debug",e)}debugPE(e){i(this,ni)[ni]>=oi&&i(this,si)[si]("debug_pe",e)}reportError(e,t){this.wzrkError.c=e,this.wzrkError.d=t,this.error("".concat(Ce," ").concat(e,": ").concat(t))}}var li=function(e,t){if(window.console)try{const i=(new Date).getTime();console[e]("CleverTap [".concat(i,"]: ").concat(t))}catch(e){}},ci=function(){return"undefined"!=typeof sessionStorage&&""===sessionStorage.WZRK_D},di=t("logger"),hi=t("sessionId"),ui=t("isPersonalisationActive");class pi{constructor(e){let{logger:t,isPersonalisationActive:o}=e;Object.defineProperty(this,di,{writable:!0,value:void 0}),Object.defineProperty(this,hi,{writable:!0,value:void 0}),Object.defineProperty(this,ui,{writable:!0,value:void 0}),this.cookieName=void 0,this.scookieObj=void 0,this.sessionId=ae.getMetaProp("cs"),i(this,di)[di]=t,i(this,ui)[ui]=o}get sessionId(){return i(this,hi)[hi]}set sessionId(e){i(this,hi)[hi]=e}getSessionCookieObject(){let e=ae.readCookie(this.cookieName),t={};if(null!=e)if(e=e.replace(p,'"'),t=JSON.parse(e),J(t)){if(void 0!==t.t){const e=t.t;oe()-e>1260&&(t={})}}else t={};return this.scookieObj=t,t}setSessionCookieObject(e){const t=JSON.stringify(e);ae.createBroadCookie(this.cookieName,t,1200,We())}manageSession(e){if(void 0===this.sessionId||this.sessionId!==e){const t=ae.getMetaProp("cs");if(void 0===t)ae.setMetaProp("ps",e),ae.setMetaProp("cs",e),ae.setMetaProp("sc",1);else if(t!==e){ae.setMetaProp("ps",t),ae.setMetaProp("cs",e);let i=ae.getMetaProp("sc");void 0===i&&(i=0),ae.setMetaProp("sc",i+1)}this.sessionId=e}}getTimeElapsed(){if(!i(this,ui)[ui]())return;null!=this.scookieObj&&(this.scookieObj=this.getSessionCookieObject());const e=this.scookieObj.s;if(null!=e){const t=oe();return Math.floor(t-e)}}getPageCount(){if(i(this,ui)[ui]())return null!=this.scookieObj&&(this.scookieObj=this.getSessionCookieObject()),this.scookieObj.p}}let gi=0,fi=0;var vi=t("logger"),bi=t("account"),mi=t("device"),yi=t("session"),wi=t("isPersonalisationActive"),Ci=t("clearCookie"),ki=t("addToLocalEventMap");class xi{constructor(e){let{logger:t,account:o,device:n,session:s,isPersonalisationActive:r}=e;Object.defineProperty(this,ki,{value:Pi}),Object.defineProperty(this,vi,{writable:!0,value:void 0}),Object.defineProperty(this,bi,{writable:!0,value:void 0}),Object.defineProperty(this,mi,{writable:!0,value:void 0}),Object.defineProperty(this,yi,{writable:!0,value:void 0}),Object.defineProperty(this,wi,{writable:!0,value:void 0}),Object.defineProperty(this,Ci,{writable:!0,value:!1}),this.processingBackup=!1,i(this,vi)[vi]=t,i(this,bi)[bi]=o,i(this,mi)[mi]=n,i(this,yi)[yi]=s,i(this,wi)[wi]=r,Qe.logger=t,Qe.device=n,Qe.account=o}processBackupEvents(){const e=ae.readFromLSorCookie(S);if(null!=e){this.processingBackup=!0;for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];void 0===o.fired&&(i(this,vi)[vi].debug("Processing backup event : "+o.q),void 0!==o.q&&Qe.fireRequest(o.q),o.fired=!0)}ae.saveToLSorCookie(S,e),this.processingBackup=!1}}addSystemDataToObject(e,t){void 0===t&&(e=ee(e,i(this,vi)[vi])),$(i(this,vi)[vi].wzrkError)||(e.wzrk_error=i(this,vi)[vi].wzrkError,i(this,vi)[vi].wzrkError={}),e.id=i(this,bi)[bi].id,X(i(this,mi)[mi].gcookie)&&(e.g=i(this,mi)[mi].gcookie);const o=i(this,yi)[yi].getSessionCookieObject();e.s=o.s,e.pg=void 0===o.p?1:o.p;let n=document.location.protocol;return n=n.replace(":",""),e.af={lib:"web-sdk-v1.7.3",protocol:n,...le.flutterVersion},sessionStorage.hasOwnProperty("WZRK_D")&&(e.debug=!0),e}addFlags(e){if(i(this,Ci)[Ci]=ae.getAndClearMetaProp(g),void 0!==i(this,Ci)[Ci]&&i(this,Ci)[Ci]&&(e.rc=!0,i(this,vi)[vi].debug("reset cookie sent in request and cleared from meta for future requests.")),i(this,wi)[wi]()){const t=ae.getMetaProp("lsTime"),i=ae.getMetaProp("exTs");if(void 0===t||void 0===i)return void(e.dsync=!0);t+i{if(e.ok)return e.json();throw e})).then((e=>(i(this,vi)[vi].debug("Sync data successful",e),e))).catch((e=>{throw i(this,vi)[vi].debug("Error in syncing variables",e),e}))}}var Pi=function(e){if(ae._isLocalStorageSupported()){void 0===le.globalEventsMap&&(le.globalEventsMap=ae.readFromLSorCookie(C),void 0===le.globalEventsMap&&(le.globalEventsMap={}));const t=oe();let i=le.globalEventsMap[e];void 0!==i?(i[2]=t,i[0]++):(i=[],i.push(1),i.push(t),i.push(t)),le.globalEventsMap[e]=i,ae.saveToLSorCookie(C,le.globalEventsMap)}},Si=t("request"),Ii=t("account"),Oi=t("oldValues"),_i=t("logger"),Ei=t("processPrivacyArray");class Ai extends Array{constructor(e,t){let{request:o,account:n,logger:s}=e;super(),Object.defineProperty(this,Ei,{value:Li}),Object.defineProperty(this,Si,{writable:!0,value:void 0}),Object.defineProperty(this,Ii,{writable:!0,value:void 0}),Object.defineProperty(this,Oi,{writable:!0,value:void 0}),Object.defineProperty(this,_i,{writable:!0,value:void 0}),i(this,_i)[_i]=s,i(this,Si)[Si]=o,i(this,Ii)[Ii]=n,i(this,Oi)[Oi]=t}push(){for(var e=arguments.length,t=new Array(e),o=0;o0?le.privacyArray:t):le.privacyArray.push(...t),0}_processOldValues(){i(this,Oi)[Oi]&&i(this,Ei)[Ei](i(this,Oi)[Oi]),i(this,Oi)[Oi]=null}}var Li=function(e){if(Array.isArray(e)&&e.length>0){const o=e.reduce(((e,t)=>({...e,...t})),{});let n={};const s={};var t=!1;if(o.hasOwnProperty(O)&&"boolean"==typeof(t=o.optOut)&&(s.ct_optout=t,le.isOptInRequest=!t),o.hasOwnProperty(_)){const e=o.useIP,t="boolean"==typeof e&&e;ae.setMetaProp(_,t)}if(!$(s)){n.type="profile",n.profile=s,n=i(this,Si)[Si].addSystemDataToObject(n,void 0);const o=Ke(JSON.stringify(n),i(this,_i)[_i]);let r=i(this,Ii)[Ii].dataPostURL;r=Ve(r,"type",A),r=Ve(r,"d",o),r=Ve(r,O,t?"true":"false"),i(this,Si)[Si].saveAndFireRequest(r,le.blockRequest),e.splice(0,e.length)}}},Mi=t("oldValues"),Ti=t("logger"),Ri=t("request"),ji=t("account"),Di=t("wizAlertJSPath"),zi=t("fcmPublicKey"),Bi=t("setUpWebPush"),Ni=t("setUpWebPushNotifications"),Fi=t("setApplicationServerKey"),Ui=t("setUpSafariNotifications"),qi=t("setUpChromeFirefoxNotifications"),Vi=t("addWizAlertJS"),Wi=t("removeWizAlertJS"),Ki=t("handleNotificationRegistration");class Gi extends Array{constructor(e,t){let{logger:o,session:n,request:s,account:r}=e;super(),Object.defineProperty(this,Ki,{value:eo}),Object.defineProperty(this,Wi,{value:Xi}),Object.defineProperty(this,Vi,{value:Qi}),Object.defineProperty(this,qi,{value:Yi}),Object.defineProperty(this,Ui,{value:$i}),Object.defineProperty(this,Fi,{value:Zi}),Object.defineProperty(this,Ni,{value:Ji}),Object.defineProperty(this,Bi,{value:Hi}),Object.defineProperty(this,Mi,{writable:!0,value:void 0}),Object.defineProperty(this,Ti,{writable:!0,value:void 0}),Object.defineProperty(this,Ri,{writable:!0,value:void 0}),Object.defineProperty(this,ji,{writable:!0,value:void 0}),Object.defineProperty(this,Di,{writable:!0,value:void 0}),Object.defineProperty(this,zi,{writable:!0,value:void 0}),i(this,Di)[Di]="https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js",i(this,zi)[zi]=null,i(this,Mi)[Mi]=t,i(this,Ti)[Ti]=o,i(this,Ri)[Ri]=s,i(this,ji)[ji]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o0?i(this,Ki)[Ki](e):null==le.webPushEnabled&&e.length>0?(le.notifApi.notifEnabledFromApi=!0,le.notifApi.displayArgs=e.slice()):!1===le.webPushEnabled&&e.length>0&&i(this,Ti)[Ti].error("Make sure push notifications are fully enabled and integrated")},Ji=function(e,t,o,n){-1!==navigator.userAgent.indexOf("Chrome")||-1!==navigator.userAgent.indexOf("Firefox")?i(this,qi)[qi](e,t):-1!==navigator.userAgent.indexOf("Safari")&&i(this,Ui)[Ui](e,o,n)},Zi=function(e){i(this,zi)[zi]=e},$i=function(e,t,o){void 0===t&&i(this,Ti)[Ti].error("Ensure that APNS Web Push ID is supplied"),void 0===o&&i(this,Ti)[Ti].error("Ensure that APNS Web Push service path is supplied"),"safari"in window&&"pushNotification"in window.safari&&window.safari.pushNotification.requestPermission(o,t,{},(e=>{if("granted"===e.permission){const t=JSON.parse(JSON.stringify(e));t.endpoint=e.deviceToken,t.browser="Safari",ae.saveToLSorCookie(z,t),i(this,Ri)[Ri].registerToken(t),i(this,Ti)[Ti].info("Safari Web Push registered. Device Token: "+e.deviceToken)}else"denied"===e.permission&&i(this,Ti)[Ti].info("Error subscribing to Safari web push")}))},Yi=function(e,t){let o="";"serviceWorker"in navigator&&navigator.serviceWorker.register(t).then((e=>{if("undefined"!=typeof __wzrk_account_id)return new Promise((t=>setTimeout((()=>t(e)),5e3)));o=e.scope;return/^(\.?)(\/?)([^/]*).js$/.test(t)?navigator.serviceWorker.ready:-1!==navigator.userAgent.indexOf("Chrome")?new Promise((t=>setTimeout((()=>t(e)),5e3))):navigator.serviceWorker.getRegistrations()})).then((t=>{-1!==navigator.userAgent.indexOf("Firefox")&&Array.isArray(t)&&(t=t.filter((e=>e.scope===o))[0]);const n={userVisibleOnly:!0};null!=i(this,zi)[zi]&&(n.applicationServerKey=(e=>{let t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),i=window.atob(t),o=[];for(let e=0;e{i(this,Ti)[Ti].info("Service Worker registered. Endpoint: "+t.endpoint);const o=JSON.parse(JSON.stringify(t));-1!==navigator.userAgent.indexOf("Chrome")?(o.endpoint=o.endpoint.split("/").pop(),o.browser="Chrome"):-1!==navigator.userAgent.indexOf("Firefox")&&(o.endpoint=o.endpoint.split("/").pop(),o.browser="Firefox"),ae.saveToLSorCookie(z,o),i(this,Ri)[Ri].registerToken(o),void 0!==e&&"function"==typeof e&&e()})).catch((e=>{i(this,Ti)[Ti].error("Error subscribing: "+e),t.pushManager.getSubscription().then((e=>{null!==e&&e.unsubscribe().then((e=>{i(this,Ti)[Ti].info("Unsubscription successful")})).catch((e=>{i(this,Ti)[Ti].error("Error unsubscribing: "+e)}))}))}))})).catch((e=>{i(this,Ti)[Ti].error("error registering service worker: "+e)}))},Qi=function(){const e=document.createElement("script");return e.setAttribute("type","text/javascript"),e.setAttribute("id","wzrk-alert-js"),e.setAttribute("src",i(this,Di)[Di]),document.getElementsByTagName("body")[0].appendChild(e),e},Xi=function(){const e=document.getElementById("wzrk-alert-js");e.parentNode.removeChild(e)},eo=function(e){let t,o,n,s,r,a,l,c,d,h,u,p,g,f,v;if(1===e.length){if(J(e[0])){const i=e[0];t=i.titleText,o=i.bodyText,n=i.okButtonText,s=i.rejectButtonText,r=i.okButtonColor,a=i.skipDialog,l=i.askAgainTimeInSeconds,c=i.okCallback,d=i.rejectCallback,h=i.subscriptionCallback,u=i.serviceWorkerPath,p=i.httpsPopupPath,g=i.httpsIframePath,f=i.apnsWebPushId,v=i.apnsWebPushServiceUrl}}else t=e[0],o=e[1],n=e[2],s=e[3],r=e[4],a=e[5],l=e[6];if(null==a&&(a=!1),null==u&&(u="/clevertap_sw.js"),void 0===navigator.serviceWorker)return;const b=null!=p&&null!=g;if("https:"!==window.location.protocol&&"localhost"!==document.location.hostname&&!b)return void i(this,Ti)[Ti].error("Make sure you are https or localhost to register for notifications");if(-1!==navigator.userAgent.indexOf("Chrome")){const e=navigator.userAgent.match(/Chrome\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}else if(-1!==navigator.userAgent.indexOf("Firefox")){const e=navigator.userAgent.match(/Firefox\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}else{if(-1===navigator.userAgent.indexOf("Safari"))return;{const e=navigator.userAgent.match(/Safari\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}}if(!b){if(null==Notification)return;if("granted"===Notification.permission)return void i(this,Ni)[Ni](h,u,f,v);if("denied"===Notification.permission)return;if(a)return void i(this,Ni)[Ni](h,u,f,v)}if(!(t&&o&&n&&s))return void i(this,Ti)[Ti].error("Missing input parameters; please specify title, body, ok button and cancel button text");null!=r&&r.match(/^#[a-f\d]{6}$/i)||(r="#f28046");const m=(new Date).getTime()/1e3;if(null==ae.getMetaProp("notif_last_time"))ae.setMetaProp("notif_last_time",m);else{if(null==l&&(l=604800),m-ae.getMetaProp("notif_last_time"){if(null!=e.data){let a={};try{a=JSON.parse(e.data)}catch(e){return}null!=a.state&&"ct"===a.from&&"not"===a.state&&(i(this,Vi)[Vi]().onload=()=>{window.wzrkPermissionPopup.wizAlert({title:t,body:o,confirmButtonText:n,confirmButtonColor:r,rejectButtonText:s},(e=>{e?("function"==typeof c&&c(),window.open(p)):"function"==typeof d&&d(),i(this,Wi)[Wi]()}))})}}),!1)}else i(this,Vi)[Vi]().onload=()=>{window.wzrkPermissionPopup.wizAlert({title:t,body:o,confirmButtonText:n,confirmButtonColor:r,rejectButtonText:s},(e=>{e?("function"==typeof c&&c(),i(this,Ni)[Ni](h,u,f,v)):"function"==typeof d&&d(),i(this,Wi)[Wi]()}))}},to=t("variableStore");class io{constructor(e){let{variableStore:t}=e;Object.defineProperty(this,to,{writable:!0,value:void 0}),this.name=null,this.defaultValue=null,this.value=null,this.type=null,this.hadStarted=!1,this.valueChangedCallbacks=[],i(this,to)[to]=t}getValue(){return this.value}getdefaultValue(){return this.defaultValue}static define(e,t,i){if(!e||"string"!=typeof e)return console.error("Empty or invalid name parameter provided."),null;if(e.startsWith(".")||e.endsWith("."))return console.error("Variable name starts or ends with a `.` which is not allowed: "+e),null;const o=typeof t;if("string"!==o&&"number"!==o&&"boolean"!==o)return console.error("Only primitive types (string, number, boolean) are accepted as value"),null;const n=i.getVariable(e);if(n)return n;const s=new io({variableStore:i});try{s.name=e,s.defaultValue=t,s.value=t,s.type=o,i.registerVariable(s),s.update(t)}catch(e){console.error(e)}return s}update(e){const t=this.value;this.value=e,null===e&&null===t||null!==e&&e===t&&this.hadStarted||i(this,to)[to].hasVarsRequestCompleted()&&(this.hadStarted=!0,this.triggerValueChanged())}triggerValueChanged(){this.valueChangedCallbacks.forEach((e=>{e(this)}))}addValueChangedCallback(e){e?(this.valueChangedCallbacks.push(e),i(this,to)[to].hasVarsRequestCompleted()&&e(this)):console.log("Invalid callback parameter provided.")}removeValueChangedCallback(e){const t=this.valueChangedCallbacks.indexOf(e);-1!==t&&this.valueChangedCallbacks.splice(t,1)}clearStartFlag(){this.hadStarted=!1}}var oo=t("logger"),no=t("account"),so=t("request"),ro=t("event"),ao=t("variables"),lo=t("remoteVariables"),co=t("fetchCallback"),ho=t("variablesChangedCallbacks"),uo=t("oneTimeVariablesChangedCallbacks"),po=t("hasVarsRequestCompleted"),go=t("runVariablesChangedCallback");class fo{constructor(e){let{logger:t,request:o,account:n,event:s}=e;Object.defineProperty(this,go,{value:vo}),Object.defineProperty(this,oo,{writable:!0,value:void 0}),Object.defineProperty(this,no,{writable:!0,value:void 0}),Object.defineProperty(this,so,{writable:!0,value:void 0}),Object.defineProperty(this,ro,{writable:!0,value:void 0}),Object.defineProperty(this,ao,{writable:!0,value:void 0}),Object.defineProperty(this,lo,{writable:!0,value:void 0}),Object.defineProperty(this,co,{writable:!0,value:void 0}),Object.defineProperty(this,ho,{writable:!0,value:void 0}),Object.defineProperty(this,uo,{writable:!0,value:void 0}),Object.defineProperty(this,po,{writable:!0,value:!1}),i(this,oo)[oo]=t,i(this,no)[no]=n,i(this,so)[so]=o,i(this,ro)[ro]=s,i(this,ao)[ao]={},i(this,lo)[lo]={},i(this,ho)[ho]=[],i(this,uo)[uo]=[],le.variableStore=this}registerVariable(e){const{name:t}=e;i(this,ao)[ao][t]=e,console.log("registerVariable",i(this,ao)[ao])}getVariable(e){return i(this,ao)[ao][e]}hasVarsRequestCompleted(){return i(this,po)[po]}syncVariables(e,t){if(!i(this,no)[no].token){const e="Account token is missing.";return i(this,oo)[oo].error(e),Promise.reject(new Error(e))}const o={type:"varsPayload",vars:{}};for(const e in i(this,ao)[ao])o.vars[e]={defaultValue:i(this,ao)[ao][e].defaultValue,type:i(this,ao)[ao][e].type};if(0===Object.keys(o.vars).length){const e="No variables are defined.";return i(this,oo)[oo].error(e),Promise.reject(new Error(e))}let n={};n=i(this,so)[so].addSystemDataToObject(n,void 0),n.tk=i(this,no)[no].token,n.type="meta";const s=JSON.stringify([n,o]),r=i(this,no)[no].dataPostPEURL;return i(this,so)[so].post(r,s).then((t=>(e&&"function"==typeof e&&e(t),t))).catch((e=>{throw t&&"function"==typeof t&&t(e),400===e.status?i(this,oo)[oo].error("Invalid sync payload or clear the existing draft"):401===e.status?i(this,oo)[oo].error("This is not a test profile"):i(this,oo)[oo].error("Sync variable failed"),e}))}fetchVariables(e){i(this,ro)[ro].push(K,{t:4}),e&&"function"==typeof e&&(i(this,co)[co]=e)}mergeVariables(e){console.log("msg vars is ",e),i(this,po)[po]=!0,ae.saveToLSorCookie("WZRK_PE",e),i(this,lo)[lo]=e;for(const t in i(this,ao)[ao])e.hasOwnProperty(t)&&i(this,ao)[ao][t].update(e[t]);i(this,co)[co]&&i(this,co)[co](),i(this,go)[go]()}addVariablesChangedCallback(e){e&&"function"==typeof e?(i(this,ho)[ho].push(e),this.hasVarsRequestCompleted()&&e()):i(this,oo)[oo].error("callback is not a function")}addOneTimeVariablesChangedCallback(e){e&&"function"==typeof e&&(this.hasVarsRequestCompleted()?e():i(this,uo)[uo].push(e))}removeVariablesChangedCallback(e){const t=i(this,ho)[ho].indexOf(e);-1!==t&&i(this,ho)[ho].splice(t,1)}removeOneTimeVariablesChangedCallback(e){const t=i(this,uo)[uo].indexOf(e);-1!==t&&i(this,uo)[uo].splice(t,1)}}var vo=function(){for(var e of i(this,ho)[ho])e();for(var t of i(this,uo)[uo])t();i(this,uo)[uo].length=0},bo=t("logger"),mo=t("api"),yo=t("onloadcalled"),wo=t("device"),Co=t("session"),ko=t("account"),xo=t("request"),Po=t("variableStore"),So=t("isSpa"),Io=t("previousUrl"),Oo=t("boundCheckPageChanged"),_o=t("dismissSpamControl"),Eo=t("processOldValues"),Ao=t("debounce"),Lo=t("checkPageChanged"),Mo=t("handleMessageEvent"),To=t("pingRequest"),Ro=t("isPingContinuous"),jo=t("overrideDSyncFlag");var Do=function(){this.onUserLogin._processOldValues(),this.privacy._processOldValues(),this.event._processOldValues(),this.profile._processOldValues(),this.notifications._processOldValues()},zo=function(e){let t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300;return function(){clearTimeout(t),t=setTimeout(e,i)}},Bo=function(){i(this,Ao)[Ao]((()=>{i(this,Io)[Io]!==location.href&&this.pageChanged()}))()},No=function(e){var t;e.data&&e.data.message&&("Dashboard"===e.data.message&&e.data.url?Jt(e.data.url,null!==(t=e.data.variant)&&void 0!==t?t:null):"Overlay"===e.data.message&&$t(e.data,!0))},Fo=function(){let e=i(this,ko)[ko].dataPostURL,t={};t=i(this,xo)[xo].addSystemDataToObject(t,void 0),e=Ve(e,"type","ping"),e=Ve(e,"d",Ke(JSON.stringify(t),i(this,bo)[bo])),i(this,xo)[xo].saveAndFireRequest(e,le.blockRequest)},Uo=function(){return void 0!==window.wzrk_d&&"continuous"===window.wzrk_d.ping},qo=function(e){this._isPersonalisationActive()&&(e.dsync=!0)};const Vo=new class{get spa(){return i(this,So)[So]}set spa(e){const t=!0===e;i(this,So)[So]!==t&&1===i(this,yo)[yo]&&(t?document.addEventListener("click",i(this,Oo)[Oo]):document.removeEventListener("click",i(this,Oo)[Oo])),i(this,So)[So]=t}get dismissSpamControl(){return i(this,_o)[_o]}set dismissSpamControl(e){const t=!0===e;i(this,_o)[_o]=t,le.dismissSpamControl=t}constructor(){var e,t,o,n,s;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.defineProperty(this,jo,{value:qo}),Object.defineProperty(this,Ro,{value:Uo}),Object.defineProperty(this,To,{value:Fo}),Object.defineProperty(this,Mo,{value:No}),Object.defineProperty(this,Lo,{value:Bo}),Object.defineProperty(this,Ao,{value:zo}),Object.defineProperty(this,Eo,{value:Do}),Object.defineProperty(this,bo,{writable:!0,value:void 0}),Object.defineProperty(this,mo,{writable:!0,value:void 0}),Object.defineProperty(this,yo,{writable:!0,value:void 0}),Object.defineProperty(this,wo,{writable:!0,value:void 0}),Object.defineProperty(this,Co,{writable:!0,value:void 0}),Object.defineProperty(this,ko,{writable:!0,value:void 0}),Object.defineProperty(this,xo,{writable:!0,value:void 0}),Object.defineProperty(this,Po,{writable:!0,value:void 0}),Object.defineProperty(this,So,{writable:!0,value:void 0}),Object.defineProperty(this,Io,{writable:!0,value:void 0}),Object.defineProperty(this,Oo,{writable:!0,value:i(this,Lo)[Lo].bind(this)}),Object.defineProperty(this,_o,{writable:!0,value:void 0}),this.enablePersonalization=void 0,this.popupCallbacks={},this.popupCurrentWzrkId="",i(this,yo)[yo]=0,this._isPersonalisationActive=this._isPersonalisationActive.bind(this),this.raiseNotificationClicked=()=>{},i(this,bo)[bo]=new ai(ti),i(this,ko)[ko]=new d(null===(e=r.account)||void 0===e?void 0:e[0],r.region||(null===(t=r.account)||void 0===t?void 0:t[1]),r.targetDomain||(null===(o=r.account)||void 0===o?void 0:o[2]),r.token||(null===(n=r.account)||void 0===n?void 0:n[3])),i(this,wo)[wo]=new ye({logger:i(this,bo)[bo]}),i(this,_o)[_o]=r.dismissSpamControl||!1,i(this,Co)[Co]=new pi({logger:i(this,bo)[bo],isPersonalisationActive:this._isPersonalisationActive}),i(this,xo)[xo]=new xi({logger:i(this,bo)[bo],account:i(this,ko)[ko],device:i(this,wo)[wo],session:i(this,Co)[Co],isPersonalisationActive:this._isPersonalisationActive}),this.enablePersonalization=r.enablePersonalization||!1,this.event=new Fe({logger:i(this,bo)[bo],request:i(this,xo)[xo],isPersonalisationActive:this._isPersonalisationActive},r.event),this.profile=new gt({logger:i(this,bo)[bo],request:i(this,xo)[xo],account:i(this,ko)[ko],isPersonalisationActive:this._isPersonalisationActive},r.profile),this.onUserLogin=new It({request:i(this,xo)[xo],account:i(this,ko)[ko],session:i(this,Co)[Co],logger:i(this,bo)[bo],device:i(this,wo)[wo]},r.onUserLogin),this.privacy=new Ai({request:i(this,xo)[xo],account:i(this,ko)[ko],logger:i(this,bo)[bo]},r.privacy),this.notifications=new Gi({logger:i(this,bo)[bo],request:i(this,xo)[xo],account:i(this,ko)[ko]},r.notifications),i(this,Po)[Po]=new fo({logger:i(this,bo)[bo],request:i(this,xo)[xo],account:i(this,ko)[ko],event:this.event}),i(this,mo)[mo]=new be({logger:i(this,bo)[bo],request:i(this,xo)[xo],device:i(this,wo)[wo],session:i(this,Co)[Co]}),this.spa=r.spa,this.dismissSpamControl=r.dismissSpamControl,this.user=new Xt({isPersonalisationActive:this._isPersonalisationActive}),this.session={getTimeElapsed:()=>i(this,Co)[Co].getTimeElapsed(),getPageCount:()=>i(this,Co)[Co].getPageCount()},this.logout=()=>{i(this,bo)[bo].debug("logout called"),ae.setInstantDeleteFlagInK()},this.clear=()=>{this.onUserLogin.clear()},this.getCleverTapID=()=>i(this,wo)[wo].getGuid(),this.getAccountID=()=>i(this,ko)[ko].id,this.getSCDomain=()=>i(this,ko)[ko].finalTargetDomain,this.setLibrary=(e,t)=>{le.flutterVersion={[e]:t}},this.setSCSDKVersion=e=>{i(this,ko)[ko].scSDKVersion=e;const t={};t.af={scv:"sc-sdk-v"+i(this,ko)[ko].scSDKVersion};let o=i(this,ko)[ko].dataPostURL;o=Ve(o,"type","page"),o=Ve(o,"d",Ke(JSON.stringify(t),i(this,bo)[bo])),i(this,xo)[xo].saveAndFireRequest(o,le.blockRequest)},Kt()&&(qt(),Ut(i(this,bo)[bo])),this.getInboxMessageCount=()=>{const e=Nt();return Object.keys(e).length},this.getInboxMessageUnreadCount=()=>{if(le.inbox)return le.inbox.unviewedCounter;i(this,bo)[bo].debug("No unread messages")},this.getAllInboxMessages=()=>Nt(),this.getUnreadInboxMessages=()=>{if(le.inbox)return le.inbox.unviewedMessages;i(this,bo)[bo].debug("No unread messages")},this.getInboxMessageForId=e=>{const t=Nt();if((null!==e||""!==e)&&t.hasOwnProperty(e))return t[e];i(this,bo)[bo].error("No message available for message Id "+e)},this.deleteInboxMessage=e=>{const t=Nt();if(null===e&&""===e||!t.hasOwnProperty(e))i(this,bo)[bo].error("No message available for message Id "+e);else{const i=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);0===t[e].viewed&&(le.inbox.unviewedCounter--,delete le.inbox.unviewedMessages[e],document.getElementById("unviewedBadge").innerText=le.inbox.unviewedCounter,document.getElementById("unviewedBadge").style.display=le.inbox.unviewedCounter>0?"flex":"none"),i&&i.remove(),delete t[e],Ft(t)}},this.markReadInboxMessage=e=>{const t=le.inbox.unviewedMessages,o=Nt();if(null===e&&""===e||!t.hasOwnProperty(e))i(this,bo)[bo].error("No message available for message Id "+e);else{const t=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);if(null!==t&&(t.shadowRoot.getElementById("unreadMarker").style.display="none"),o[e].viewed=1,document.getElementById("unviewedBadge")){var n=parseInt(document.getElementById("unviewedBadge").innerText)-1;document.getElementById("unviewedBadge").innerText=n,document.getElementById("unviewedBadge").style.display=n>0?"flex":"none"}window.clevertap.renderNotificationViewed({msgId:o[e].wzrk_id,pivotId:o[e].pivotId}),le.inbox.unviewedCounter--,delete le.inbox.unviewedMessages[e],Ft(o)}},this.markReadInboxMessagesForIds=e=>{if(Array.isArray(e))for(var t=0;t{const e=le.inbox.unviewedMessages,t=Nt();if(Object.keys(e).length>0){Object.keys(e).forEach((e=>{const i=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);null!==i&&(i.shadowRoot.getElementById("unreadMarker").style.display="none"),t[e].viewed=1,window.clevertap.renderNotificationViewed({msgId:t[e].wzrk_id,pivotId:t[e].wzrk_pivot})})),document.getElementById("unviewedBadge").innerText=0,document.getElementById("unviewedBadge").style.display="none",Ft(t),le.inbox.unviewedCounter=0,le.inbox.unviewedMessages={}}else i(this,bo)[bo].debug("All messages are already read")},this.toggleInbox=e=>{var t;return null===(t=le.inbox)||void 0===t?void 0:t.toggleInbox(e)},this.renderNotificationViewed=e=>{a(R,e)},this.renderNotificationClicked=e=>{a(j,e)};const a=(e,t)=>{if(!t||!t.msgId)return;const o={type:"event"};if(o.evtName=e,o.evtData={[T]:t.msgId},t.pivotId&&(o.evtData={...o.evtData,wzrk_pivot:t.pivotId}),t.wzrk_slideNo&&(o.evtData={...o.evtData,wzrk_slideNo:t.wzrk_slideNo}),t.kv&&null!==t.kv&&void 0!==t.kv)for(const e in t.kv)e.startsWith(M)&&(o.evtData={...o.evtData,[e]:t.kv[e]});if(t.msgCTkv&&null!==t.msgCTkv&&void 0!==t.msgCTkv)for(const e in t.msgCTkv)e.startsWith(M)&&(o.evtData={...o.evtData,[e]:t.msgCTkv[e]});i(this,xo)[xo].processEvent(o)};this.setLogLevel=e=>{i(this,bo)[bo].logLevel=Number(e),3===e?sessionStorage.WZRK_D="":delete sessionStorage.WZRK_D},this.handleIncrementValue=(e,t)=>{this.profile._handleIncrementDecrementValue(e,t,B)},this.handleDecrementValue=(e,t)=>{this.profile._handleIncrementDecrementValue(e,t,"$decr")},this.setMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueSet(e,t,"$set"):console.error("setMultiValuesForKey should be called with a value of type array")},this.addMultiValueForKey=(e,t)=>{"string"==typeof t||"number"==typeof t?this.profile._handleMultiValueAdd(e,t,N):console.error("addMultiValueForKey should be called with a value of type string or number.")},this.addMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueAdd(e,t,N):console.error("addMultiValuesForKey should be called with a value of type array.")},this.removeMultiValueForKey=(e,t)=>{"string"==typeof t||"number"==typeof t?this.profile._handleMultiValueRemove(e,t,F):console.error("removeMultiValueForKey should be called with a value of type string or number.")},this.removeMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueRemove(e,t,F):console.error("removeMultiValuesForKey should be called with a value of type array.")},this.removeValueForKey=e=>{this.profile._handleMultiValueDelete(e,U)};const l=(e,t,o)=>{((e,t,i,o,n)=>{const s=qe(location.href),r=s.e,a=s.p,l=s.page_type;if(void 0!==r){const s={};s.id=o.id,s.unsubGroups=le.unsubGroups,le.updatedCategoryLong&&(s.cUsY=le.updatedCategoryLong);let c=o.emailURL;i&&(c=Ve(c,"fetchGroups",i)),t&&(c=Ve(c,"encoded",t)),c=Ve(c,"e",r),c=Ve(c,"d",Ke(JSON.stringify(s),n)),a&&(c=Ve(c,"p",a)),"-1"!==e&&(c=Ve(c,"sub",e)),l&&(le.globalUnsubscribe=l===I,c=Ve(c,"page_type",l)),Qe.fireRequest(c)}})(e,t,o,i(this,ko)[ko],i(this,bo)[bo])};function c(e){var t=e.coords.latitude,i=e.coords.longitude;le.location={Latitude:t,Longitude:i},this.sendLocationData({Latitude:t,Longitude:i})}function h(e){switch(e.code){case e.PERMISSION_DENIED:console.log("User denied the request for Geolocation.");break;case e.POSITION_UNAVAILABLE:console.log("Location information is unavailable.");break;case e.TIMEOUT:console.log("The request to get user location timed out.");break;case e.UNKNOWN_ERROR:console.log("An unknown error occurred.")}}this.getLocation=function(e,t){if(e&&"number"!=typeof e||t&&"number"!=typeof t)console.log("Latitude and Longitude must be of number type");else if(e&&t){if(e<=-90||e>90)return void console.log("A vaid latitude must range between -90 and 90");if(t<=-180||t>180)return void console.log("A valid longitude must range between -180 and 180");le.location={Latitude:e,Longitude:t},this.sendLocationData({Latitude:e,Longitude:t})}else navigator.geolocation?navigator.geolocation.getCurrentPosition(c.bind(this),h):console.log("Geolocation is not supported by this browser.")};const u=i(this,mo)[mo];u.logout=this.logout,u.clear=this.clear,u.closeIframe=(e,t)=>{at(e,0,i(this,Co)[Co].sessionId)},u.enableWebPush=(e,t)=>{this.notifications._enableWebPush(e,t)},u.tr=e=>{Yt(e,{device:i(this,wo)[wo],session:i(this,Co)[Co],request:i(this,xo)[xo],logger:i(this,bo)[bo]})},u.setEnum=e=>{((e,t)=>{if(H(e)||Q(e))return"$E_"+e;t.error(Ae)})(e,i(this,bo)[bo])},u.is_onloadcalled=()=>1===i(this,yo)[yo],u.subEmail=e=>{l("1",e)},u.getEmail=(e,t)=>{l("-1",e,t)},u.unSubEmail=e=>{l("0",e)},u.unsubEmailGroups=e=>{le.unsubGroups=[];const t=document.getElementsByClassName("ct-unsub-group-input-item");for(let e=0;e{le.unsubGroups=e},u.getSubscriptionGroups=()=>le.unsubGroups,u.changeSubscriptionGroups=(e,t)=>{u.setSubscriptionGroups(t),l("2",e)},u.isGlobalUnsubscribe=()=>le.globalUnsubscribe,u.setIsGlobalUnsubscribe=e=>{le.globalUnsubscribe=e},u.setUpdatedCategoryLong=e=>{e.cUsY&&(le.updatedCategoryLong=e.cUsY)},window.$CLTP_WR=window.$WZRK_WR=u,(null===(s=r.account)||void 0===s?void 0:s[0].id)&&this.init()}init(e,t,o,n){if(1===i(this,yo)[yo])return;if(ae.removeCookie("WZRK_P",window.location.hostname),!i(this,ko)[ko].id){if(!e)return void i(this,bo)[bo].error(ke);i(this,ko)[ko].id=e}i(this,Co)[Co].cookieName="WZRK_S_"+i(this,ko)[ko].id,t&&(i(this,ko)[ko].region=t),o&&(i(this,ko)[ko].targetDomain=o),n&&(i(this,ko)[ko].token=n);const s=location.href,r=qe(s.toLowerCase());if(void 0!==r.e&&"0"==r.wzrk_ex)return;le.isPrivacyArrPushed=!0,le.privacyArray.length>0&&this.privacy.push(le.privacyArray),i(this,Eo)[Eo](),this.pageChanged();const a=setInterval((()=>{i(this,wo)[wo].gcookie&&(clearInterval(a),i(this,xo)[xo].processBackupEvents())}),3e3);i(this,So)[So]?document.addEventListener("click",i(this,Oo)[Oo]):document.removeEventListener("click",i(this,Oo)[Oo]),i(this,yo)[yo]=1}pageChanged(){const e=window.location.search,t=window.opener;if("?ctBuilder"===e)return console.log("open in visual builder mode"),window.addEventListener("message",i(this,Mo)[Mo],!1),void(t&&t.postMessage("builder","*"));if("?ctBuilderPreview"===e)return window.addEventListener("message",i(this,Mo)[Mo],!1),void(t&&t.postMessage("preview","*"));const o=window.location.href,n=qe(o.toLowerCase()),s=i(this,Co)[Co].getSessionCookieObject();let r=void 0===s.p?0:s.p;s.p=++r,i(this,Co)[Co].setSessionCookieObject(s);let a={},l=(e=>{if(""===e)return"";var t=document.createElement("a");return t.href=e,t.hostname})(document.referrer);if(window.location.hostname!==l){const e=120;""!==l&&(l=l.length>e?l.substring(0,e):l,a.referrer=l);let t=n.utm_source||n.wzrk_source;void 0!==t&&(t=t.length>e?t.substring(0,e):t,a.us=t);let i=n.utm_medium||n.wzrk_medium;void 0!==i&&(i=i.length>e?i.substring(0,e):i,a.um=i);let o=n.utm_campaign||n.wzrk_campaign;if(void 0!==o&&(o=o.length>e?o.substring(0,e):o,a.uc=o),void 0!==n.wzrk_medium){const e=n.wzrk_medium;e.match(/^email$|^social$|^search$/)&&(a.wm=e)}}a=i(this,xo)[xo].addSystemDataToObject(a,void 0),a.cpg=o,a.WZRK_CAMP=it();let c=i(this,ko)[ko].dataPostURL;i(this,xo)[xo].addFlags(a),1===parseInt(a.pg)&&i(this,jo)[jo](a),c=Ve(c,"type","page"),c=Ve(c,"d",Ke(JSON.stringify(a),i(this,bo)[bo])),i(this,xo)[xo].saveAndFireRequest(c,le.blockRequest),1===parseInt(a.pg)&&this.event.push(K,{t:4}),i(this,Io)[Io]=o,setTimeout((()=>{r<=3&&i(this,To)[To](),i(this,Ro)[Ro]()&&setInterval((()=>{i(this,To)[To]()}),3e5)}),12e4)}_isPersonalisationActive(){return ae._isLocalStorageSupported()&&this.enablePersonalization}set popupCallback(e){this.popupCallbacks[this.popupCurrentWzrkId]=e}sendLocationData(e){let t={af:{}};const o={};if(t.type="profile",null==o.tz&&(o.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),t.profile=o,e){Object.keys(e).forEach((i=>{t.af[i]=e[i]}))}le.location&&(t.af={...t.af,...le.location}),t=i(this,xo)[xo].addSystemDataToObject(t,!0),i(this,xo)[xo].addFlags(t);const n=Ke(JSON.stringify(t),i(this,bo)[bo]);let s=i(this,ko)[ko].dataPostURL;s=Ve(s,"type",A),s=Ve(s,"d",n),i(this,xo)[xo].saveAndFireRequest(s,le.blockRequest)}setOffline(e){"boolean"==typeof e?(le.offline=e,e||i(this,xo)[xo].processBackupEvents()):console.error("setOffline should be called with a value of type boolean")}defineVariable(e,t){return io.define(e,t,i(this,Po)[Po])}syncVariables(e,t){if(4===i(this,bo)[bo].logLevel)return i(this,Po)[Po].syncVariables(e,t);{const e="App log level is not set to 4";return i(this,bo)[bo].error(e),Promise.reject(new Error(e))}}fetchVariables(e){i(this,Po)[Po].fetchVariables(e)}addVariablesChangedCallback(e){i(this,Po)[Po].addVariablesChangedCallback(e)}addOneTimeVariablesChangedCallback(e){i(this,Po)[Po].addOneTimeVariablesChangedCallback(e)}}(window.clevertap);return window.clevertap=window.wizrocket=Vo,Vo})); diff --git a/src/modules/visualBuilder/pageBuilder.js b/src/modules/visualBuilder/pageBuilder.js index 14f17863..766cc9be 100644 --- a/src/modules/visualBuilder/pageBuilder.js +++ b/src/modules/visualBuilder/pageBuilder.js @@ -87,7 +87,7 @@ function loadTypeKit () { } export const renderVisualBuilder = (targetingMsgJson, isPreview) => { - const details = targetingMsgJson.display.details[0] + const details = isPreview ? targetingMsgJson[0] : targetingMsgJson.display.details[0] const siteUrl = Object.keys(details)[0] const selectors = details[siteUrl] From 4391ef56e557ab5e84c094e7b55c7a0ece74683e Mon Sep 17 00:00:00 2001 From: KambleSonam Date: Mon, 13 May 2024 12:08:03 +0530 Subject: [PATCH 07/19] Added json data handling and bugfixes --- clevertap.js | 53 ++++++++++++++++-------- clevertap.js.map | 2 +- clevertap.min.js | 2 +- src/clevertap.js | 2 +- src/modules/visualBuilder/pageBuilder.js | 39 ++++++++++------- 5 files changed, 61 insertions(+), 37 deletions(-) diff --git a/clevertap.js b/clevertap.js index 0a529db2..0a9f1804 100644 --- a/clevertap.js +++ b/clevertap.js @@ -4486,12 +4486,12 @@ const arrowSvg = "\n\n\n"; const greenTickSvg = "\n\n\n"; - const initialiseCTBuilder = (url, variant) => { - document.addEventListener('DOMContentLoaded', () => onContentLoad(url, variant)); + const initialiseCTBuilder = (url, variant, details) => { + document.addEventListener('DOMContentLoaded', () => onContentLoad(url, variant, details)); }; let container; - function onContentLoad(url, variant) { + function onContentLoad(url, variant, details) { document.body.innerHTML = ''; container = document.createElement('div'); container.id = 'overlayDiv'; @@ -4500,7 +4500,7 @@ container.style.display = 'flex'; document.body.appendChild(container); const overlayPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js'; - loadOverlayScript(overlayPath, url, variant).then(() => { + loadOverlayScript(overlayPath, url, variant, details).then(() => { console.log('Overlay script loaded successfully.'); }).catch(error => { console.error('Error loading overlay script:', error); @@ -4517,7 +4517,7 @@ document.head.appendChild(link); } - function loadOverlayScript(overlayPath, url, variant) { + function loadOverlayScript(overlayPath, url, variant, details) { return new Promise((resolve, reject) => { var script = document.createElement('script'); script.type = 'module'; @@ -4525,7 +4525,7 @@ script.onload = function () { if (typeof window.Overlay === 'function') { - window.Overlay('#overlayDiv', url, variant); + window.Overlay('#overlayDiv', url, variant, details); resolve(); } else { reject(new Error('ContentLayout not found in overlay.js')); @@ -4575,17 +4575,20 @@ } const renderVisualBuilder = (targetingMsgJson, isPreview) => { - const details = isPreview ? targetingMsgJson[0] : targetingMsgJson.display.details[0]; + const details = isPreview ? targetingMsgJson.details[0] : targetingMsgJson.display.details[0]; const siteUrl = Object.keys(details)[0]; const selectors = details[siteUrl]; - if (siteUrl === window.location.href) { + if (siteUrl === window.location.href.split('?')[0]) { for (const selector in selectors) { const element = document.querySelector(selector); if (element) { if (selectors[selector].html) { element.outerHTML = selectors[selector].html; + } else { + // Update json data + dispatchJsonData(targetingMsgJson, selectors[selector]); } if (!isPreview) { @@ -4602,6 +4605,9 @@ if (retryElement) { if (selectors[selector].html) { retryElement.outerHTML = selectors[selector].html; + } else { + // Update json data + dispatchJsonData(targetingMsgJson, selectors[selector]); } if (!isPreview) { @@ -4624,14 +4630,25 @@ } } } - }; // function addOverlayScript (overlayPath) { - // const scriptTag = document.createElement('script') - // scriptTag.setAttribute('type', 'text/javascript') - // scriptTag.setAttribute('id', 'wzrk-alert-js') - // scriptTag.setAttribute('src', overlayPath) - // document.getElementsByTagName('body')[0].appendChild(scriptTag) - // return scriptTag - // } + }; + + function dispatchJsonData(targetingMsgJson, selector) { + const inaObj = {}; + inaObj.msgId = targetingMsgJson.wzrk_id; + + if (targetingMsgJson.wzrk_pivot) { + inaObj.pivotId = targetingMsgJson.wzrk_pivot; + } + + if (selector.json != null) { + inaObj.json = selector.json; + } + + const kvPairsEvent = new CustomEvent('CT_web_native_display_buider', { + detail: inaObj + }); + document.dispatchEvent(kvPairsEvent); + } const _tr = (msg, _ref) => { let { @@ -8412,9 +8429,9 @@ var _handleMessageEvent2 = function _handleMessageEvent2(event) { if (event.data && event.data.message) { if (event.data.message === 'Dashboard' && event.data.url) { - var _event$data$variant; + var _event$data$variant, _event$data$details; - initialiseCTBuilder(event.data.url, (_event$data$variant = event.data.variant) !== null && _event$data$variant !== void 0 ? _event$data$variant : null); + initialiseCTBuilder(event.data.url, (_event$data$variant = event.data.variant) !== null && _event$data$variant !== void 0 ? _event$data$variant : null, (_event$data$details = event.data.details) !== null && _event$data$details !== void 0 ? _event$data$details : {}); } else if (event.data.message === 'Overlay') { renderVisualBuilder(event.data, true); } diff --git a/clevertap.js.map b/clevertap.js.map index 1a838a49..f3ba26cb 100644 --- a/clevertap.js.map +++ b/clevertap.js.map @@ -1 +1 @@ -{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/modules/visualBuilder/pageBuilder.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/notification.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {}\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n // Initialize array\n var array = []\n\n // Check if globalProfileMap is null, initialize if needed\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n // Check if the value to be set is either string or number\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = $ct.globalProfileMap[propKey]\n array.push(typeof propVal === 'number' ? propVal : propVal.toLowerCase())\n } else {\n $ct.globalProfileMap[propKey] = propVal\n }\n } else {\n // Check if propVal is an array\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = Array.isArray($ct.globalProfileMap[propKey]) ? $ct.globalProfileMap[propKey] : [$ct.globalProfileMap[propKey]]\n }\n\n // Check for case-sensitive inputs and filter the same ones\n for (var i = 0; i < propVal.length; i++) {\n if (typeof propVal[i] === 'number' && !array.includes(propVal[i])) {\n array.push(propVal[i])\n } else if (typeof propVal[i] === 'string' && !array.includes(propVal[i].toLowerCase())) {\n array.push(propVal[i].toLowerCase())\n } else if ((typeof propVal[i] === 'number' && array.includes(propVal[i])) || (typeof propVal[i] === 'string' && array.includes(propVal[i].toLowerCase()))) {\n console.error('Values already included')\n } else {\n console.error('Array supports only string or number type values')\n }\n }\n\n // Update globalProfileMap with the array\n $ct.globalProfileMap[propKey] = array\n }\n\n // Save to local storage or cookie\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Call the sendMultiValueData function\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n var index = $ct.globalProfileMap[propKey].indexOf(propVal)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n } else {\n for (var k = 0; k < propVal.length; k++) {\n var idx = $ct.globalProfileMap[propKey].indexOf(propVal[k])\n if (idx !== -1) {\n $ct.globalProfileMap[propKey].splice(idx, 1)\n }\n }\n }\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n // console.log('Raise notification clicked event for ', item)\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","export const initialiseCTBuilder = (url, variant) => {\n document.addEventListener('DOMContentLoaded', () => onContentLoad(url, variant))\n}\n\nlet container\n\nfunction onContentLoad (url, variant) {\n document.body.innerHTML = ''\n container = document.createElement('div')\n container.id = 'overlayDiv'\n container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form\n container.style.display = 'flex'\n document.body.appendChild(container)\n const overlayPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js'\n loadOverlayScript(overlayPath, url, variant)\n .then(() => {\n console.log('Overlay script loaded successfully.')\n })\n .catch((error) => {\n console.error('Error loading overlay script:', error)\n })\n loadCSS()\n loadTypeKit()\n}\n\nfunction loadCSS () {\n var link = document.createElement('link')\n link.rel = 'stylesheet'\n link.type = 'text/css'\n link.href = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css'\n document.head.appendChild(link)\n}\n\nfunction loadOverlayScript (overlayPath, url, variant) {\n return new Promise((resolve, reject) => {\n var script = document.createElement('script')\n script.type = 'module'\n script.src = overlayPath\n script.onload = function () {\n if (typeof window.Overlay === 'function') {\n window.Overlay('#overlayDiv', url, variant)\n resolve()\n } else {\n reject(new Error('ContentLayout not found in overlay.js'))\n }\n }\n script.onerror = function (error) {\n reject(error)\n }\n document.head.appendChild(script)\n })\n}\n\nfunction loadTypeKit () {\n var config = {\n kitId: 'eqj6nom',\n scriptTimeout: 3000,\n async: true\n }\n\n var d = document\n var h = d.documentElement\n var t = setTimeout(function () {\n h.className = h.className.replace(/\\bwf-loading\\b/g, '') + ' wf-inactive'\n // $(document).trigger(\"TypeKitReady\");\n }, config.scriptTimeout)\n var tk = d.createElement('script')\n var f = false\n var s = d.getElementsByTagName('script')[0]\n var a\n\n h.className += ' wf-loading'\n tk.src = 'https://use.typekit.net/' + config.kitId + '.js'\n tk.async = true\n tk.onload = tk.onreadystatechange = function () {\n a = this.readyState\n if (f || (a && a !== 'complete' && a !== 'loaded')) return\n f = true\n clearTimeout(t)\n try {\n // eslint-disable-next-line no-undef\n Typekit.load(config)\n } catch (e) {}\n }\n\n s.parentNode.insertBefore(tk, s)\n}\n\nexport const renderVisualBuilder = (targetingMsgJson, isPreview) => {\n const details = isPreview ? targetingMsgJson[0] : targetingMsgJson.display.details[0]\n const siteUrl = Object.keys(details)[0]\n const selectors = details[siteUrl]\n\n if (siteUrl === window.location.href) {\n for (const selector in selectors) {\n const element = document.querySelector(selector)\n if (element) {\n if (selectors[selector].html) {\n element.outerHTML = selectors[selector].html\n } else {\n // Update json data\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n } else {\n let count = 0\n const intervalId = setInterval(() => {\n const retryElement = document.querySelector(selector)\n if (retryElement) {\n if (selectors[selector].html) {\n retryElement.outerHTML = selectors[selector].html\n } else {\n // Update json data\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n clearInterval(intervalId)\n } else {\n count++\n if (count >= 20) {\n console.log(`No element present on DOM with selector '${selector}'.`)\n clearInterval(intervalId)\n }\n }\n }, 500)\n }\n }\n }\n}\n// function addOverlayScript (overlayPath) {\n// const scriptTag = document.createElement('script')\n// scriptTag.setAttribute('type', 'text/javascript')\n// scriptTag.setAttribute('id', 'wzrk-alert-js')\n// scriptTag.setAttribute('src', overlayPath)\n// document.getElementsByTagName('body')[0].appendChild(scriptTag)\n// return scriptTag\n// }\n","import {\n addToLocalProfileMap,\n arp,\n getCampaignObject,\n saveCampaignObject,\n closeIframe\n} from './clevertap'\n\nimport {\n CAMP_COOKIE_NAME,\n DISPLAY,\n GLOBAL,\n EV_COOKIE,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n WZRK_PREFIX,\n WZRK_ID,\n CAMP_COOKIE_G,\n GCOOKIE_NAME\n} from './constants'\n\nimport {\n getNow,\n getToday\n} from './datetime'\n\nimport {\n compressToBase64\n} from './encoder'\n\nimport { StorageManager, $ct } from './storage'\nimport RequestDispatcher from './requestDispatcher'\nimport { CTWebPersonalisationBanner } from './web-personalisation/banner'\nimport { CTWebPersonalisationCarousel } from './web-personalisation/carousel'\nimport { CTWebPopupImageOnly } from './web-popupImageonly/popupImageonly'\nimport { checkAndRegisterWebInboxElements, initializeWebInbox, processWebInboxSettings, hasWebInboxSettingsInLS, processInboxNotifs } from '../modules/web-inbox/helper'\nimport { renderVisualBuilder } from '../modules/visualBuilder/pageBuilder'\n\nconst _tr = (msg, {\n device,\n session,\n request,\n logger\n}) => {\n const _device = device\n const _session = session\n const _request = request\n const _logger = logger\n let _wizCounter = 0\n\n // msg = {\n // arp: {\n // j_n: 'Zw==',\n // i_n: 'Y2NmewICAw==',\n // d_ts: 0,\n // dh: 0,\n // v: 1,\n // j_s: '{ }',\n // id: 'WWW-WWW-WWRZ',\n // e_ts: 0,\n // r_ts: 1649748826,\n // rc_w: 60,\n // rc_n: 5\n // },\n // inapp_notifs: [\n // {\n // msgContent: {\n // templateType: 'point-and-click',\n // type: 4\n // },\n // display: {\n // divId: 'hero-banner',\n // details: [{\n // 'http://localhost:3000/': {\n // '.heroDi1v': {\n // html: 'Hello Sonam'\n // },\n // '#selector_2': {\n // html: '

Hello Sonam

'\n // },\n // '.heroDiv2': {\n // json: {\n // name: 'Sonam',\n // identity: 1234\n // }\n // }\n // }\n // }],\n // wtarget_type: 2,\n // wmc: 1,\n // ff: 'Desktop'\n // },\n // wzrk_id: '1655316906_20220620',\n // wzrk_pivot: 'wzrk_default'\n // }\n // ]\n // }\n // Campaign House keeping\n const doCampHouseKeeping = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const today = getToday()\n\n const incrCount = (obj, campaignId, excludeFromFreqCaps) => {\n let currentCount = 0\n let totalCount = 0\n if (obj[campaignId] != null) {\n currentCount = obj[campaignId]\n }\n currentCount++\n if (obj.tc != null) {\n totalCount = obj.tc\n }\n // if exclude from caps then dont add to total counts\n if (excludeFromFreqCaps < 0) {\n totalCount++\n }\n\n obj.tc = totalCount\n obj[campaignId] = currentCount\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n delete sessionStorage[CAMP_COOKIE_NAME]\n var campTypeObj = {}\n const campObj = getCampaignObject()\n if (targetingMsgJson.display.wtarget_type === 3 && campObj.hasOwnProperty('wi')) {\n campTypeObj = campObj.wi\n } else if ((targetingMsgJson.display.wtarget_type === 0 || targetingMsgJson.display.wtarget_type === 1) && campObj.hasOwnProperty('wp')) {\n campTypeObj = campObj.wp\n } else {\n campTypeObj = {}\n }\n if (campObj.hasOwnProperty('global')) {\n campTypeObj.wp = campObj\n }\n // global session limit. default is 1\n if (targetingMsgJson[DISPLAY].wmc == null) {\n targetingMsgJson[DISPLAY].wmc = 1\n }\n\n // global session limit for web inbox. default is 1\n if (targetingMsgJson[DISPLAY].wimc == null) {\n targetingMsgJson[DISPLAY].wimc = 1\n }\n\n var excludeFromFreqCaps = -1 // efc - Exclude from frequency caps\n let campaignSessionLimit = -1 // mdc - Once per session\n let campaignDailyLimit = -1 // tdc - Once per day\n let campaignTotalLimit = -1 // tlc - Once per user for the duration of campaign\n let totalDailyLimit = -1\n let totalSessionLimit = -1 // wmc - Web Popup Global Session Limit\n let totalInboxSessionLimit = -1 // wimc - Web Inbox Global Session Limit\n\n if (targetingMsgJson[DISPLAY].efc != null) { // exclude from frequency cap\n excludeFromFreqCaps = parseInt(targetingMsgJson[DISPLAY].efc, 10)\n }\n if (targetingMsgJson[DISPLAY].mdc != null) { // Campaign Session Limit\n campaignSessionLimit = parseInt(targetingMsgJson[DISPLAY].mdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tdc != null) { // No of web popups in a day per campaign\n campaignDailyLimit = parseInt(targetingMsgJson[DISPLAY].tdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tlc != null) { // Total lifetime count\n campaignTotalLimit = parseInt(targetingMsgJson[DISPLAY].tlc, 10)\n }\n if (targetingMsgJson[DISPLAY].wmp != null) { // No of campaigns per day\n totalDailyLimit = parseInt(targetingMsgJson[DISPLAY].wmp, 10)\n }\n if (targetingMsgJson[DISPLAY].wmc != null) { // No of campaigns per session\n totalSessionLimit = parseInt(targetingMsgJson[DISPLAY].wmc, 10)\n }\n\n if (targetingMsgJson[DISPLAY].wimc != null) { // No of inbox campaigns per session\n totalInboxSessionLimit = parseInt(targetingMsgJson[DISPLAY].wimc, 10)\n }\n // session level capping\n var sessionObj = campTypeObj[_session.sessionId]\n if (sessionObj) {\n const campaignSessionCount = sessionObj[campaignId]\n const totalSessionCount = sessionObj.tc\n // dnd\n if (campaignSessionCount === 'dnd' && !$ct.dismissSpamControl) {\n return false\n }\n\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n // Inbox session\n if (totalInboxSessionLimit > 0 && totalSessionCount >= totalInboxSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n } else {\n // session\n if (totalSessionLimit > 0 && totalSessionCount >= totalSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n }\n\n // campaign session\n if (campaignSessionLimit > 0 && campaignSessionCount >= campaignSessionLimit) {\n return false\n }\n } else {\n sessionObj = {}\n campTypeObj[_session.sessionId] = sessionObj\n }\n\n // daily level capping\n var dailyObj = campTypeObj[today]\n if (dailyObj != null) {\n const campaignDailyCount = dailyObj[campaignId]\n const totalDailyCount = dailyObj.tc\n // daily\n if (totalDailyLimit > 0 && totalDailyCount >= totalDailyLimit && excludeFromFreqCaps < 0) {\n return false\n }\n // campaign daily\n if (campaignDailyLimit > 0 && campaignDailyCount >= campaignDailyLimit) {\n return false\n }\n } else {\n dailyObj = {}\n campTypeObj[today] = dailyObj\n }\n\n var globalObj = campTypeObj[GLOBAL]\n if (globalObj != null) {\n const campaignTotalCount = globalObj[campaignId]\n // campaign total\n if (campaignTotalLimit > 0 && campaignTotalCount >= campaignTotalLimit) {\n return false\n }\n } else {\n globalObj = {}\n campTypeObj[GLOBAL] = globalObj\n }\n }\n // delay\n if (targetingMsgJson[DISPLAY].delay != null && targetingMsgJson[DISPLAY].delay > 0) {\n const delay = targetingMsgJson[DISPLAY].delay\n targetingMsgJson[DISPLAY].delay = 0\n setTimeout(_tr, delay * 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n return false\n }\n\n incrCount(sessionObj, campaignId, excludeFromFreqCaps)\n incrCount(dailyObj, campaignId, excludeFromFreqCaps)\n incrCount(globalObj, campaignId, excludeFromFreqCaps)\n\n let campKey = 'wp'\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n campKey = 'wi'\n }\n // get ride of stale sessions and day entries\n const newCampObj = {}\n newCampObj[_session.sessionId] = sessionObj\n newCampObj[today] = dailyObj\n newCampObj[GLOBAL] = globalObj\n saveCampaignObject({ [campKey]: newCampObj })\n }\n\n const getCookieParams = () => {\n const gcookie = _device.getGuid()\n const scookieObj = _session.getSessionCookieObject()\n return '&t=wc&d=' + encodeURIComponent(compressToBase64(gcookie + '|' + scookieObj.p + '|' + scookieObj.s))\n }\n\n const setupClickEvent = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n if (onClick !== '' && onClick != null) {\n let ctaElement\n let jsCTAElements\n if (isLegacy) {\n ctaElement = contentDiv\n } else if (contentDiv !== null) {\n jsCTAElements = contentDiv.getElementsByClassName('jsCT_CTA')\n if (jsCTAElements != null && jsCTAElements.length === 1) {\n ctaElement = jsCTAElements[0]\n }\n }\n const jsFunc = targetingMsgJson.display.jsFunc\n const isPreview = targetingMsgJson.display.preview\n if (isPreview == null) {\n onClick += getCookieParams()\n }\n\n if (ctaElement != null) {\n ctaElement.onclick = () => {\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n if (isPreview == null) {\n RequestDispatcher.fireRequest(onClick)\n }\n invokeExternalJs(jsFunc, targetingMsgJson)\n // close iframe. using -1 for no campaignId\n closeIframe('-1', divId, _session.sessionId)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n }\n }\n\n const invokeExternalJs = (jsFunc, targetingMsgJson) => {\n const func = window.parent[jsFunc]\n if (typeof func === 'function') {\n if (targetingMsgJson.display.kv != null) {\n func(targetingMsgJson.display.kv)\n } else {\n func()\n }\n }\n }\n\n const setupClickUrl = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n incrementImpression(targetingMsgJson)\n setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy)\n }\n\n const incrementImpression = (targetingMsgJson) => {\n const data = {}\n data.type = 'event'\n data.evtName = NOTIFICATION_VIEWED\n data.evtData = { [WZRK_ID]: targetingMsgJson.wzrk_id }\n if (targetingMsgJson.wzrk_pivot) {\n data.evtData = { ...data.evtData, wzrk_pivot: targetingMsgJson.wzrk_pivot }\n }\n _request.processEvent(data)\n }\n\n const renderPersonalisationBanner = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const bannerEl = document.createElement('ct-web-personalisation-banner')\n bannerEl.msgId = targetingMsgJson.wzrk_id\n bannerEl.pivotId = targetingMsgJson.wzrk_pivot\n bannerEl.divHeight = targetingMsgJson.display.divHeight\n bannerEl.details = targetingMsgJson.display.details[0]\n const containerEl = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n containerEl.innerHTML = ''\n containerEl.appendChild(bannerEl)\n }\n\n const renderPersonalisationCarousel = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-carousel') === undefined) {\n customElements.define('ct-web-personalisation-carousel', CTWebPersonalisationCarousel)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const carousel = document.createElement('ct-web-personalisation-carousel')\n carousel.target = targetingMsgJson\n const container = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n container.innerHTML = ''\n container.appendChild(carousel)\n }\n\n const renderPopUpImageOnly = (targetingMsgJson) => {\n const divId = 'wzrkImageOnlyDiv'\n const popupImageOnly = document.createElement('ct-web-popup-imageonly')\n popupImageOnly.session = _session\n popupImageOnly.target = targetingMsgJson\n const containerEl = document.getElementById(divId)\n containerEl.innerHTML = ''\n containerEl.style.visibility = 'hidden'\n containerEl.appendChild(popupImageOnly)\n }\n\n const renderFooterNotification = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const displayObj = targetingMsgJson.display\n\n if (displayObj.wtarget_type === 2) { // Handling Web Native display\n // Logic for kv pair data\n if (targetingMsgJson.msgContent.type === 1) {\n const inaObj = {}\n\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.msgContent.kv != null) {\n inaObj.kv = targetingMsgJson.msgContent.kv\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n return\n }\n }\n if (displayObj.layout === 1) { // Handling Web Exit Intent\n return showExitIntent(undefined, targetingMsgJson)\n }\n if (displayObj.layout === 3) { // Handling Web Popup Image Only\n const divId = 'wzrkImageOnlyDiv'\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById(divId) != null || document.getElementById('intentPreview') != null) {\n return\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n document.body.appendChild(msgDiv)\n if (customElements.get('ct-web-popup-imageonly') === undefined) {\n customElements.define('ct-web-popup-imageonly', CTWebPopupImageOnly)\n }\n return renderPopUpImageOnly(targetingMsgJson)\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const divId = 'wizParDiv' + displayObj.layout\n\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n if (document.getElementById(divId) != null) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = divId\n const isBanner = displayObj.layout === 2\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n const viewHeight = window.innerHeight\n const viewWidth = window.innerWidth\n let legacy = false\n\n if (!isBanner) {\n const marginBottom = viewHeight * 5 / 100\n var contentHeight = 10\n let right = viewWidth * 5 / 100\n let bottomPosition = contentHeight + marginBottom\n let width = viewWidth * 30 / 100 + 20\n let widthPerct = 'width:30%;'\n // for small devices - mobile phones\n if ((/mobile/i.test(navigator.userAgent) || (/mini/i.test(navigator.userAgent))) && /iPad/i.test(navigator.userAgent) === false) {\n width = viewWidth * 85 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:80%;'\n // medium devices - tablets\n } else if ('ontouchstart' in window || (/tablet/i.test(navigator.userAgent))) {\n width = viewWidth * 50 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:50%;'\n }\n // legacy footer notif\n if (displayObj.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden; bottom:' + bottomPosition + 'px !important;width:' + width + 'px !important;right:' + right + 'px !important;position:fixed;z-index:2147483647;')\n } else {\n msgDiv.setAttribute('style', widthPerct + displayObj.iFrameStyle)\n }\n } else {\n msgDiv.setAttribute('style', displayObj.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n\n const borderRadius = displayObj.br === false ? '0' : '8'\n\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, leftTd, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n leftTd = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n leftTd = '#f4f4f4'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"\"\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'\" + divId + \"');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"\" +\n // \"\"+\n '' + imageTd + \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
'\n html = css + title + body\n }\n\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n const ifrm = (iframe.contentWindow) ? iframe.contentWindow : (iframe.contentDocument.document) ? iframe.contentDocument.document : iframe.contentDocument\n const doc = ifrm.document\n\n // Dispatch event for popup box/banner close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n doc.open()\n doc.write(html)\n\n if (displayObj['custom-editor']) {\n appendScriptForCustomEvent(targetingMsgJson, doc)\n }\n doc.close()\n\n const adjustIFrameHeight = () => {\n // adjust iframe and body height of html inside correctly\n contentHeight = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv').scrollHeight\n if (displayObj['custom-editor'] !== true && !isBanner) {\n contentHeight += 25\n }\n document.getElementById('wiz-iframe').contentDocument.body.style.margin = '0px'\n document.getElementById('wiz-iframe').style.height = contentHeight + 'px'\n }\n\n const ua = navigator.userAgent.toLowerCase()\n if (ua.indexOf('safari') !== -1) {\n if (ua.indexOf('chrome') > -1) {\n iframe.onload = () => {\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n } else {\n let inDoc = iframe.contentDocument || iframe.contentWindow\n if (inDoc.document) inDoc = inDoc.document\n // safari iphone 7+ needs this.\n adjustIFrameHeight()\n const _timer = setInterval(() => {\n if (inDoc.readyState === 'complete') {\n clearInterval(_timer)\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }, 10)\n }\n } else {\n iframe.onload = () => {\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }\n }\n\n const appendScriptForCustomEvent = (targetingMsgJson, doc) => {\n const script = doc.createElement('script')\n script.innerHTML = `\n const ct__camapignId = '${targetingMsgJson.wzrk_id}';\n const ct__formatVal = (v) => {\n return v && v.trim().substring(0, 20);\n }\n const ct__parentOrigin = window.parent.origin;\n document.body.addEventListener('click', (event) => {\n const elem = event.target.closest?.('a[wzrk_c2a], button[wzrk_c2a]');\n if (elem) {\n const {innerText, id, name, value, href} = elem;\n const clickAttr = elem.getAttribute('onclick') || elem.getAttribute('click');\n const onclickURL = clickAttr?.match(/(window.open)[(\\](\\\"|')(.*)(\\\"|',)/)?.[3] || clickAttr?.match(/(location.href *= *)(\\\"|')(.*)(\\\"|')/)?.[3];\n const props = {innerText, id, name, value};\n let msgCTkv = Object.keys(props).reduce((acc, c) => {\n const formattedVal = ct__formatVal(props[c]);\n formattedVal && (acc['wzrk_click_' + c] = formattedVal);\n return acc;\n }, {});\n if(onclickURL) { msgCTkv['wzrk_click_' + 'url'] = onclickURL; }\n if(href) { msgCTkv['wzrk_click_' + 'c2a'] = href; }\n const notifData = { msgId: ct__camapignId, msgCTkv, pivotId: '${targetingMsgJson.wzrk_pivot}' };\n window.parent.clevertap.renderNotificationClicked(notifData);\n }\n });\n `\n doc.body.appendChild(script)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe-intent'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n const ifrm = (iframe.contentWindow) ? iframe.contentWindow : (iframe.contentDocument.document) ? iframe.contentDocument.document : iframe.contentDocument\n const doc = ifrm.document\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n doc.open()\n doc.write(html)\n if (targetingMsgJson.display['custom-editor']) {\n appendScriptForCustomEvent(targetingMsgJson, doc)\n }\n doc.close()\n\n const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n this.#logger.error('Error subscribing: ' + error)\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\n// import { initialiseCTBuilder } from './modules/visualBuilder/pageBuilder'\nimport { initialiseCTBuilder, renderVisualBuilder } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token) {\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n #handleMessageEvent (event) {\n if (event.data && event.data.message) {\n if (event.data.message === 'Dashboard' && event.data.url) {\n initialiseCTBuilder(event.data.url, event.data.variant ?? null)\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n }\n }\n\n pageChanged () {\n const search = window.location.search\n const parentWindow = window.opener\n\n if (search === '?ctBuilder') {\n // open in visual builder mode\n console.log('open in visual builder mode')\n window.addEventListener('message', this.#handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('builder', '*')\n }\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', this.#handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('preview', '*')\n }\n return\n }\n\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","constructor","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","dataPostPEURL","dataPostURL","recorderURL","emailURL","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","save","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","read","data","getItem","parse","e","remove","removeItem","removeCookie","name","domain","cookieStr","document","cookie","createCookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","readCookie","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","saveToLSorCookie","property","location","hostname","$ct","globalCache","readFromLSorCookie","trim","err","createBroadCookie","broadDomain","domainParts","testBroadDomain","testCookieName","tempCookie","getMetaProp","metaObj","setMetaProp","wzrkMetaObj","getAndClearMetaProp","setInstantDeleteFlagInK","k","flag","backupEvent","reqNo","backupArr","q","debug","removeBackup","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","get","item","saveCacheToLS","set","allKeys","objToArray","index","temp","getKey","getSecondLastKey","keysArr","getLastKey","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","s","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","sessionObj","getSessionCookieObject","kIdFromLS","guidFromLRUCache","lastK","lastGUID","unregisterTokenForGuid","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","_processOldValues","getDetails","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","fireRequest","skipARP","sendOULFlag","getDelayFrequency","account","randomDelay","random","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","ProfileHandler","profilesArr","getAttribute","propName","_handleIncrementDecrementValue","command","tz","profile","addSystemDataToObject","addFlags","compressedData","saveAndFireRequest","_handleMultiValueSet","arrayVal","array","toLowerCase","sendMultiValueData","_handleMultiValueAdd","propKey","propVal","_handleMultiValueRemove","_handleMultiValueDelete","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","clear","addToK","ids","g","kId","anonymousUser","foundInCache","gFromCache","Identity","cookieName","loginArr","pop","processProfile","CTWebPersonalisationBanner","HTMLElement","_details","shadow","attachShadow","mode","details","renderBanner","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","target","renderCarousel","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","button","setInterval","sliderTime","goTo","prev","cur","CTWebPopupImageOnly","_session","popup","container","resizeObserver","renderImageOnlyPopup","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","Message","config","message","wrapper","snackBar","renderMessage","createEl","part","_el","msg","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","raiseClickedEvent","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","contains","setBadgeStyle","msgCount","incomingMessages","msgs","updateInboxMessages","incomingMessagesForPreview","previewMsgs","now","buildUIForMessages","updateUnviewedBadgeCounter","connectedCallback","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","addMsgsToInboxFromLS","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","deleteMsgsFromUI","getInboxMessages","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","top","right","getBoundingClientRect","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","inbox_notifs","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","initialiseCTBuilder","variant","onContentLoad","position","overlayPath","loadOverlayScript","then","catch","loadCSS","loadTypeKit","link","rel","head","script","src","onload","Overlay","Error","onerror","kitId","scriptTimeout","h","documentElement","className","tk","onreadystatechange","Typekit","load","renderVisualBuilder","targetingMsgJson","siteUrl","selectors","selector","element","querySelector","outerHTML","intervalId","retryElement","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","onclick","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","inaObj","kvPairsEvent","CustomEvent","dispatchEvent","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","pointerCss","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","ifrm","contentWindow","contentDocument","doc","closeCampaign","Event","write","appendScriptForCustomEvent","close","adjustIFrameHeight","scrollHeight","margin","ua","inDoc","_timer","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","getTotalVisits","visitCount","getLastVisit","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","info","debugPE","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","getTimeElapsed","sessionStart","getPageCount","seqNo","requestTime","RequestManager","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","post","fetch","method","headers","response","ok","json","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","_enableWebPush","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","skipDialog","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","getValue","getdefaultValue","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","addValueChangedCallback","removeValueChangedCallback","clearStartFlag","VariableStore","syncVariables","onSyncSuccess","onSyncFailure","meta","r","status","fetchVariables","onFetchCallback","addVariablesChangedCallback","callback","addOneTimeVariablesChangedCallback","removeVariablesChangedCallback","removeOneTimeVariablesChangedCallback","callBack","CleverTap","spa","isSpa","bind","enablePersonalization","_isPersonalisationActive","ReqestManager","onUserLogin","privacy","notifications","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","handleDecrementValue","setMultiValuesForKey","addMultiValueForKey","addMultiValuesForKey","removeMultiValueForKey","removeMultiValuesForKey","removeValueForKey","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","sendLocationData","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","elements","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","parentWindow","opener","postMessage","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","setOffline","arg","defineVariable","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;EAAO,MAAMA,aAAa,GAAG,oBAAtB;EACA,MAAMC,eAAe,GAAG,QAAxB;EACA,MAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;ECAQ,MAAMC,OAAN,CAAc;EAO3BC,EAAAA,WAAW,GAAsE;EAA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AN,CAAW8f,OAAX,KAAuB,SAA3B,EAAsC;EAC3CqR,MAAAA,mBAAmB,CAACxU,KAAK,CAAC3c,IAAP,EAAa,IAAb,CAAnB;EACD;EACF;EACF;;+CAuGe;EACd,MAAIqP,WAAW,GAAG,0DAAcpX,WAAhC;;EACA,MAAI+H,IAAI,GAAG,EAAX;EACAA,EAAAA,IAAI,GAAG,0DAAcqX,qBAAd,CAAoCrX,IAApC,EAA0C7C,SAA1C,CAAP;EACAkS,EAAAA,WAAW,GAAGzD,QAAQ,CAACyD,WAAD,EAAc,MAAd,EAAsBpV,QAAtB,CAAtB;EACAoV,EAAAA,WAAW,GAAGzD,QAAQ,CAACyD,WAAD,EAAc,GAAd,EAAmB3C,YAAY,CAAC7M,IAAI,CAACC,SAAL,CAAeE,IAAf,CAAD,8BAAuB,IAAvB,wBAA/B,CAAtB;;EAEA,4DAAcwX,kBAAd,CAAiCnI,WAAjC,EAA8CpN,GAAG,CAACgC,YAAlD;EACD;;yDAEoB;EACnB,SAAQ,OAAOrC,MAAM,CAACuqC,MAAd,KAAyB,WAAzB,IAAwCvqC,MAAM,CAACuqC,MAAP,CAAcC,IAAd,KAAuB,YAAvE;EACD;;yDAMmBpsC,MAAM;EACxB,MAAI,KAAKqlC,wBAAL,EAAJ,EAAqC;EACnCrlC,IAAAA,IAAI,CAAC+9B,KAAL,GAAa,IAAb;EACD;EACF;;QC5xBGruB,SAAS,GAAG,IAAI28B,SAAJ,CAAczqC,MAAM,CAAC8N,SAArB;EAElB9N,MAAM,CAAC8N,SAAP,GAAmB9N,MAAM,CAAC+N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/modules/visualBuilder/pageBuilder.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/notification.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {}\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n // Initialize array\n var array = []\n\n // Check if globalProfileMap is null, initialize if needed\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n // Check if the value to be set is either string or number\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = $ct.globalProfileMap[propKey]\n array.push(typeof propVal === 'number' ? propVal : propVal.toLowerCase())\n } else {\n $ct.globalProfileMap[propKey] = propVal\n }\n } else {\n // Check if propVal is an array\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = Array.isArray($ct.globalProfileMap[propKey]) ? $ct.globalProfileMap[propKey] : [$ct.globalProfileMap[propKey]]\n }\n\n // Check for case-sensitive inputs and filter the same ones\n for (var i = 0; i < propVal.length; i++) {\n if (typeof propVal[i] === 'number' && !array.includes(propVal[i])) {\n array.push(propVal[i])\n } else if (typeof propVal[i] === 'string' && !array.includes(propVal[i].toLowerCase())) {\n array.push(propVal[i].toLowerCase())\n } else if ((typeof propVal[i] === 'number' && array.includes(propVal[i])) || (typeof propVal[i] === 'string' && array.includes(propVal[i].toLowerCase()))) {\n console.error('Values already included')\n } else {\n console.error('Array supports only string or number type values')\n }\n }\n\n // Update globalProfileMap with the array\n $ct.globalProfileMap[propKey] = array\n }\n\n // Save to local storage or cookie\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Call the sendMultiValueData function\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n var index = $ct.globalProfileMap[propKey].indexOf(propVal)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n } else {\n for (var k = 0; k < propVal.length; k++) {\n var idx = $ct.globalProfileMap[propKey].indexOf(propVal[k])\n if (idx !== -1) {\n $ct.globalProfileMap[propKey].splice(idx, 1)\n }\n }\n }\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n // console.log('Raise notification clicked event for ', item)\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","export const initialiseCTBuilder = (url, variant, details) => {\n document.addEventListener('DOMContentLoaded', () => onContentLoad(url, variant, details))\n}\n\nlet container\n\nfunction onContentLoad (url, variant, details) {\n document.body.innerHTML = ''\n container = document.createElement('div')\n container.id = 'overlayDiv'\n container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form\n container.style.display = 'flex'\n document.body.appendChild(container)\n const overlayPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js'\n loadOverlayScript(overlayPath, url, variant, details)\n .then(() => {\n console.log('Overlay script loaded successfully.')\n })\n .catch((error) => {\n console.error('Error loading overlay script:', error)\n })\n loadCSS()\n loadTypeKit()\n}\n\nfunction loadCSS () {\n var link = document.createElement('link')\n link.rel = 'stylesheet'\n link.type = 'text/css'\n link.href = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css'\n document.head.appendChild(link)\n}\n\nfunction loadOverlayScript (overlayPath, url, variant, details) {\n return new Promise((resolve, reject) => {\n var script = document.createElement('script')\n script.type = 'module'\n script.src = overlayPath\n script.onload = function () {\n if (typeof window.Overlay === 'function') {\n window.Overlay('#overlayDiv', url, variant, details)\n resolve()\n } else {\n reject(new Error('ContentLayout not found in overlay.js'))\n }\n }\n script.onerror = function (error) {\n reject(error)\n }\n document.head.appendChild(script)\n })\n}\n\nfunction loadTypeKit () {\n var config = {\n kitId: 'eqj6nom',\n scriptTimeout: 3000,\n async: true\n }\n\n var d = document\n var h = d.documentElement\n var t = setTimeout(function () {\n h.className = h.className.replace(/\\bwf-loading\\b/g, '') + ' wf-inactive'\n // $(document).trigger(\"TypeKitReady\");\n }, config.scriptTimeout)\n var tk = d.createElement('script')\n var f = false\n var s = d.getElementsByTagName('script')[0]\n var a\n\n h.className += ' wf-loading'\n tk.src = 'https://use.typekit.net/' + config.kitId + '.js'\n tk.async = true\n tk.onload = tk.onreadystatechange = function () {\n a = this.readyState\n if (f || (a && a !== 'complete' && a !== 'loaded')) return\n f = true\n clearTimeout(t)\n try {\n // eslint-disable-next-line no-undef\n Typekit.load(config)\n } catch (e) {}\n }\n\n s.parentNode.insertBefore(tk, s)\n}\n\nexport const renderVisualBuilder = (targetingMsgJson, isPreview) => {\n const details = isPreview ? targetingMsgJson.details[0] : targetingMsgJson.display.details[0]\n const siteUrl = Object.keys(details)[0]\n const selectors = details[siteUrl]\n\n if (siteUrl === window.location.href.split('?')[0]) {\n for (const selector in selectors) {\n const element = document.querySelector(selector)\n if (element) {\n if (selectors[selector].html) {\n element.outerHTML = selectors[selector].html\n } else {\n // Update json data\n dispatchJsonData(targetingMsgJson, selectors[selector])\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n } else {\n let count = 0\n const intervalId = setInterval(() => {\n const retryElement = document.querySelector(selector)\n if (retryElement) {\n if (selectors[selector].html) {\n retryElement.outerHTML = selectors[selector].html\n } else {\n // Update json data\n dispatchJsonData(targetingMsgJson, selectors[selector])\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n clearInterval(intervalId)\n } else {\n count++\n if (count >= 20) {\n console.log(`No element present on DOM with selector '${selector}'.`)\n clearInterval(intervalId)\n }\n }\n }, 500)\n }\n }\n }\n}\n\nfunction dispatchJsonData (targetingMsgJson, selector) {\n const inaObj = {}\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (selector.json != null) {\n inaObj.json = selector.json\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display_buider', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n}\n","import {\n addToLocalProfileMap,\n arp,\n getCampaignObject,\n saveCampaignObject,\n closeIframe\n} from './clevertap'\n\nimport {\n CAMP_COOKIE_NAME,\n DISPLAY,\n GLOBAL,\n EV_COOKIE,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n WZRK_PREFIX,\n WZRK_ID,\n CAMP_COOKIE_G,\n GCOOKIE_NAME\n} from './constants'\n\nimport {\n getNow,\n getToday\n} from './datetime'\n\nimport {\n compressToBase64\n} from './encoder'\n\nimport { StorageManager, $ct } from './storage'\nimport RequestDispatcher from './requestDispatcher'\nimport { CTWebPersonalisationBanner } from './web-personalisation/banner'\nimport { CTWebPersonalisationCarousel } from './web-personalisation/carousel'\nimport { CTWebPopupImageOnly } from './web-popupImageonly/popupImageonly'\nimport { checkAndRegisterWebInboxElements, initializeWebInbox, processWebInboxSettings, hasWebInboxSettingsInLS, processInboxNotifs } from '../modules/web-inbox/helper'\nimport { renderVisualBuilder } from '../modules/visualBuilder/pageBuilder'\n\nconst _tr = (msg, {\n device,\n session,\n request,\n logger\n}) => {\n const _device = device\n const _session = session\n const _request = request\n const _logger = logger\n let _wizCounter = 0\n\n // msg = {\n // arp: {\n // j_n: 'Zw==',\n // i_n: 'Y2NmewICAw==',\n // d_ts: 0,\n // dh: 0,\n // v: 1,\n // j_s: '{ }',\n // id: 'WWW-WWW-WWRZ',\n // e_ts: 0,\n // r_ts: 1649748826,\n // rc_w: 60,\n // rc_n: 5\n // },\n // inapp_notifs: [\n // {\n // msgContent: {\n // templateType: 'point-and-click',\n // type: 4\n // },\n // display: {\n // divId: 'hero-banner',\n // details: [{\n // 'http://localhost:3000/': {\n // '.heroDi1v': {\n // html: 'Hello Sonam'\n // },\n // '#selector_2': {\n // html: '

Hello Sonam

'\n // },\n // '.heroDiv2': {\n // json: {\n // name: 'Sonam',\n // identity: 1234\n // }\n // }\n // }\n // }],\n // wtarget_type: 2,\n // wmc: 1,\n // ff: 'Desktop'\n // },\n // wzrk_id: '1655316906_20220620',\n // wzrk_pivot: 'wzrk_default'\n // }\n // ]\n // }\n // Campaign House keeping\n const doCampHouseKeeping = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const today = getToday()\n\n const incrCount = (obj, campaignId, excludeFromFreqCaps) => {\n let currentCount = 0\n let totalCount = 0\n if (obj[campaignId] != null) {\n currentCount = obj[campaignId]\n }\n currentCount++\n if (obj.tc != null) {\n totalCount = obj.tc\n }\n // if exclude from caps then dont add to total counts\n if (excludeFromFreqCaps < 0) {\n totalCount++\n }\n\n obj.tc = totalCount\n obj[campaignId] = currentCount\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n delete sessionStorage[CAMP_COOKIE_NAME]\n var campTypeObj = {}\n const campObj = getCampaignObject()\n if (targetingMsgJson.display.wtarget_type === 3 && campObj.hasOwnProperty('wi')) {\n campTypeObj = campObj.wi\n } else if ((targetingMsgJson.display.wtarget_type === 0 || targetingMsgJson.display.wtarget_type === 1) && campObj.hasOwnProperty('wp')) {\n campTypeObj = campObj.wp\n } else {\n campTypeObj = {}\n }\n if (campObj.hasOwnProperty('global')) {\n campTypeObj.wp = campObj\n }\n // global session limit. default is 1\n if (targetingMsgJson[DISPLAY].wmc == null) {\n targetingMsgJson[DISPLAY].wmc = 1\n }\n\n // global session limit for web inbox. default is 1\n if (targetingMsgJson[DISPLAY].wimc == null) {\n targetingMsgJson[DISPLAY].wimc = 1\n }\n\n var excludeFromFreqCaps = -1 // efc - Exclude from frequency caps\n let campaignSessionLimit = -1 // mdc - Once per session\n let campaignDailyLimit = -1 // tdc - Once per day\n let campaignTotalLimit = -1 // tlc - Once per user for the duration of campaign\n let totalDailyLimit = -1\n let totalSessionLimit = -1 // wmc - Web Popup Global Session Limit\n let totalInboxSessionLimit = -1 // wimc - Web Inbox Global Session Limit\n\n if (targetingMsgJson[DISPLAY].efc != null) { // exclude from frequency cap\n excludeFromFreqCaps = parseInt(targetingMsgJson[DISPLAY].efc, 10)\n }\n if (targetingMsgJson[DISPLAY].mdc != null) { // Campaign Session Limit\n campaignSessionLimit = parseInt(targetingMsgJson[DISPLAY].mdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tdc != null) { // No of web popups in a day per campaign\n campaignDailyLimit = parseInt(targetingMsgJson[DISPLAY].tdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tlc != null) { // Total lifetime count\n campaignTotalLimit = parseInt(targetingMsgJson[DISPLAY].tlc, 10)\n }\n if (targetingMsgJson[DISPLAY].wmp != null) { // No of campaigns per day\n totalDailyLimit = parseInt(targetingMsgJson[DISPLAY].wmp, 10)\n }\n if (targetingMsgJson[DISPLAY].wmc != null) { // No of campaigns per session\n totalSessionLimit = parseInt(targetingMsgJson[DISPLAY].wmc, 10)\n }\n\n if (targetingMsgJson[DISPLAY].wimc != null) { // No of inbox campaigns per session\n totalInboxSessionLimit = parseInt(targetingMsgJson[DISPLAY].wimc, 10)\n }\n // session level capping\n var sessionObj = campTypeObj[_session.sessionId]\n if (sessionObj) {\n const campaignSessionCount = sessionObj[campaignId]\n const totalSessionCount = sessionObj.tc\n // dnd\n if (campaignSessionCount === 'dnd' && !$ct.dismissSpamControl) {\n return false\n }\n\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n // Inbox session\n if (totalInboxSessionLimit > 0 && totalSessionCount >= totalInboxSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n } else {\n // session\n if (totalSessionLimit > 0 && totalSessionCount >= totalSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n }\n\n // campaign session\n if (campaignSessionLimit > 0 && campaignSessionCount >= campaignSessionLimit) {\n return false\n }\n } else {\n sessionObj = {}\n campTypeObj[_session.sessionId] = sessionObj\n }\n\n // daily level capping\n var dailyObj = campTypeObj[today]\n if (dailyObj != null) {\n const campaignDailyCount = dailyObj[campaignId]\n const totalDailyCount = dailyObj.tc\n // daily\n if (totalDailyLimit > 0 && totalDailyCount >= totalDailyLimit && excludeFromFreqCaps < 0) {\n return false\n }\n // campaign daily\n if (campaignDailyLimit > 0 && campaignDailyCount >= campaignDailyLimit) {\n return false\n }\n } else {\n dailyObj = {}\n campTypeObj[today] = dailyObj\n }\n\n var globalObj = campTypeObj[GLOBAL]\n if (globalObj != null) {\n const campaignTotalCount = globalObj[campaignId]\n // campaign total\n if (campaignTotalLimit > 0 && campaignTotalCount >= campaignTotalLimit) {\n return false\n }\n } else {\n globalObj = {}\n campTypeObj[GLOBAL] = globalObj\n }\n }\n // delay\n if (targetingMsgJson[DISPLAY].delay != null && targetingMsgJson[DISPLAY].delay > 0) {\n const delay = targetingMsgJson[DISPLAY].delay\n targetingMsgJson[DISPLAY].delay = 0\n setTimeout(_tr, delay * 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n return false\n }\n\n incrCount(sessionObj, campaignId, excludeFromFreqCaps)\n incrCount(dailyObj, campaignId, excludeFromFreqCaps)\n incrCount(globalObj, campaignId, excludeFromFreqCaps)\n\n let campKey = 'wp'\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n campKey = 'wi'\n }\n // get ride of stale sessions and day entries\n const newCampObj = {}\n newCampObj[_session.sessionId] = sessionObj\n newCampObj[today] = dailyObj\n newCampObj[GLOBAL] = globalObj\n saveCampaignObject({ [campKey]: newCampObj })\n }\n\n const getCookieParams = () => {\n const gcookie = _device.getGuid()\n const scookieObj = _session.getSessionCookieObject()\n return '&t=wc&d=' + encodeURIComponent(compressToBase64(gcookie + '|' + scookieObj.p + '|' + scookieObj.s))\n }\n\n const setupClickEvent = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n if (onClick !== '' && onClick != null) {\n let ctaElement\n let jsCTAElements\n if (isLegacy) {\n ctaElement = contentDiv\n } else if (contentDiv !== null) {\n jsCTAElements = contentDiv.getElementsByClassName('jsCT_CTA')\n if (jsCTAElements != null && jsCTAElements.length === 1) {\n ctaElement = jsCTAElements[0]\n }\n }\n const jsFunc = targetingMsgJson.display.jsFunc\n const isPreview = targetingMsgJson.display.preview\n if (isPreview == null) {\n onClick += getCookieParams()\n }\n\n if (ctaElement != null) {\n ctaElement.onclick = () => {\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n if (isPreview == null) {\n RequestDispatcher.fireRequest(onClick)\n }\n invokeExternalJs(jsFunc, targetingMsgJson)\n // close iframe. using -1 for no campaignId\n closeIframe('-1', divId, _session.sessionId)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n }\n }\n\n const invokeExternalJs = (jsFunc, targetingMsgJson) => {\n const func = window.parent[jsFunc]\n if (typeof func === 'function') {\n if (targetingMsgJson.display.kv != null) {\n func(targetingMsgJson.display.kv)\n } else {\n func()\n }\n }\n }\n\n const setupClickUrl = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n incrementImpression(targetingMsgJson)\n setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy)\n }\n\n const incrementImpression = (targetingMsgJson) => {\n const data = {}\n data.type = 'event'\n data.evtName = NOTIFICATION_VIEWED\n data.evtData = { [WZRK_ID]: targetingMsgJson.wzrk_id }\n if (targetingMsgJson.wzrk_pivot) {\n data.evtData = { ...data.evtData, wzrk_pivot: targetingMsgJson.wzrk_pivot }\n }\n _request.processEvent(data)\n }\n\n const renderPersonalisationBanner = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const bannerEl = document.createElement('ct-web-personalisation-banner')\n bannerEl.msgId = targetingMsgJson.wzrk_id\n bannerEl.pivotId = targetingMsgJson.wzrk_pivot\n bannerEl.divHeight = targetingMsgJson.display.divHeight\n bannerEl.details = targetingMsgJson.display.details[0]\n const containerEl = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n containerEl.innerHTML = ''\n containerEl.appendChild(bannerEl)\n }\n\n const renderPersonalisationCarousel = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-carousel') === undefined) {\n customElements.define('ct-web-personalisation-carousel', CTWebPersonalisationCarousel)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const carousel = document.createElement('ct-web-personalisation-carousel')\n carousel.target = targetingMsgJson\n const container = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n container.innerHTML = ''\n container.appendChild(carousel)\n }\n\n const renderPopUpImageOnly = (targetingMsgJson) => {\n const divId = 'wzrkImageOnlyDiv'\n const popupImageOnly = document.createElement('ct-web-popup-imageonly')\n popupImageOnly.session = _session\n popupImageOnly.target = targetingMsgJson\n const containerEl = document.getElementById(divId)\n containerEl.innerHTML = ''\n containerEl.style.visibility = 'hidden'\n containerEl.appendChild(popupImageOnly)\n }\n\n const renderFooterNotification = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const displayObj = targetingMsgJson.display\n\n if (displayObj.wtarget_type === 2) { // Handling Web Native display\n // Logic for kv pair data\n if (targetingMsgJson.msgContent.type === 1) {\n const inaObj = {}\n\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.msgContent.kv != null) {\n inaObj.kv = targetingMsgJson.msgContent.kv\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n return\n }\n }\n if (displayObj.layout === 1) { // Handling Web Exit Intent\n return showExitIntent(undefined, targetingMsgJson)\n }\n if (displayObj.layout === 3) { // Handling Web Popup Image Only\n const divId = 'wzrkImageOnlyDiv'\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById(divId) != null || document.getElementById('intentPreview') != null) {\n return\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n document.body.appendChild(msgDiv)\n if (customElements.get('ct-web-popup-imageonly') === undefined) {\n customElements.define('ct-web-popup-imageonly', CTWebPopupImageOnly)\n }\n return renderPopUpImageOnly(targetingMsgJson)\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const divId = 'wizParDiv' + displayObj.layout\n\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n if (document.getElementById(divId) != null) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = divId\n const isBanner = displayObj.layout === 2\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n const viewHeight = window.innerHeight\n const viewWidth = window.innerWidth\n let legacy = false\n\n if (!isBanner) {\n const marginBottom = viewHeight * 5 / 100\n var contentHeight = 10\n let right = viewWidth * 5 / 100\n let bottomPosition = contentHeight + marginBottom\n let width = viewWidth * 30 / 100 + 20\n let widthPerct = 'width:30%;'\n // for small devices - mobile phones\n if ((/mobile/i.test(navigator.userAgent) || (/mini/i.test(navigator.userAgent))) && /iPad/i.test(navigator.userAgent) === false) {\n width = viewWidth * 85 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:80%;'\n // medium devices - tablets\n } else if ('ontouchstart' in window || (/tablet/i.test(navigator.userAgent))) {\n width = viewWidth * 50 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:50%;'\n }\n // legacy footer notif\n if (displayObj.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden; bottom:' + bottomPosition + 'px !important;width:' + width + 'px !important;right:' + right + 'px !important;position:fixed;z-index:2147483647;')\n } else {\n msgDiv.setAttribute('style', widthPerct + displayObj.iFrameStyle)\n }\n } else {\n msgDiv.setAttribute('style', displayObj.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n\n const borderRadius = displayObj.br === false ? '0' : '8'\n\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, leftTd, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n leftTd = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n leftTd = '#f4f4f4'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"\"\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'\" + divId + \"');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"\" +\n // \"\"+\n '' + imageTd + \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
'\n html = css + title + body\n }\n\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n const ifrm = (iframe.contentWindow) ? iframe.contentWindow : (iframe.contentDocument.document) ? iframe.contentDocument.document : iframe.contentDocument\n const doc = ifrm.document\n\n // Dispatch event for popup box/banner close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n doc.open()\n doc.write(html)\n\n if (displayObj['custom-editor']) {\n appendScriptForCustomEvent(targetingMsgJson, doc)\n }\n doc.close()\n\n const adjustIFrameHeight = () => {\n // adjust iframe and body height of html inside correctly\n contentHeight = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv').scrollHeight\n if (displayObj['custom-editor'] !== true && !isBanner) {\n contentHeight += 25\n }\n document.getElementById('wiz-iframe').contentDocument.body.style.margin = '0px'\n document.getElementById('wiz-iframe').style.height = contentHeight + 'px'\n }\n\n const ua = navigator.userAgent.toLowerCase()\n if (ua.indexOf('safari') !== -1) {\n if (ua.indexOf('chrome') > -1) {\n iframe.onload = () => {\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n } else {\n let inDoc = iframe.contentDocument || iframe.contentWindow\n if (inDoc.document) inDoc = inDoc.document\n // safari iphone 7+ needs this.\n adjustIFrameHeight()\n const _timer = setInterval(() => {\n if (inDoc.readyState === 'complete') {\n clearInterval(_timer)\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }, 10)\n }\n } else {\n iframe.onload = () => {\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }\n }\n\n const appendScriptForCustomEvent = (targetingMsgJson, doc) => {\n const script = doc.createElement('script')\n script.innerHTML = `\n const ct__camapignId = '${targetingMsgJson.wzrk_id}';\n const ct__formatVal = (v) => {\n return v && v.trim().substring(0, 20);\n }\n const ct__parentOrigin = window.parent.origin;\n document.body.addEventListener('click', (event) => {\n const elem = event.target.closest?.('a[wzrk_c2a], button[wzrk_c2a]');\n if (elem) {\n const {innerText, id, name, value, href} = elem;\n const clickAttr = elem.getAttribute('onclick') || elem.getAttribute('click');\n const onclickURL = clickAttr?.match(/(window.open)[(\\](\\\"|')(.*)(\\\"|',)/)?.[3] || clickAttr?.match(/(location.href *= *)(\\\"|')(.*)(\\\"|')/)?.[3];\n const props = {innerText, id, name, value};\n let msgCTkv = Object.keys(props).reduce((acc, c) => {\n const formattedVal = ct__formatVal(props[c]);\n formattedVal && (acc['wzrk_click_' + c] = formattedVal);\n return acc;\n }, {});\n if(onclickURL) { msgCTkv['wzrk_click_' + 'url'] = onclickURL; }\n if(href) { msgCTkv['wzrk_click_' + 'c2a'] = href; }\n const notifData = { msgId: ct__camapignId, msgCTkv, pivotId: '${targetingMsgJson.wzrk_pivot}' };\n window.parent.clevertap.renderNotificationClicked(notifData);\n }\n });\n `\n doc.body.appendChild(script)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe-intent'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n const ifrm = (iframe.contentWindow) ? iframe.contentWindow : (iframe.contentDocument.document) ? iframe.contentDocument.document : iframe.contentDocument\n const doc = ifrm.document\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n doc.open()\n doc.write(html)\n if (targetingMsgJson.display['custom-editor']) {\n appendScriptForCustomEvent(targetingMsgJson, doc)\n }\n doc.close()\n\n const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n this.#logger.error('Error subscribing: ' + error)\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\n// import { initialiseCTBuilder } from './modules/visualBuilder/pageBuilder'\nimport { initialiseCTBuilder, renderVisualBuilder } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token) {\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n #handleMessageEvent (event) {\n if (event.data && event.data.message) {\n if (event.data.message === 'Dashboard' && event.data.url) {\n initialiseCTBuilder(event.data.url, event.data.variant ?? null, event.data.details ?? {})\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n }\n }\n\n pageChanged () {\n const search = window.location.search\n const parentWindow = window.opener\n\n if (search === '?ctBuilder') {\n // open in visual builder mode\n console.log('open in visual builder mode')\n window.addEventListener('message', this.#handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('builder', '*')\n }\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', this.#handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('preview', '*')\n }\n return\n }\n\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","constructor","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","dataPostPEURL","dataPostURL","recorderURL","emailURL","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","save","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","read","data","getItem","parse","e","remove","removeItem","removeCookie","name","domain","cookieStr","document","cookie","createCookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","readCookie","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","saveToLSorCookie","property","location","hostname","$ct","globalCache","readFromLSorCookie","trim","err","createBroadCookie","broadDomain","domainParts","testBroadDomain","testCookieName","tempCookie","getMetaProp","metaObj","setMetaProp","wzrkMetaObj","getAndClearMetaProp","setInstantDeleteFlagInK","k","flag","backupEvent","reqNo","backupArr","q","debug","removeBackup","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","get","item","saveCacheToLS","set","allKeys","objToArray","index","temp","getKey","getSecondLastKey","keysArr","getLastKey","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","s","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","sessionObj","getSessionCookieObject","kIdFromLS","guidFromLRUCache","lastK","lastGUID","unregisterTokenForGuid","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","_processOldValues","getDetails","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","fireRequest","skipARP","sendOULFlag","getDelayFrequency","account","randomDelay","random","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","ProfileHandler","profilesArr","getAttribute","propName","_handleIncrementDecrementValue","command","tz","profile","addSystemDataToObject","addFlags","compressedData","saveAndFireRequest","_handleMultiValueSet","arrayVal","array","toLowerCase","sendMultiValueData","_handleMultiValueAdd","propKey","propVal","_handleMultiValueRemove","_handleMultiValueDelete","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","clear","addToK","ids","g","kId","anonymousUser","foundInCache","gFromCache","Identity","cookieName","loginArr","pop","processProfile","CTWebPersonalisationBanner","HTMLElement","_details","shadow","attachShadow","mode","details","renderBanner","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","target","renderCarousel","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","button","setInterval","sliderTime","goTo","prev","cur","CTWebPopupImageOnly","_session","popup","container","resizeObserver","renderImageOnlyPopup","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","Message","config","message","wrapper","snackBar","renderMessage","createEl","part","_el","msg","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","raiseClickedEvent","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","contains","setBadgeStyle","msgCount","incomingMessages","msgs","updateInboxMessages","incomingMessagesForPreview","previewMsgs","now","buildUIForMessages","updateUnviewedBadgeCounter","connectedCallback","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","addMsgsToInboxFromLS","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","deleteMsgsFromUI","getInboxMessages","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","top","right","getBoundingClientRect","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","inbox_notifs","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","initialiseCTBuilder","variant","onContentLoad","position","overlayPath","loadOverlayScript","then","catch","loadCSS","loadTypeKit","link","rel","head","script","src","onload","Overlay","Error","onerror","kitId","scriptTimeout","h","documentElement","className","tk","onreadystatechange","Typekit","load","renderVisualBuilder","targetingMsgJson","siteUrl","selectors","selector","element","querySelector","outerHTML","dispatchJsonData","intervalId","retryElement","inaObj","json","kvPairsEvent","CustomEvent","dispatchEvent","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","onclick","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","pointerCss","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","ifrm","contentWindow","contentDocument","doc","closeCampaign","Event","write","appendScriptForCustomEvent","close","adjustIFrameHeight","scrollHeight","margin","ua","inDoc","_timer","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","getTotalVisits","visitCount","getLastVisit","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","info","debugPE","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","getTimeElapsed","sessionStart","getPageCount","seqNo","requestTime","RequestManager","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","post","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","_enableWebPush","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","skipDialog","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","getValue","getdefaultValue","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","addValueChangedCallback","removeValueChangedCallback","clearStartFlag","VariableStore","syncVariables","onSyncSuccess","onSyncFailure","meta","r","status","fetchVariables","onFetchCallback","addVariablesChangedCallback","callback","addOneTimeVariablesChangedCallback","removeVariablesChangedCallback","removeOneTimeVariablesChangedCallback","callBack","CleverTap","spa","isSpa","bind","enablePersonalization","_isPersonalisationActive","ReqestManager","onUserLogin","privacy","notifications","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","handleDecrementValue","setMultiValuesForKey","addMultiValueForKey","addMultiValuesForKey","removeMultiValueForKey","removeMultiValuesForKey","removeValueForKey","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","sendLocationData","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","elements","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","parentWindow","opener","postMessage","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","setOffline","arg","defineVariable","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;EAAO,MAAMA,aAAa,GAAG,oBAAtB;EACA,MAAMC,eAAe,GAAG,QAAxB;EACA,MAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;ECAQ,MAAMC,OAAN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;EACAA,EAAAA,IAAI,GAAG,0DAAcqX,qBAAd,CAAoCrX,IAApC,EAA0C7C,SAA1C,CAAP;EACAkS,EAAAA,WAAW,GAAGzD,QAAQ,CAACyD,WAAD,EAAc,MAAd,EAAsBpV,QAAtB,CAAtB;EACAoV,EAAAA,WAAW,GAAGzD,QAAQ,CAACyD,WAAD,EAAc,GAAd,EAAmB3C,YAAY,CAAC7M,IAAI,CAACC,SAAL,CAAeE,IAAf,CAAD,8BAAuB,IAAvB,wBAA/B,CAAtB;;EAEA,4DAAcwX,kBAAd,CAAiCnI,WAAjC,EAA8CpN,GAAG,CAACgC,YAAlD;EACD;;yDAEoB;EACnB,SAAQ,OAAOrC,MAAM,CAACwqC,MAAd,KAAyB,WAAzB,IAAwCxqC,MAAM,CAACwqC,MAAP,CAAcC,IAAd,KAAuB,YAAvE;EACD;;yDAMmBrsC,MAAM;EACxB,MAAI,KAAKslC,wBAAL,EAAJ,EAAqC;EACnCtlC,IAAAA,IAAI,CAACi+B,KAAL,GAAa,IAAb;EACD;EACF;;QC5xBGvuB,SAAS,GAAG,IAAI48B,SAAJ,CAAc1qC,MAAM,CAAC8N,SAArB;EAElB9N,MAAM,CAAC8N,SAAP,GAAmB9N,MAAM,CAAC+N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file diff --git a/clevertap.min.js b/clevertap.min.js index 39374c7a..f2594c02 100644 --- a/clevertap.min.js +++ b/clevertap.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).clevertap=t()}(this,(function(){"use strict";var e=0;function t(t){return"__private_"+e+++"_"+t}function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}const o="clevertap-prod.com",n="https:";var s=t("accountId"),r=t("region"),a=t("targetDomain"),l=t("dcSdkversion"),c=t("token");class d{constructor(){let{id:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";Object.defineProperty(this,s,{writable:!0,value:void 0}),Object.defineProperty(this,r,{writable:!0,value:""}),Object.defineProperty(this,a,{writable:!0,value:o}),Object.defineProperty(this,l,{writable:!0,value:""}),Object.defineProperty(this,c,{writable:!0,value:""}),this.id=e,t&&(this.region=t),i&&(this.targetDomain=i),n&&(this.token=n)}get id(){return i(this,s)[s]}set id(e){i(this,s)[s]=e}get region(){return i(this,r)[r]}set region(e){i(this,r)[r]=e}get dcSDKVersion(){return i(this,l)[l]}set dcSDKVersion(e){i(this,l)[l]=e}get targetDomain(){return i(this,a)[a]}set targetDomain(e){i(this,a)[a]=e}get token(){return i(this,c)[c]}set token(e){i(this,c)[c]=e}get finalTargetDomain(){return this.region?"".concat(this.region,".").concat(this.targetDomain):this.targetDomain===o?"".concat("eu1",".").concat(this.targetDomain):this.targetDomain}get dataPostPEURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/defineVars")}get dataPostURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/a?t=96")}get recorderURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/r?r=1")}get emailURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/e?r=1")}}const h=new RegExp("^\\s+|\\.|:|\\$|'|\"|\\\\|\\s+$","g"),u=new RegExp("^\\s+|'|\"|\\\\|\\s+$","g"),p=new RegExp("'","g"),g="clear",f="Charged ID",v="WZRK_CHARGED_ID",b="WZRK_G",m="WZRK_K",y="WZRK_CAMP",w="WZRK_CAMP_G",C="WZRK_EV",k="WZRK_META",x="WZRK_PR",P="WZRK_ARP",S="WZRK_L",I="global",O="optOut",_="useIP",E="WZRK_X",A="push",L=31536e3,M="wzrk_",T="wzrk_id",R="Notification Viewed",j="Notification Clicked",D="WZRK_FPU",z="WZRK_PSD",B="$incr",N="$add",F="$remove",U="$delete",q="WZRK_INBOX_CONFIG",V="WZRK_INBOX",W=1e3,K="wzrk_fetch",G=["Stayed","UTM Visited","App Launched","Notification Sent",R,j],H=e=>"string"==typeof e||e instanceof String,J=e=>"[object Object]"===Object.prototype.toString.call(e),Z=e=>"object"==typeof e&&e instanceof Date,$=e=>{for(const t in e)if(e.hasOwnProperty(t))return!1;return!0},Y=e=>!isNaN(parseFloat(e))&&isFinite(e),Q=e=>/^-?[\d.]+(?:e-?\d+)?$/.test(e)&&"number"==typeof e,X=e=>null!=e&&"undefined"!==e,ee=(e,t)=>{if("object"!=typeof e){let i;return H(e)?(i=te(e,u),i.length>1024&&(i=i.substring(0,1024),t.reportError(521,i+"... length exceeded 1024 chars. Trimmed."))):i=e,i}for(const i in e)if(e.hasOwnProperty(i)){const o=ee(e[i],t);let n;n=te(i,h),n.length>1024&&(n=n.substring(0,1024),t.reportError(520,n+"... length exceeded 1024 chars. Trimmed.")),delete e[i],e[n]=o}return e},te=(e,t)=>e.replace(t,""),ie=()=>{const e=new Date;return e.getFullYear()+""+e.getMonth()+e.getDay()},oe=()=>Math.floor((new Date).getTime()/1e3),ne=e=>"$D_"+Math.round(e.getTime()/1e3),se=e=>{if(re(e))return"$D_"+e},re=e=>{const t=/^(\d{4})(\d{2})(\d{2})$/.exec(e);if(null==t)return!1;const i=t[3],o=t[2]-1,n=t[1],s=new Date(n,o,i);return s.getDate()==i&&s.getMonth()==o&&s.getFullYear()==n};class ae{static save(e,t){return!(!e||!t)&&(this._isLocalStorageSupported()?(localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),!0):void 0)}static read(e){if(!e)return!1;let t=null;if(this._isLocalStorageSupported()&&(t=localStorage.getItem(e)),null!=t)try{t=JSON.parse(t)}catch(e){}return t}static remove(e){return!!e&&(this._isLocalStorageSupported()?(localStorage.removeItem(e),!0):void 0)}static removeCookie(e,t){let i=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";t&&(i=i+" domain="+t+"; path=/"),document.cookie=i}static createCookie(e,t,i,o){let n="",s="";if(i){const e=new Date;e.setTime(e.getTime()+1e3*i),n="; expires="+e.toGMTString()}o&&(s="; domain="+o),t=encodeURIComponent(t),document.cookie=e+"="+t+n+s+"; path=/"}static readCookie(e){const t=e+"=",i=document.cookie.split(";");for(let e=0;e=0;o--){if(a=0===o?r[o]+a:"."+r[o]+a,this.readCookie(e)){var n="test_"+e+o;if(this.createCookie(n,t,10,a),!this.readCookie(n))continue;this.removeCookie(n,a)}this.createCookie(e,t,i,a);if(this.readCookie(e)==t){s=a,le.broadDomain=s;break}}}else this.createCookie(e,t,i,s)}else this.createCookie(e,t,i,o)}static getMetaProp(e){const t=this.readFromLSorCookie(k);if(null!=t)return t[e]}static setMetaProp(e,t){if(this._isLocalStorageSupported()){let i=this.readFromLSorCookie(k);null==i&&(i={}),void 0===t?delete i[e]:i[e]=t,this.saveToLSorCookie(k,i)}}static getAndClearMetaProp(e){const t=this.getMetaProp(e);return this.setMetaProp(e,void 0),t}static setInstantDeleteFlagInK(){let e=this.readFromLSorCookie(m);null==e&&(e={}),e.flag=!0,this.saveToLSorCookie(m,e)}static backupEvent(e,t,i){let o=this.readFromLSorCookie(S);void 0===o&&(o={}),o[t]={q:e},this.saveToLSorCookie(S,o),i.debug("stored in ".concat(S," reqNo : ").concat(t," -> ").concat(e))}static removeBackup(e,t){const i=this.readFromLSorCookie(S);null!=i&&void 0!==i[e]&&(t.debug("del event: ".concat(e," data-> ").concat(i[e].q)),delete i[e],this.saveToLSorCookie(S,i))}}const le={globalCache:{gcookie:null,REQ_N:0,RESP_N:0},LRU_CACHE:null,globalProfileMap:void 0,globalEventsMap:void 0,blockRequest:!1,isOptInRequest:!1,broadDomain:null,webPushEnabled:null,campaignDivMap:{},currentSessionId:null,wiz_counter:0,notifApi:{notifEnabledFromApi:!1},unsubGroups:[],updatedCategoryLong:null,inbox:null,isPrivacyArrPushed:!1,privacyArray:[],offline:!1,location:null,dismissSpamControl:!1,globalUnsubscribe:!0,flutterVersion:null,variableStore:{}};var ce=t("keyOrder"),de=t("deleteFromObject");class he{constructor(e){Object.defineProperty(this,de,{value:ue}),Object.defineProperty(this,ce,{writable:!0,value:void 0}),this.max=e;let t=ae.readFromLSorCookie(E);if(t){const e={};i(this,ce)[ce]=[],t=t.cache;for(const o in t)t.hasOwnProperty(o)&&(e[t[o][0]]=t[o][1],i(this,ce)[ce].push(t[o][0]));this.cache=e}else this.cache={},i(this,ce)[ce]=[]}get(e){const t=this.cache[e];return t&&(this.cache=i(this,de)[de](e,this.cache),this.cache[e]=t,i(this,ce)[ce].push(e)),this.saveCacheToLS(this.cache),t}set(e,t){const o=this.cache[e],n=i(this,ce)[ce];null!=o?this.cache=i(this,de)[de](e,this.cache):n.length===this.max&&(this.cache=i(this,de)[de](n[0],this.cache)),this.cache[e]=t,i(this,ce)[ce][i(this,ce)[ce]-1]!==e&&i(this,ce)[ce].push(e),this.saveCacheToLS(this.cache)}saveCacheToLS(e){const t=[],o=i(this,ce)[ce];for(const i in o)if(o.hasOwnProperty(i)){const n=[];n.push(o[i]),n.push(e[o[i]]),t.push(n)}ae.saveToLSorCookie(E,{cache:t})}getKey(e){if(null===e)return null;const t=i(this,ce)[ce];for(const i in t)if(t.hasOwnProperty(i)&&this.cache[t[i]]===e)return t[i];return null}getSecondLastKey(){const e=i(this,ce)[ce];return null!=e&&e.length>1?e[e.length-2]:-1}getLastKey(){const e=i(this,ce)[ce].length;if(e)return i(this,ce)[ce][e-1]}}var ue=function(e,t){const o=JSON.parse(JSON.stringify(i(this,ce)[ce])),n={};let s;for(const i in o)o.hasOwnProperty(i)&&(o[i]!==e?n[o[i]]=t[o[i]]:s=i);return o.splice(s,1),i(this,ce)[ce]=JSON.parse(JSON.stringify(o)),n},pe=t("logger"),ge=t("request"),fe=t("device"),ve=t("session");class be{constructor(e){let{logger:t,request:o,device:n,session:s}=e;Object.defineProperty(this,pe,{writable:!0,value:void 0}),Object.defineProperty(this,ge,{writable:!0,value:void 0}),Object.defineProperty(this,fe,{writable:!0,value:void 0}),Object.defineProperty(this,ve,{writable:!0,value:void 0}),i(this,pe)[pe]=t,i(this,ge)[ge]=o,i(this,fe)[fe]=n,i(this,ve)[ve]=s}s(e,t,o,n,s){let r=!1,a=!1;if(window.isOULInProgress&&(o||"undefined"!==n&&n===window.oulReqN)&&(window.isOULInProgress=!1,r=!0),void 0===n&&(n=0),ae.removeBackup(n,i(this,pe)[pe]),n>le.globalCache.REQ_N)return;if(X(i(this,fe)[fe].gcookie)||e&&(a=!0),!X(i(this,fe)[fe].gcookie)||o||"boolean"==typeof s){const n=i(this,ve)[ve].getSessionCookieObject();if(window.isOULInProgress||n.s&&t{if(J(e)){for(var t in e)if(e.hasOwnProperty(t)){if(J(e[t])||Array.isArray(e[t]))return!1;Z(e[t])&&(e[t]=ne(e[t]))}return!0}return!1},Re=(e,t)=>{if(J(e)){for(var i in e)if(e.hasOwnProperty(i))if("Items"===i){if(!Array.isArray(e[i]))return!1;for(var o in e[i].length>50&&t.reportError(522,"Charged Items exceed 50 limit. Actual count: "+e[i].length),e[i])if(e[i].hasOwnProperty(o)&&(!J(e[i][o])||!Te(e[i][o])))return!1}else{if(J(e[i])||Array.isArray(e[i]))return!1;Z(e[i])&&(e[i]=ne(e[i]))}if(H(e[f])||Q(e[f])){const i=e[f]+"";if(void 0===Me&&(Me=ae.readFromLSorCookie(v)),void 0!==Me&&Me.trim()===i.trim())return t.error("Duplicate charged Id - Dropped"+e),!1;Me=i,ae.saveToLSorCookie(v,i)}return!0}return!1};var je=t("logger"),De=t("oldValues"),ze=t("request"),Be=t("isPersonalisationActive"),Ne=t("processEventArray");class Fe extends Array{constructor(e,t){let{logger:o,request:n,isPersonalisationActive:s}=e;super(),Object.defineProperty(this,Ne,{value:Ue}),Object.defineProperty(this,je,{writable:!0,value:void 0}),Object.defineProperty(this,De,{writable:!0,value:void 0}),Object.defineProperty(this,ze,{writable:!0,value:void 0}),Object.defineProperty(this,Be,{writable:!0,value:void 0}),i(this,je)[je]=o,i(this,De)[De]=t,i(this,ze)[ze]=n,i(this,Be)[Be]=s}push(){for(var e=arguments.length,t=new Array(e),o=0;o0;){var t=e.shift();if(!H(t)){i(this,je)[je].error(xe);continue}if(t.length>1024&&(t=t.substring(0,1024),i(this,je)[je].reportError(510,t+"... length exceeded 1024 chars. Trimmed.")),G.includes(t)){i(this,je)[je].reportError(513,t+" is a restricted system event. It cannot be used as an event name.");continue}const o={type:"event"};if(o.evtName=te(t,h),0!==e.length){const n=e.shift();if(J(n)){if("Charged"===t){if(!Re(n,i(this,je)[je])){i(this,je)[je].reportError(511,"Charged event structure invalid. Not sent.");continue}}else if(!Te(n)){i(this,je)[je].reportError(512,t+" event structure invalid. Not sent.");continue}o.evtData=n}else e.unshift(n)}i(this,ze)[ze].processEvent(o)}};const qe=e=>{const t={},i=e.indexOf("?");if(i>1){const o=e.substring(i+1);let n;const s=/\+/g,r=/([^&=]+)=?([^&]*)/g,a=function(e){let t=e.replace(s," ");try{t=decodeURIComponent(t)}catch(e){}return t};for(n=r.exec(o);n;)t[a(n[1])]=a(n[2]),n=r.exec(o)}return t},Ve=(e,t,i)=>e+"&"+t+"="+encodeURIComponent(i),We=()=>window.location.hostname,Ke=(e,t)=>(t&&"function"==typeof t.debug&&t.debug("dobj:"+e),He(e)),Ge=(()=>{let e="",t=0;for(t=0;t<=25;t++)e+=String.fromCharCode(t+65);for(t=0;t<=25;t++)e+=String.fromCharCode(t+97);for(t=0;t<10;t++)e+=t;return e+"+/="})(),He=e=>{if(null==e)return"";var t,i,o,n,s,r,a,l="",c=0;for(e=(e=>{if(null==e)return"";let t,i,o,n={},s={},r="",a="",l="",c=2,d=3,h=2,u="",p=0,g=0,f=String.fromCharCode;for(o=0;o>=1}else{for(i=1,t=0;t>=1}c--,0==c&&(c=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;c--,0==c&&(c=Math.pow(2,h),h++),n[a]=d++,l=String(r)}if(""!==l){if(Object.prototype.hasOwnProperty.call(s,l)){if(l.charCodeAt(0)<256){for(t=0;t>=1}else{for(i=1,t=0;t>=1}c--,0==c&&(c=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;c--,0==c&&(c=Math.pow(2,h),h++)}for(i=2,t=0;t>=1;for(;;){if(p<<=1,15==g){u+=f(p);break}g++}return u})(e);c<2*e.length;)c%2==0?(t=e.charCodeAt(c/2)>>8,i=255&e.charCodeAt(c/2),o=c/2+1>8:NaN):(t=255&e.charCodeAt((c-1)/2),(c+1)/2>8,o=255&e.charCodeAt((c+1)/2)):i=o=NaN),c+=3,n=t>>2,s=(3&t)<<4|i>>4,r=(15&i)<<2|o>>6,a=63&o,isNaN(i)?r=a=64:isNaN(o)&&(a=64),l=l+Ge.charAt(n)+Ge.charAt(s)+Ge.charAt(r)+Ge.charAt(a);return l};var Je=t("fireRequest"),Ze=t("dropRequestDueToOptOut"),$e=t("addUseIPToRequest"),Ye=t("addARPToRequest");class Qe{constructor(){this.networkRetryCount=0,this.minDelayFrequency=0}static fireRequest(e,t,o,n){i(this,Je)[Je](e,1,t,o,n)}getDelayFrequency(){if(this.logger.debug("Network retry #"+this.networkRetryCount),this.networkRetryCount<10)return this.logger.debug(this.account.id,"Failure count is "+this.networkRetryCount+". Setting delay frequency to 1s"),this.minDelayFrequency=W,this.minDelayFrequency;if(null==this.account.region)return this.logger.debug(this.account.id,"Setting delay frequency to 1s"),W;{const e=1e3*(Math.floor(10*Math.random())+1);return this.minDelayFrequency+=e,this.minDelayFrequency<6e5?(this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency):(this.minDelayFrequency=W,this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency)}}}Qe.logger=void 0,Qe.device=void 0,Qe.account=void 0,Object.defineProperty(Qe,Je,{value:function(e,t,o,n,s){var r,a;if(i(this,Ze)[Ze]())return void this.logger.debug("req dropped due to optout cookie: "+this.device.gcookie);if(X(this.device.gcookie)||(le.blockRequest=!0),s&&s===K)!X(this.device.gcookie)&&le.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(this.networkRetryCount)),i(this,Je)[Je](e,void 0,o,n)}),this.getDelayFrequency());else if(!X(this.device.gcookie)&&le.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(t)),i(this,Je)[Je](e,t+1,o,n)}),50);if(n?window.isOULInProgress=!0:(X(this.device.gcookie)&&(e=Ve(e,"gc",this.device.gcookie)),e=i(this,Ye)[Ye](e,o)),e=Ve(e,"tries",t),e=i(this,$e)[$e](e),e=Ve(e,"r",(new Date).getTime()),(null===(r=window.clevertap)||void 0===r?void 0:r.hasOwnProperty("plugin"))||(null===(a=window.wizrocket)||void 0===a?void 0:a.hasOwnProperty("plugin"))){const t=window.clevertap.plugin||window.wizrocket.plugin;e=Ve(e,"ct_pl",t)}-1!==e.indexOf("chrome-extension:")&&(e=e.replace("chrome-extension:","https:"));for(var l=document.getElementsByClassName("ct-jp-cb");l[0]&&l[0].parentNode;)l[0].parentNode.removeChild(l[0]);const c=document.createElement("script");c.setAttribute("type","text/javascript"),c.setAttribute("src",e),c.setAttribute("class","ct-jp-cb"),c.setAttribute("rel","nofollow"),c.async=!0,document.getElementsByTagName("head")[0].appendChild(c),this.logger.debug("req snt -> url: "+e)}}),Object.defineProperty(Qe,Ze,{value:function(){return!le.isOptInRequest&&X(this.device.gcookie)&&H(this.device.gcookie)?":OO"===this.device.gcookie.slice(-3):(le.isOptInRequest=!1,!1)}}),Object.defineProperty(Qe,$e,{value:function(e){var t=ae.getMetaProp(_);return"boolean"!=typeof t&&(t=!1),Ve(e,_,t?"true":"false")}}),Object.defineProperty(Qe,Ye,{value:function(e,t){if(!0===t){const t={skipResARP:!0};return Ve(e,"arp",Ke(JSON.stringify(t),this.logger))}return ae._isLocalStorageSupported()&&void 0!==localStorage.getItem(P)&&null!==localStorage.getItem(P)?Ve(e,"arp",Ke(JSON.stringify(ae.readFromLSorCookie(P)),this.logger)):e}});const Xe=()=>{let e={};if(ae._isLocalStorageSupported()){let t=ae.read(y);null!=t?(t=JSON.parse(decodeURIComponent(t).replace(p,'"')),t.hasOwnProperty("global")?e.wp=t:e=t):e={}}return e},et=e=>{if(ae._isLocalStorageSupported()){const t={...Xe(),...e},i=JSON.stringify(t);ae.save(y,encodeURIComponent(i)),tt()}},tt=()=>{if(ae._isLocalStorageSupported()){let i=ae.read(b);if(X(i))try{i=JSON.parse(decodeURIComponent(ae.read(b)));const o=ae.read(w)?JSON.parse(decodeURIComponent(ae.read(w))):{};if(i&&ae._isLocalStorageSupported()){var e={},t=Xe();Object.keys(t).forEach((n=>{const s=i in o&&Object.keys(o[i]).length&&o[i][n]?o[i][n]:{},r=t[n].global,a=ie(),l=t[n][a];if(void 0!==r){const e=Object.keys(r);for(const t in e){let i=[];if(e.hasOwnProperty(t)){let o=0,n=0;const a=e[t];if("tc"===a)continue;void 0!==l&&void 0!==l[a]&&(o=l[a]),void 0!==r&&void 0!==r[a]&&(n=r[a]),i=[a,o,n],s[a]=i}}}e={...e,[n]:s}})),o[i]=e,ae.save(w,encodeURIComponent(JSON.stringify(o)))}}catch(e){console.error("Invalid clevertap Id "+e)}}},it=()=>{const e=JSON.parse(decodeURIComponent(ae.read(b)));let t={};if(ae._isLocalStorageSupported()){let i={};t=Xe();const o=ae.read(w),n=o?decodeURIComponent(o):null,s=n?JSON.parse(n):null,r=e&&null!=o&&s&&s[e]&&s[e].wp?Object.values(s[e].wp):[],a=e&&null!=o&&s&&s[e]&&s[e].wi?Object.values(s[e].wi):[],l=ie();let c=0,d=0;return t.wp&&t.wp[l]&&"undefined"!==t.wp[l].tc&&(c=t.wp[l].tc),t.wi&&t.wi[l]&&"undefined"!==t.wi[l].tc&&(d=t.wi[l].tc),i={wmp:c,wimp:d,tlc:r,witlc:a},i}},ot=(e,t)=>{let{logger:i}=t,o=!1;if(J(e))for(const t in e)if(e.hasOwnProperty(t)){o=!0;let n=e[t];if(null==n){delete e[t];continue}"Gender"!==t||n.match(/^M$|^F$/)||(o=!1,i.error(Pe)),"Employed"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Se)),"Married"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Ie)),"Education"!==t||n.match(/^School$|^College$|^Graduate$/)||(o=!1,i.error(Oe)),"Age"===t&&null!=n&&(Y(n)?e.Age=+n:(o=!1,i.error(_e))),"DOB"===t?(/^\$D_/.test(n)&&11===(n+"").length||Z(n)||(o=!1,i.error(Ee)),Z(n)&&(e[t]=ne(n))):Z(n)&&(e[t]=ne(n)),"Phone"!==t||$(n)||(n.length>8&&"+"===n.charAt(0)?(n=n.substring(1,n.length),Y(n)?e.Phone=+n:(o=!1,i.error(Le+". Removed."))):(o=!1,i.error(Le+". Removed."))),o||delete e[t]}return o},nt=e=>{const t={};t.Name=e.name,null!=e.id&&(t.FBID=e.id+""),"male"===e.gender?t.Gender="M":"female"===e.gender?t.Gender="F":t.Gender="O";null!=e.relationship_status&&(t.Married="N","Married"===e.relationship_status&&(t.Married="Y"));const i=function(e){if(null!=e){let t="",i="";for(let o=0;o0?"Y":"N",null!=e.email&&(t.Email=e.email),null!=e.birthday){const i=e.birthday.split("/");t.DOB=se(i[2]+i[0]+i[1])}return t},st=(e,t)=>{let{logger:i}=t;const o={};if(null!=e.displayName&&(o.Name=e.displayName),null!=e.id&&(o.GPID=e.id+""),null!=e.gender&&("male"===e.gender?o.Gender="M":"female"===e.gender?o.Gender="F":"other"===e.gender&&(o.Gender="O")),null!=e.image&&!1===e.image.isDefault&&(o.Photo=e.image.url.split("?sz")[0]),null!=e.emails)for(let t=0;t{if(ae._isLocalStorageSupported()){if(null==le.globalProfileMap&&(le.globalProfileMap=ae.readFromLSorCookie(x),null==le.globalProfileMap&&(le.globalProfileMap={})),null!=e._custom){const t=e._custom;for(const i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);delete e._custom}for(const i in e)if(e.hasOwnProperty(i)){if(le.globalProfileMap.hasOwnProperty(i)&&!t)continue;le.globalProfileMap[i]=e[i]}null!=le.globalProfileMap._custom&&delete le.globalProfileMap._custom,ae.saveToLSorCookie(x,le.globalProfileMap)}},at=(e,t,i)=>{if(null!=e&&"-1"!==e&&ae._isLocalStorageSupported()){const t=Xe();let o=t.wp[i];null==o&&(o={},t[i]=o),o[e]="dnd",et(t)}if(null!=le.campaignDivMap){const t=le.campaignDivMap[e];null!=t&&(document.getElementById(t).style.display="none","intentPreview"===t&&null!=document.getElementById("intentOpacityDiv")&&(document.getElementById("intentOpacityDiv").style.display="none"))}};var lt=t("logger"),ct=t("request"),dt=t("account"),ht=t("oldValues"),ut=t("isPersonalisationActive"),pt=t("processProfileArray");class gt extends Array{constructor(e,t){let{logger:o,request:n,account:s,isPersonalisationActive:r}=e;super(),Object.defineProperty(this,pt,{value:ft}),Object.defineProperty(this,lt,{writable:!0,value:void 0}),Object.defineProperty(this,ct,{writable:!0,value:void 0}),Object.defineProperty(this,dt,{writable:!0,value:void 0}),Object.defineProperty(this,ht,{writable:!0,value:void 0}),Object.defineProperty(this,ut,{writable:!0,value:void 0}),i(this,lt)[lt]=o,i(this,ct)[ct]=n,i(this,dt)[dt]=s,i(this,ht)[ht]=t,i(this,ut)[ut]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o0)for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];let n,s={};if(null!=o.Site){if(n=o.Site,$(n)||!ot(n,{logger:i(this,lt)[lt]}))return}else if(null!=o.Facebook){const e=o.Facebook;$(e)||e.error||(n=nt(e))}else if(null!=o["Google Plus"]){const e=o["Google Plus"];$(e)||e.error||(n=st(e,{logger:i(this,lt)[lt]}))}if(null!=n&&!$(n)){s.type="profile",null==n.tz&&(n.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),s.profile=n,rt(n,!0),s=i(this,ct)[ct].addSystemDataToObject(s,void 0),i(this,ct)[ct].addFlags(s);const e=Ke(JSON.stringify(s),i(this,lt)[lt]);let t=i(this,dt)[dt].dataPostURL;t=Ve(t,"type",A),t=Ve(t,"d",e),i(this,ct)[ct].saveAndFireRequest(t,le.blockRequest)}}},vt=t("request"),bt=t("logger"),mt=t("account"),yt=t("session"),wt=t("oldValues"),Ct=t("device"),kt=t("processOUL"),xt=t("handleCookieFromCache"),Pt=t("deleteUser"),St=t("processLoginArray");class It extends Array{constructor(e,t){let{request:o,account:n,session:s,logger:r,device:a}=e;super(),Object.defineProperty(this,St,{value:At}),Object.defineProperty(this,Pt,{value:Et}),Object.defineProperty(this,xt,{value:_t}),Object.defineProperty(this,kt,{value:Ot}),Object.defineProperty(this,vt,{writable:!0,value:void 0}),Object.defineProperty(this,bt,{writable:!0,value:void 0}),Object.defineProperty(this,mt,{writable:!0,value:void 0}),Object.defineProperty(this,yt,{writable:!0,value:void 0}),Object.defineProperty(this,wt,{writable:!0,value:void 0}),Object.defineProperty(this,Ct,{writable:!0,value:void 0}),i(this,vt)[vt]=o,i(this,mt)[mt]=n,i(this,yt)[yt]=s,i(this,bt)[bt]=r,i(this,wt)[wt]=t,i(this,Ct)[Ct]=a}clear(){i(this,bt)[bt].debug("clear called. Reset flag has been set."),i(this,Pt)[Pt](),ae.setMetaProp(g,!0)}push(){for(var e=arguments.length,t=new Array(e),o=0;o{let o=ae.readFromLSorCookie(m);const n=ae.readFromLSorCookie(b);let s;if(null==o)o={},s=e;else{s=o.id;let r=!1,a=!1;if(null==s&&(s=e[0],r=!0),null==le.LRU_CACHE&&ae._isLocalStorageSupported()&&(le.LRU_CACHE=new he(100)),r)null!=n&&(le.LRU_CACHE.set(s,n),le.blockRequest=!1);else for(const t in e)if(e.hasOwnProperty(t)){const i=e[t];if(le.LRU_CACHE.cache[i]){s=i,a=!0;break}}if(a){s!==le.LRU_CACHE.getLastKey()?i(this,xt)[xt]():(t=!1,ae.saveToLSorCookie(D,t));const e=le.LRU_CACHE.get(s);le.LRU_CACHE.set(s,e),ae.saveToLSorCookie(b,e),i(this,Ct)[Ct].gcookie=e;const o=le.LRU_CACHE.getSecondLastKey();if(ae.readFromLSorCookie(D)&&-1!==o){const e=le.LRU_CACHE.cache[o];i(this,vt)[vt].unregisterTokenForGuid(e)}}else r?null!=n&&(i(this,Ct)[Ct].gcookie=n,ae.saveToLSorCookie(b,n),t=!1):this.clear(),ae.saveToLSorCookie(D,!1),s=e[0]}o.id=s,ae.saveToLSorCookie(m,o)};if(Array.isArray(e)&&e.length>0)for(const n in e)if(e.hasOwnProperty(n)){const s=e[n];let r,a={};if(null!=s.Site){if(r=s.Site,$(r)||!ot(r,{logger:i(this,bt)[bt]}))return}else if(null!=s.Facebook){const e=s.Facebook;$(e)||e.error||(r=nt(e))}else if(null!=s["Google Plus"]){const e=s["Google Plus"];$(e)&&!e.error&&(r=st(e,{logger:i(this,bt)[bt]}))}if(null!=r&&!$(r)){a.type="profile",null==r.tz&&(r.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),a.profile=r;const e=[];ae._isLocalStorageSupported()&&(r.Identity&&e.push(r.Identity),r.Email&&e.push(r.Email),r.GPID&&e.push("GP:"+r.GPID),r.FBID&&e.push("FB:"+r.FBID),e.length>0&&o(e)),rt(r,!0),a=i(this,vt)[vt].addSystemDataToObject(a,void 0),i(this,vt)[vt].addFlags(a),t&&(a.isOUL=!0);const n=Ke(JSON.stringify(a),i(this,bt)[bt]);let s=i(this,mt)[mt].dataPostURL;s=Ve(s,"type",A),s=Ve(s,"d",n),i(this,vt)[vt].saveAndFireRequest(s,le.blockRequest,t)}}},_t=function(){le.blockRequest=!1,console.debug("Block request is false"),ae._isLocalStorageSupported()&&(delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),ae.removeCookie(y,We()),ae.removeCookie(i(this,yt)[yt].cookieName,le.broadDomain),ae.removeCookie(P,le.broadDomain),i(this,yt)[yt].setSessionCookieObject("")},Et=function(){le.blockRequest=!0,i(this,bt)[bt].debug("Block request is true"),le.globalCache={gcookie:null,REQ_N:0,RESP_N:0},ae._isLocalStorageSupported()&&(delete localStorage.WZRK_G,delete localStorage.WZRK_K,delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),ae.removeCookie(b,le.broadDomain),ae.removeCookie(y,We()),ae.removeCookie(m,We()),ae.removeCookie(i(this,yt)[yt].cookieName,le.broadDomain),ae.removeCookie(P,le.broadDomain),i(this,Ct)[Ct].gcookie=null,i(this,yt)[yt].setSessionCookieObject("")},At=function(e){if(Array.isArray(e)&&e.length>0){const t=e.pop();if(null!=t&&J(t)&&(null!=t.Site&&Object.keys(t.Site).length>0||null!=t.Facebook&&Object.keys(t.Facebook).length>0||null!=t["Google Plus"]&&Object.keys(t["Google Plus"]).length>0)){ae.setInstantDeleteFlagInK();try{i(this,kt)[kt]([t])}catch(e){i(this,bt)[bt].debug(e)}}else i(this,bt)[bt].error("Profile object is in incorrect format")}};class Lt extends HTMLElement{constructor(){super(),this._details=null,this.shadow=null,this.shadow=this.attachShadow({mode:"open"})}get details(){return this._details||""}set details(e){null===this._details&&(this._details=e,this.renderBanner())}renderBanner(){this.shadow.innerHTML=this.getBannerContent(),!1!==this.trackClick&&this.addEventListener("click",(()=>{const e=this.details.onClick;e&&(this.details.window?window.open(e,"_blank"):window.parent.location.href=e),window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId})}getBannerContent(){return'\n \n \n ")}}class Mt extends HTMLElement{constructor(){super(),this._target=null,this._carousel=null,this.shadow=null,this.slides=0,this.previouslySelectedItem=-1,this.selectedItem=1,this.autoSlide=null,this.stopAutoSlideTimeout=null,this.shadow=this.attachShadow({mode:"open"}),void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Lt)}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderCarousel())}get details(){return this.target.display.details}get display(){return this.target.display}renderCarousel(){this.slides=this.details.length,this.shadow.innerHTML=this.getStyles();const e=this.getCarouselContent();this.display.showNavBtns&&e.insertAdjacentHTML("beforeend",this.display.navBtnsHtml),this.display.showNavArrows&&(e.insertAdjacentHTML("beforeend",this.display.leftNavArrowHtml),e.insertAdjacentHTML("beforeend",this.display.rightNavArrowHtml)),this._carousel=e,this.shadow.appendChild(e),this.setupClick(),this.updateSelectedItem(),this.startAutoSlide(),this.setupOnHover(),window.clevertap.renderNotificationViewed({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot})}setupClick(){this._carousel.addEventListener("click",(e=>{const t=e.target.id;if(t.startsWith("carousel__button")){const e=+t.split("-")[1];e!==this.selectedItem&&(this.previouslySelectedItem=this.selectedItem,this.selectedItem=e,this.updateSelectedItem(),this.startAutoSlide())}else if(t.startsWith("carousel__arrow"))t.endsWith("right")?this.goToNext():this.goToPrev(),this.startAutoSlide();else if(t.indexOf("-")>-1){const e=+t.split("-")[1],i=e-1;window.parent.clevertap&&window.clevertap.renderNotificationClicked({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot,wzrk_slideNo:e});const o=this.details[i].onClick;""!==o&&(this.details[i].window?window.open(o,"_blank"):window.location.href=o)}}))}setupOnHover(){this._carousel.addEventListener("mouseenter",(e=>{this.stopAutoSlideTimeout=setTimeout((()=>{this.autoSlide=clearInterval(this.autoSlide)}),500)})),this._carousel.addEventListener("mouseleave",(e=>{clearTimeout(this.stopAutoSlideTimeout),void 0===this.autoSlide&&this.startAutoSlide()}))}getCarouselContent(){const e=document.createElement("div");return e.setAttribute("class","carousel"),this.details.forEach(((t,i)=>{const o=document.createElement("ct-web-personalisation-banner");o.classList.add("carousel__item"),o.trackClick=!1,o.setAttribute("id","carousel__item-".concat(i+1)),o.details=t,e.appendChild(o)})),e}getStyles(){var e,t;return"\n \n ")}updateSelectedItem(){if(-1!==this.previouslySelectedItem){const e=this.shadow.getElementById("carousel__item-".concat(this.previouslySelectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.previouslySelectedItem));e.classList.remove("carousel__item--selected"),t&&t.classList.remove("carousel__button--selected")}const e=this.shadow.getElementById("carousel__item-".concat(this.selectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.selectedItem));e.classList.add("carousel__item--selected"),t&&t.classList.add("carousel__button--selected")}startAutoSlide(){clearInterval(this.autoSlide),this.autoSlide=setInterval((()=>{this.goToNext()}),this.display.sliderTime?1e3*this.display.sliderTime:3e3)}goToNext(){this.goTo(this.selectedItem,(this.selectedItem+1)%this.slides)}goToPrev(){this.goTo(this.selectedItem,this.selectedItem-1)}goTo(e,t){this.previouslySelectedItem=e,this.selectedItem=t,0===t&&(this.selectedItem=this.slides),this.updateSelectedItem()}}class Tt extends HTMLElement{constructor(){super(),this._target=null,this._session=null,this.shadow=null,this.popup=null,this.container=null,this.resizeObserver=null,this.shadow=this.attachShadow({mode:"open"})}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderImageOnlyPopup())}get session(){return this._session||""}set session(e){this._session=e}get msgId(){return this.target.wzrk_id}get pivotId(){return this.target.wzrk_pivot}get onClickUrl(){return this.target.display.onClickUrl}renderImageOnlyPopup(){const e=this.target.wzrk_id.split("_")[0],t=this.session.sessionId;this.shadow.innerHTML=this.getImageOnlyPopupContent(),this.popup=this.shadowRoot.getElementById("imageOnlyPopup"),this.container=this.shadowRoot.getElementById("container"),this.closeIcon=this.shadowRoot.getElementById("close"),this.popup.addEventListener("load",this.updateImageAndContainerWidth()),this.resizeObserver=new ResizeObserver((()=>this.handleResize(this.popup,this.container))),this.resizeObserver.observe(this.popup),this.closeIcon.addEventListener("click",(()=>{if(this.resizeObserver.unobserve(this.popup),document.getElementById("wzrkImageOnlyDiv").style.display="none",this.remove(),null!=e&&"-1"!==e&&ae._isLocalStorageSupported()){const i=Xe();let o=i.wp[t];null==o&&(o={},i[t]=o),o[e]="dnd",et(i)}})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId}),this.onClickUrl&&this.popup.addEventListener("click",(()=>{this.target.display.window?window.open(this.onClickUrl,"_blank"):window.parent.location.href=this.onClickUrl,window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})}))}handleResize(e,t){const i=this.getRenderedImageWidth(e);t.style.setProperty("width","".concat(i,"px"))}getImageOnlyPopupContent(){return"\n ".concat(this.target.msgContent.css,"\n ").concat(this.target.msgContent.html,"\n ")}updateImageAndContainerWidth(){return()=>{const e=this.getRenderedImageWidth(this.popup);this.popup.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("height","auto"),this.container.style.setProperty("position","fixed"),this.popup.style.setProperty("visibility","visible"),this.closeIcon.style.setProperty("visibility","visible"),document.getElementById("wzrkImageOnlyDiv").style.visibility="visible"}}getRenderedImageWidth(e){const t=e.naturalWidth/e.naturalHeight;return e.height*t}}class Rt extends HTMLElement{constructor(e,t){super(),this.wrapper=null,this.snackBar=null,this.shadow=this.attachShadow({mode:"open"}),this.config=e,this.message=t,this.renderMessage(t)}get pivotId(){return this.message.wzrk_pivot}get campaignId(){return this.message.wzrk_id}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}renderMessage(e){switch(this.wrapper=this.createEl("div","messageWrapper"),e.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":{const t=this.prepareBasicMessage(e.msg[0]);this.wrapper.appendChild(t)}}const t=this.createEl("div","timeStamp");if(t.innerHTML="".concat(Wt(e.id.split("_")[1]),""),!e.viewed){const e=this.createEl("span","unreadMarker");t.appendChild(e)}this.wrapper.appendChild(t),this.shadow.appendChild(this.wrapper)}prepareBasicMessage(e){const t=this.createEl("div","message");if(e.imageUrl){const i=this.addImage(e.imageUrl,"mainImg");t.appendChild(i)}const i=this.createEl("div","iconTitleDescWrapper");if(e.iconUrl){const t=this.addImage(e.iconUrl,"iconImg");i.appendChild(t)}const o=this.createEl("div","titleDescWrapper");if(e.title){const t=this.createEl("div","title");t.innerText=e.title,o.appendChild(t)}if(e.description){const t=this.createEl("div","description");t.innerText=e.description,o.appendChild(t)}if((e.title||e.description)&&i.appendChild(o),(e.iconUrl||e.title||e.description)&&t.appendChild(i),e.buttons&&e.buttons.length){const i=this.addButtons(e.buttons);t.appendChild(i)}return t}addButtons(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.createEl("div","buttonsContainer");let i=!1;return e.forEach(((e,o)=>{const n=this.createEl("button","button-".concat(o),"button");n.innerText=e.text,o>0&&(n.style.cssText+="margin-left: 2px;"),"copy"===e.action&&(i=!0),t.appendChild(n)})),i&&this.addSnackbar(t),t}addSnackbar(e){this.snackBar=this.createEl("div","snackbar-".concat(this.campaignId),"snackbar"),this.snackBar.innerHTML=Ht;const t=this.createEl("span","snackbar-msg-".concat(this.campaignId),"snackbar-msg");t.innerText="Copied to clipboard",this.snackBar.appendChild(t),e.appendChild(this.snackBar)}addImage(e,t){const i=this.createEl("div","".concat(t,"Container")),o=this.createEl("img",t);return o.setAttribute("src",e),o.setAttribute("loading","lazy"),i.appendChild(o),i}raiseClickedEvent(e,t){switch(this.message.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":this.raiseClickedForBasicTemplates(e,t)}}raiseClickedForBasicTemplates(e,t){const i=this.message.msg[0],o={msgId:this.campaignId,pivotId:this.pivotId};if("BUTTON"===e.tagName){const t=e.id.split("-")[1],n=i.buttons[t];o.kv={wzrk_c2a:n.text},"url"===n.action?n.openUrlInNewTab?window.open(n.url,"_blank"):window.location=n.url:"copy"===n.action&&(window.focus(),navigator.clipboard.writeText(n.clipboardText),this.snackBar.style.setProperty("display","flex","important"),setTimeout((()=>{this.snackBar.style.setProperty("display","none","important")}),2e3))}else"CT-INBOX-MESSAGE"===e.tagName&&i.onClickUrl&&(i.openUrlInNewTab?window.open(i.onClickUrl,"_blank"):window.location=i.onClickUrl);t?console.log("Notifiction clicked event will be raised at run time with payload ::",o):window.clevertap.renderNotificationClicked(o)}}class jt extends HTMLElement{constructor(e){super(),this.isInboxOpen=!1,this.isInboxFromFlutter=!1,this.selectedCategory=null,this.unviewedMessages={},this.unviewedCounter=0,this.isPreview=!1,this.inboxConfigForPreview={},this.inboxSelector=null,this.inbox=null,this.emptyInboxMsg=null,this.inboxCard=null,this.unviewedBadge=null,this.observer=null,this.selectedCategoryRef=null,this.addClickListenerOnDocument=(()=>e=>{if(e.composedPath().includes(this.inbox)){const t=e.path||e.composedPath&&e.composedPath();if(t.length){const e=t[0].id;if("closeInbox"===e)this.toggleInbox();else if(e.startsWith("category-"))this.prevCategoryRef=this.selectedCategoryRef,this.selectedCategoryRef=t[0],this.updateActiveCategory(t[0].innerText);else{const e=t.filter((e=>{var t;return(null===(t=e.id)||void 0===t?void 0:t.startsWith("button-"))||"CT-INBOX-MESSAGE"===e.tagName}));if(e.length){e[e.length-1].raiseClickedEvent(e[0],this.isPreview)}}}}else(this.inboxSelector.contains(e.target)||this.isInboxOpen)&&(this.isInboxFromFlutter?this.isInboxFromFlutter=!1:this.toggleInbox(e))})(),this.setBadgeStyle=e=>{null!==this.unviewedBadge&&(this.unviewedBadge.innerText=e>9?"9+":e,this.unviewedBadge.style.display=e>0?"flex":"none")},this.logger=e,this.shadow=this.attachShadow({mode:"open"})}get incomingMessages(){return[]}set incomingMessages(e){void 0===e&&(e=[]),e.length>0&&this.inbox&&this.updateInboxMessages(e)}get incomingMessagesForPreview(){return[]}set incomingMessagesForPreview(e){void 0===e&&(e=[]);const t={};e.length>0&&this.inbox&&(this.isPreview=!0,this.unviewedCounter=0,e.forEach((e=>{const i="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=i,t[i]=e,this.unviewedMessages[i]=e,this.unviewedCounter++})),this.buildUIForMessages(t),this.updateUnviewedBadgeCounter())}connectedCallback(){this.init()}init(){this.config=this.isPreview?this.inboxConfigForPreview:ae.readFromLSorCookie(q)||{},0!==Object.keys(this.config).length&&(this.inboxSelector=document.getElementById(this.config.inboxSelector),null!==this.inboxSelector&&(this.config.styles.notificationsBadge?this.addUnviewedBadge():this.unviewedBadge&&this.unviewedBadge.remove(),this.createinbox(),document.removeEventListener("click",this.addClickListenerOnDocument),document.addEventListener("click",this.addClickListenerOnDocument),this.config.categories.length&&this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadow.innerHTML=this.getInboxStyles(),this.shadow.appendChild(this.inbox)))}addMsgsToInboxFromLS(){const e=this.deleteExpiredAndGetUnexpiredMsgs(!1),t=e?Object.keys(e):[];0!==t.length&&(t.forEach((t=>{e[t].viewed||(this.unviewedMessages[t]=e[t],this.unviewedCounter++)})),this.buildUIForMessages(e),this.updateUnviewedBadgeCounter())}deleteExpiredAndGetUnexpiredMsgs(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Nt();const i=Math.floor(Date.now()/1e3);for(const o in t)if(t[o].wzrk_ttl&&t[o].wzrk_ttl>0&&t[o].wzrk_ttl0&&(t=Object.values(t).sort(((e,t)=>t.date-e.date)).reduce(((e,t)=>(e[t.id]=t,e)),{})),Ft(t),t}updateInboxMessages(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.deleteExpiredAndGetUnexpiredMsgs(),i=Date.now(),o={};e.forEach(((e,n)=>{const s="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=s,e.date=i-n,e.viewed=0,t[s]=e,o[s]=e,this.unviewedMessages[s]=e,this.unviewedCounter++})),Ft(t),this.buildUIForMessages(o),this.updateUnviewedBadgeCounter()}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}addUnviewedBadge(){this.unviewedBadge||(this.unviewedBadge=this.createEl("div","unviewedBadge"),this.unviewedBadge.style.cssText="display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ".concat(this.config.styles.notificationsBadge.backgroundColor,"; font-size: 12px; color: ").concat(this.config.styles.notificationsBadge.textColor,"; font-weight: bold; align-items: center; justify-content: center;"),document.body.appendChild(this.unviewedBadge)),this.updateUnviewedBadgePosition(),window.addEventListener("resize",(()=>{this.updateUnviewedBadgePosition()}))}updateUnviewedBadgePosition(){const{top:e,right:t}=this.inboxSelector.getBoundingClientRect();this.unviewedBadge.style.top="".concat(e-8,"px"),this.unviewedBadge.style.left="".concat(t-8,"px")}createinbox(){this.inbox=this.createEl("div","inbox");const e=this.createEl("div","header"),t=this.createEl("div","headerTitle");t.innerText=this.config.title;const i=this.createEl("div","closeInbox");if(i.innerHTML="×",e.appendChild(t),e.appendChild(i),this.inbox.appendChild(e),this.config.categories.length){const e=this.createCategories();this.inbox.appendChild(e)}this.inboxCard=this.createEl("div","inboxCard"),this.inbox.appendChild(this.inboxCard),this.emptyInboxMsg=this.createEl("div","emptyInboxMsg"),this.emptyInboxMsg.innerText="All messages will be displayed here.",this.inboxCard.appendChild(this.emptyInboxMsg);const o={root:this.inboxCard,rootMargin:"0px",threshold:.5};this.observer=new IntersectionObserver(((e,t)=>{this.handleMessageViewed(e)}),o),this.addMsgsToInboxFromLS()}createCategories(){const e=this.createEl("div","categoriesContainer"),t=this.createEl("div","leftArrow");t.innerHTML=Gt,t.children[0].style="transform: rotate(180deg)",t.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(-70,0)})),e.appendChild(t);const i=this.createEl("div","categoriesWrapper");["All",...this.config.categories].forEach(((e,t)=>{const o=this.createEl("div","category-".concat(t),"category");o.innerText=e,0===t&&(this.selectedCategoryRef=o),i.appendChild(o)})),e.appendChild(i);const o=this.createEl("div","rightArrow");o.innerHTML=Gt,o.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(70,0)})),e.appendChild(o);const n={root:e,threshold:.9},s=i.children[0],r=i.children[this.config.categories.length];new IntersectionObserver((e=>{this.categoryObserverCb(t,e[0].intersectionRatio>=.9)}),n).observe(s);return new IntersectionObserver((e=>{this.categoryObserverCb(o,e[0].intersectionRatio>=.9)}),n).observe(r),e}categoryObserverCb(e,t){e&&(e.style.display=t?"none":"flex")}updateActiveCategory(e){this.selectedCategory=e,this.inboxCard.scrollTop=0;let t=0;this.prevCategoryRef&&this.prevCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef.setAttribute("selected","true"),this.inboxCard.childNodes.forEach((e=>{"emptyInboxMsg"!==e.getAttribute("id")&&(e.style.display="All"===this.selectedCategory||e.getAttribute("category")===this.selectedCategory?"block":"none","block"===e.style.display&&t++)})),0===t?(this.emptyInboxMsg.innerText="".concat(e," messages will be displayed here."),this.emptyInboxMsg.style.display="block"):this.emptyInboxMsg.style.display="none"}buildUIForMessages(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!this.isPreview&&this.updateTSForRenderedMsgs(),this.inboxCard.scrollTop=0;const i=null!==(e=this.config.maxMsgsInInbox)&&void 0!==e?e:15,o=this.inboxCard.firstChild,n=Object.values(t).sort(((e,t)=>t.date-e.date)).map((e=>e.id));for(const e of n){const i=new Rt(this.config,t[e]);i.setAttribute("id",t[e].id),i.setAttribute("pivot",t[e].wzrk_pivot),i.setAttribute("part","ct-inbox-message"),this.config.categories.length>0?(i.setAttribute("category",t[e].tags[0]||""),i.style.display="All"===this.selectedCategory||t[e].category===this.selectedCategory?"block":"none"):i.style.display="block",this.inboxCard.insertBefore(i,o),this.observer.observe(i)}let s=this.inboxCard.querySelectorAll("ct-inbox-message").length;for(;s>i;){const e=this.inboxCard.querySelectorAll("ct-inbox-message");e.length>0&&e[e.length-1].remove(),s--}const r=this.inboxCard.querySelectorAll('ct-inbox-message[style*="display: block"]').length;this.emptyInboxMsg.style.display=r?"none":"block"}handleMessageViewed(e){const t=!this.isPreview;this.isInboxOpen&&e.forEach((e=>{e.isIntersecting&&this.unviewedMessages.hasOwnProperty(e.target.id)&&0===e.target.message.viewed&&(e.target.message.viewed=1,t?(window.clevertap.renderNotificationViewed({msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.updateMessageInLS(e.target.id,{...e.target.message,viewed:1}),setTimeout((()=>{e.target.shadowRoot.getElementById("unreadMarker").style.display="none"}),1e3)):console.log("Notifiction viewed event will be raised at run time with payload ::",{msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.unviewedCounter--,this.updateUnviewedBadgeCounter(),delete this.unviewedMessages[e.target.id])}))}updateMessageInLS(e,t){if(!this.isPreview){const i=Nt();i[e]=t,Ft(i)}}toggleInbox(e){this.isInboxOpen=!this.isInboxOpen,this.isInboxFromFlutter=!!(null==e?void 0:e.rect),this.isInboxOpen?(this.inboxCard.scrollTop=0,!this.isPreview&&this.deleteExpiredAndGetUnexpiredMsgs(),this.inbox.style.display="block",this.inbox.style.zIndex="2147483647",this.config.categories.length&&(this.selectedCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef=this.shadowRoot.getElementById("category-0"),this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadowRoot.getElementById("categoriesWrapper").scrollLeft-=this.shadowRoot.getElementById("categoriesWrapper").scrollWidth),this.setInboxPosition(e)):this.inbox.style.display="none"}setInboxPosition(e){const t=window.outerWidth,i=getComputedStyle(le.inbox),o=i.getPropertyValue("--inbox-top"),n=i.getPropertyValue("--inbox-bottom"),s=i.getPropertyValue("--inbox-left"),r=i.getPropertyValue("--inbox-right");if(t>481&&!(o||n||s||r)){const t=Vt(e,this.inbox.clientHeight,this.inbox.clientWidth),i=t.xPos,o=t.yPos;this.inbox.style.top=o+"px",this.inbox.style.left=i+"px"}}updateUnviewedBadgeCounter(){if(this.isPreview)return void this.setBadgeStyle(this.unviewedCounter);let e=0;this.inboxCard.querySelectorAll("ct-inbox-message").forEach((t=>{const i=Nt();i[t.id]&&0===i[t.id].viewed&&e++})),this.setBadgeStyle(e)}updateTSForRenderedMsgs(){this.inboxCard.querySelectorAll("ct-inbox-message").forEach((e=>{const t=e.id.split("_")[1];e.shadow.getElementById("timeStamp").firstChild.innerText=Wt(t)}))}getInboxStyles(){const e=this.config.categories.length?64:16,t={panelBackgroundColor:this.config.styles.panelBackgroundColor,panelBorderColor:this.config.styles.panelBorderColor,headerBackgroundColor:this.config.styles.header.backgroundColor,headerTitleColor:this.config.styles.header.titleColor,closeIconColor:this.config.styles.closeIconColor,categoriesTabColor:this.config.styles.categories.tabColor,categoriesTitleColor:this.config.styles.categories.titleColor,selectedCategoryTabColor:this.config.styles.categories.selectedTab.tabColor,selectedCategoryTitleColor:this.config.styles.categories.selectedTab.titleColor,headerCategoryHeight:36+e};this.config.styles.categories.borderColor&&(t.categoriesBorderColor=this.config.styles.categories.borderColor),this.config.styles.categories.selectedTab.borderColor&&(t.selectedCategoryBorderColor=this.config.styles.categories.selectedTab.borderColor);const i=(e=>{let{panelBackgroundColor:t,panelBorderColor:i,headerBackgroundColor:o,headerTitleColor:n,closeIconColor:s,categoriesTabColor:r,categoriesTitleColor:a,categoriesBorderColor:l,selectedCategoryTabColor:c,selectedCategoryTitleColor:d,selectedCategoryBorderColor:h,headerCategoryHeight:u}=e;return'\n \n ")})(t),o=this.config.styles.cards;return i+(e=>{let{backgroundColor:t,borderColor:i,titleColor:o,descriptionColor:n,buttonColor:s,buttonTextColor:r,unreadMarkerColor:a}=e;return'\n \n ")})({backgroundColor:o.backgroundColor,borderColor:o.borderColor,titleColor:o.titleColor,descriptionColor:o.descriptionColor,buttonColor:o.buttonColor,buttonTextColor:o.buttonTextColor,unreadMarkerColor:o.unreadMarkerColor})}}const Dt=e=>{e.inbox_preview?le.inbox.incomingMessagesForPreview=e.inbox_notifs:le.inbox.incomingMessages=e},zt=e=>{qt(),le.inbox=new jt({logger:e}),document.body.appendChild(le.inbox)},Bt=e=>{const t=ae.readFromLSorCookie(V)||{};if(Object.keys(t).length>0&&Object.keys(t)[0].includes("_")){const i={};return i[e]=t,ae.saveToLSorCookie(V,i),i}return t},Nt=()=>{const e=JSON.parse(decodeURIComponent(ae.read(b)));if(!X(e))return{};const t=Bt(e);return t.hasOwnProperty(e)?t[e]:{}},Ft=e=>{const t=JSON.parse(decodeURIComponent(ae.read(b)));if(!X(t))return;const i={...Bt(t),[t]:e};ae.saveToLSorCookie(V,i)},Ut=e=>new Promise(((t,i)=>{if("complete"===document.readyState)zt(e),t();else{const i=ae.readFromLSorCookie(q)||{},o=()=>{null===le.inbox&&zt(e),t()};window.addEventListener("load",(()=>{if(document.getElementById(i.inboxSelector))o();else{let n=0;if(n<20){const s=setInterval((()=>{document.getElementById(i.inboxSelector)?(o(),clearInterval(s),t()):n>=20&&(clearInterval(s),e.debug("Failed to add inbox")),n++}),500)}}}))}})),qt=()=>{void 0===customElements.get("ct-web-inbox")&&(customElements.define("ct-web-inbox",jt),customElements.define("ct-inbox-message",Rt))},Vt=(e,t,i)=>{const o=document.scrollingElement.scrollLeft,n=document.scrollingElement.scrollTop,s=window.innerWidth+o,r=window.innerHeight+n,a=e.rect||e.target.getBoundingClientRect(),l=a.x+o,c=a.y+n,d=a.left+o,h=a.right+o,u=a.top+n,p=a.bottom,g=a.height,f=a.width;let v,b,m=!1;const y=16;if(p+t<=r){const e=r-(p+t);b=e>=y?p+y:p+e}else if(u-t>=n){const e=u-t;b=e>=y?u-t-y:u-t-e}else m=!0,b=c+g/2-t/2,br&&(b=r-t);if(m){const e=h+i;if(e<=s){v=h+(e+y<=s?y:s-e)}else{const e=d-i;v=e-(e-y>=o?y:e-o)}}else v=l+f/2-i/2,vs&&(v=h-i>=o?h-i:s-i);return{xPos:v,yPos:b}},Wt=e=>{const t=Date.now();let i=Math.floor((t-e)/6e4);return i<5?"Just now":i<60?"".concat(i," minute").concat(i>1?"s":""," ago"):(i=Math.floor(i/60),i<24?"".concat(i," hour").concat(i>1?"s":""," ago"):(i=Math.floor(i/24),"".concat(i," day").concat(i>1?"s":""," ago")))},Kt=()=>Object.keys(ae.readFromLSorCookie(q)||{}).length>0,Gt='\n\n\n',Ht='\n\n\n',Jt=(e,t)=>{document.addEventListener("DOMContentLoaded",(()=>function(e,t){document.body.innerHTML="",Zt=document.createElement("div"),Zt.id="overlayDiv",Zt.style.position="relative",Zt.style.display="flex",document.body.appendChild(Zt);(function(e,t,i){return new Promise(((o,n)=>{var s=document.createElement("script");s.type="module",s.src=e,s.onload=function(){"function"==typeof window.Overlay?(window.Overlay("#overlayDiv",t,i),o()):n(new Error("ContentLayout not found in overlay.js"))},s.onerror=function(e){n(e)},document.head.appendChild(s)}))})("https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js",e,t).then((()=>{console.log("Overlay script loaded successfully.")})).catch((e=>{console.error("Error loading overlay script:",e)})),d=document.createElement("link"),d.rel="stylesheet",d.type="text/css",d.href="https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css",document.head.appendChild(d),o={kitId:"eqj6nom",scriptTimeout:3e3,async:!0},n=document,s=n.documentElement,r=setTimeout((function(){s.className=s.className.replace(/\bwf-loading\b/g,"")+" wf-inactive"}),o.scriptTimeout),a=n.createElement("script"),l=!1,c=n.getElementsByTagName("script")[0],s.className+=" wf-loading",a.src="https://use.typekit.net/"+o.kitId+".js",a.async=!0,a.onload=a.onreadystatechange=function(){if(i=this.readyState,!(l||i&&"complete"!==i&&"loaded"!==i)){l=!0,clearTimeout(r);try{Typekit.load(o)}catch(e){}}},c.parentNode.insertBefore(a,c);var i,o,n,s,r,a,l,c;var d}(e,t)))};let Zt;const $t=(e,t)=>{const i=t?e[0]:e.display.details[0],o=Object.keys(i)[0],n=i[o];if(o===window.location.href)for(const i in n){const o=document.querySelector(i);if(o)n[i].html&&(o.outerHTML=n[i].html),t||window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot});else{let o=0;const s=setInterval((()=>{const r=document.querySelector(i);r?(n[i].html&&(r.outerHTML=n[i].html),t||window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot}),clearInterval(s)):(o++,o>=20&&(console.log("No element present on DOM with selector '".concat(i,"'.")),clearInterval(s)))}),500)}}},Yt=(e,t)=>{let{device:i,session:o,request:n,logger:s}=t;const r=i,a=o,l=n,c=s;let d=0;const h=t=>{const i=t.wzrk_id.split("_")[0],o=ie(),n=(e,t,i)=>{let o=0,n=0;null!=e[t]&&(o=e[t]),o++,null!=e.tc&&(n=e.tc),i<0&&n++,e.tc=n,e[t]=o};if(ae._isLocalStorageSupported()){delete sessionStorage.WZRK_CAMP;var s={};const e=Xe();s=3===t.display.wtarget_type&&e.hasOwnProperty("wi")?e.wi:0!==t.display.wtarget_type&&1!==t.display.wtarget_type||!e.hasOwnProperty("wp")?{}:e.wp,e.hasOwnProperty("global")&&(s.wp=e),null==t.display.wmc&&(t.display.wmc=1),null==t.display.wimc&&(t.display.wimc=1);var d=-1;let n=-1,r=-1,l=-1,c=-1,g=-1,f=-1;null!=t.display.efc&&(d=parseInt(t.display.efc,10)),null!=t.display.mdc&&(n=parseInt(t.display.mdc,10)),null!=t.display.tdc&&(r=parseInt(t.display.tdc,10)),null!=t.display.tlc&&(l=parseInt(t.display.tlc,10)),null!=t.display.wmp&&(c=parseInt(t.display.wmp,10)),null!=t.display.wmc&&(g=parseInt(t.display.wmc,10)),null!=t.display.wimc&&(f=parseInt(t.display.wimc,10));var h=s[a.sessionId];if(h){const e=h[i],o=h.tc;if("dnd"===e&&!le.dismissSpamControl)return!1;if(3===t.display.wtarget_type){if(f>0&&o>=f&&d<0)return!1}else if(g>0&&o>=g&&d<0)return!1;if(n>0&&e>=n)return!1}else h={},s[a.sessionId]=h;var u=s[o];if(null!=u){const e=u[i],t=u.tc;if(c>0&&t>=c&&d<0)return!1;if(r>0&&e>=r)return!1}else u={},s[o]=u;var p=s.global;if(null!=p){const e=p[i];if(l>0&&e>=l)return!1}else p={},s.global=p}if(null!=t.display.delay&&t.display.delay>0){const i=t.display.delay;return t.display.delay=0,setTimeout(Yt,1e3*i,e,{device:r,session:a,request:l,logger:c}),!1}n(h,i,d),n(u,i,d),n(p,i,d);let g="wp";3===t.display.wtarget_type&&(g="wi");const f={};f[a.sessionId]=h,f[o]=u,f.global=p,et({[g]:f})},u=()=>{const e=r.getGuid(),t=a.getSessionCookieObject();return"&t=wc&d="+encodeURIComponent(He(e+"|"+t.p+"|"+t.s))},p=(e,t)=>{const i=window.parent[e];"function"==typeof i&&(null!=t.display.kv?i(t.display.kv):i())},g=(e,t,i,o,n)=>{f(t),((e,t,i,o,n)=>{if(""!==e&&null!=e){let o,s;n?o=i:null!==i&&(s=i.getElementsByClassName("jsCT_CTA"),null!=s&&1===s.length&&(o=s[0]));const r=t.display.jsFunc,l=t.display.preview;null==l&&(e+=u()),null!=o&&(o.onclick=()=>{if(null!=r)return null==l&&Qe.fireRequest(e),p(r,t),void at("-1",0,a.sessionId);1===t.display.window?window.open(e,"_blank"):window.location=e})}})(e,t,i,0,n)},f=e=>{const t={type:"event"};t.evtName=R,t.evtData={[T]:e.wzrk_id},e.wzrk_pivot&&(t.evtData={...t.evtData,wzrk_pivot:e.wzrk_pivot}),l.processEvent(t)},v=e=>{var t;void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Lt);const i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,o=document.createElement("ct-web-personalisation-banner");o.msgId=e.wzrk_id,o.pivotId=e.wzrk_pivot,o.divHeight=e.display.divHeight,o.details=e.display.details[0];const n=e.display.divId?document.getElementById(i):document.querySelector(i);n.innerHTML="",n.appendChild(o)},m=e=>{var t;void 0===customElements.get("ct-web-personalisation-carousel")&&customElements.define("ct-web-personalisation-carousel",Mt);const i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,o=document.createElement("ct-web-personalisation-carousel");o.target=e;const n=e.display.divId?document.getElementById(i):document.querySelector(i);n.innerHTML="",n.appendChild(o)},y=e=>{const t=e.wzrk_id.split("_")[0],i=e.display;if(2===i.wtarget_type&&1===e.msgContent.type){const t={};t.msgId=e.wzrk_id,e.wzrk_pivot&&(t.pivotId=e.wzrk_pivot),null!=e.msgContent.kv&&(t.kv=e.msgContent.kv);const i=new CustomEvent("CT_web_native_display",{detail:t});return void document.dispatchEvent(i)}if(1===i.layout)return O(void 0,e);if(3===i.layout){const t="wzrkImageOnlyDiv";if(!1===h(e))return;if(le.dismissSpamControl&&null!=document.getElementById(t)){document.getElementById(t).remove()}if(null!=document.getElementById(t)||null!=document.getElementById("intentPreview"))return;const i=document.createElement("div");return i.id=t,document.body.appendChild(i),void 0===customElements.get("ct-web-popup-imageonly")&&customElements.define("ct-web-popup-imageonly",Tt),(e=>{const t=document.createElement("ct-web-popup-imageonly");t.session=a,t.target=e;const i=document.getElementById("wzrkImageOnlyDiv");i.innerHTML="",i.style.visibility="hidden",i.appendChild(t)})(e)}if(!1===h(e))return;const o="wizParDiv"+i.layout;if(le.dismissSpamControl&&null!=document.getElementById(o)){document.getElementById(o).remove()}if(null!=document.getElementById(o))return;le.campaignDivMap[t]=o;const n=2===i.layout,s=document.createElement("div");s.id=o;const r=window.innerHeight,l=window.innerWidth;let c=!1;if(n)s.setAttribute("style",i.iFrameStyle);else{var d=10;let e=5*l/100,t=d+5*r/100,o=30*l/100+20,n="width:30%;";(/mobile/i.test(navigator.userAgent)||/mini/i.test(navigator.userAgent))&&!1===/iPad/i.test(navigator.userAgent)?(o=85*l/100+20,e=5*l/100,t=5*r/100,n="width:80%;"):("ontouchstart"in window||/tablet/i.test(navigator.userAgent))&&(o=50*l/100+20,e=5*l/100,t=5*r/100,n="width:50%;"),null==i.proto?(c=!0,s.setAttribute("style","display:block;overflow:hidden; bottom:"+t+"px !important;width:"+o+"px !important;right:"+e+"px !important;position:fixed;z-index:2147483647;")):s.setAttribute("style",n+i.iFrameStyle)}document.body.appendChild(s);const u=document.createElement("iframe"),p=!1===i.br?"0":"8";u.frameborder="0px",u.marginheight="0px",u.marginwidth="0px",u.scrolling="no",u.id="wiz-iframe";const f=e.display.onClick;let v,b="";if(""!==f&&null!=f&&(b="cursor:pointer;"),1===e.msgContent.type)v=e.msgContent.html,v=v.replace(/##campaignId##/g,t),v=v.replace(/##campaignId_batchId##/g,e.wzrk_id);else{const i='";let n,s,r,a,l;"dark"===e.display.theme?(n="#2d2d2e",s="#eaeaea",r="#353535",a="#353535",l="#ffffff"):(n="#ffffff",s="#000000",a="#f4f4f4",r="#a5a6a6",l="#ffffff");const c=e.msgContent.title,d=e.msgContent.description;let h="";null!=e.msgContent.imageUrl&&""!==e.msgContent.imageUrl&&(h="");v=i+("
×
"+h+"
"+c+"
")+("
"+d+"
")}u.setAttribute("style","z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;"),s.appendChild(u);const m=(u.contentWindow?u.contentWindow:u.contentDocument.document?u.contentDocument.document:u.contentDocument).document,y=new Event("CT_campaign_rendered");document.dispatchEvent(y),m.open(),m.write(v),i["custom-editor"]&&k(e,m),m.close();const w=()=>{d=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv").scrollHeight,!0===i["custom-editor"]||n||(d+=25),document.getElementById("wiz-iframe").contentDocument.body.style.margin="0px",document.getElementById("wiz-iframe").style.height=d+"px"},C=navigator.userAgent.toLowerCase();if(-1!==C.indexOf("safari"))if(C.indexOf("chrome")>-1)u.onload=()=>{w();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)};else{let t=u.contentDocument||u.contentWindow;t.document&&(t=t.document),w();const i=setInterval((()=>{if("complete"===t.readyState){clearInterval(i),w();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)}}),10)}else u.onload=()=>{w();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)}},k=(e,t)=>{const i=t.createElement("script");i.innerHTML="\n const ct__camapignId = '".concat(e.wzrk_id,"';\n const ct__formatVal = (v) => {\n return v && v.trim().substring(0, 20);\n }\n const ct__parentOrigin = window.parent.origin;\n document.body.addEventListener('click', (event) => {\n const elem = event.target.closest?.('a[wzrk_c2a], button[wzrk_c2a]');\n if (elem) {\n const {innerText, id, name, value, href} = elem;\n const clickAttr = elem.getAttribute('onclick') || elem.getAttribute('click');\n const onclickURL = clickAttr?.match(/(window.open)[(](\"|')(.*)(\"|',)/)?.[3] || clickAttr?.match(/(location.href *= *)(\"|')(.*)(\"|')/)?.[3];\n const props = {innerText, id, name, value};\n let msgCTkv = Object.keys(props).reduce((acc, c) => {\n const formattedVal = ct__formatVal(props[c]);\n formattedVal && (acc['wzrk_click_' + c] = formattedVal);\n return acc;\n }, {});\n if(onclickURL) { msgCTkv['wzrk_click_' + 'url'] = onclickURL; }\n if(href) { msgCTkv['wzrk_click_' + 'c2a'] = href; }\n const notifData = { msgId: ct__camapignId, msgCTkv, pivotId: '").concat(e.wzrk_pivot,"' };\n window.parent.clevertap.renderNotificationClicked(notifData);\n }\n });\n "),t.body.appendChild(i)};let x=!1;const S=e=>{let t=e.display.onClick;if(window.clevertap.hasOwnProperty("notificationCallback")&&void 0!==window.clevertap.notificationCallback&&"function"==typeof window.clevertap.notificationCallback){const i=window.clevertap.notificationCallback;if(!x){const o={};o.msgContent=e.msgContent,o.msgId=e.wzrk_id,e.wzrk_pivot&&(o.pivotId=e.wzrk_pivot),null!=e.display.kv&&(o.kv=e.display.kv),window.clevertap.raiseNotificationClicked=()=>{if(""!==t&&null!=t){const i=e.display.jsFunc;if(t+=u(),null!=i)return Qe.fireRequest(t),void p(i,e);1===e.display.window?window.open(t,"_blank"):window.location=t}},window.clevertap.raiseNotificationViewed=()=>{f(e)},i(o),x=!0}}else if(window.clevertap.popupCurrentWzrkId=e.wzrk_id,y(e),window.clevertap.hasOwnProperty("popupCallbacks")&&void 0!==window.clevertap.popupCallbacks&&"function"==typeof window.clevertap.popupCallbacks[e.wzrk_id]){const t=window.clevertap.popupCallbacks[e.wzrk_id],n={};n.msgContent=e.msgContent,n.msgId=e.wzrk_id,e.wzrk_pivot&&(n.pivotId=e.wzrk_pivot);var i=[];for(var o in e)if(o.startsWith(M)&&o!==T){const t={[o]:e[o]};i.push(t)}i.length>0&&(n.msgCTkv=i),null!=e.display.kv&&(n.kv=e.display.kv),window.clevertap.raisePopupNotificationClicked=t=>{if(!t||!t.msgId)return;const i={type:"event"};if(i.evtName=j,i.evtData={[T]:t.msgId},e.wzrk_pivot&&(i.evtData={...i.evtData,wzrk_pivot:t.pivotId}),t.msgCTkv)for(var o of t.msgCTkv)i.evtData={...i.evtData,...o};l.processEvent(i)},t(n)}};let I;const O=(e,t)=>{let i;if(null!=e&&e.clientY>0)return;if(i=null==t?I:t,le.dismissSpamControl&&0===i.display.wtarget_type&&null!=document.getElementById("intentPreview")&&null!=document.getElementById("intentOpacityDiv")){document.getElementById("intentPreview").remove(),document.getElementById("intentOpacityDiv").remove()}if(null!=document.getElementById("intentPreview")||null!=document.getElementById("wzrkImageOnlyDiv"))return;if(null==i.display.layout&&(/mobile/i.test(navigator.userAgent)||/mini/i.test(navigator.userAgent)||/iPad/i.test(navigator.userAgent)||"ontouchstart"in window||/tablet/i.test(navigator.userAgent)))return;if(!1===h(i))return;const o=i.wzrk_id.split("_")[0];le.campaignDivMap[o]="intentPreview";let n=!1;const s=document.createElement("div");s.id="intentOpacityDiv";const r=i.display.opacity||.7,a="rgba(0,0,0,".concat(r,")");s.setAttribute("style","position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ".concat(a,";")),document.body.appendChild(s);const l=document.createElement("div");l.id="intentPreview",null==i.display.proto?(n=!0,l.setAttribute("style","display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;")):l.setAttribute("style",i.display.iFrameStyle),document.body.appendChild(l);const c=document.createElement("iframe"),d=!1===i.display.br?"0":"8";c.frameborder="0px",c.marginheight="0px",c.marginwidth="0px",c.scrolling="no",c.id="wiz-iframe-intent";const u=i.display.onClick;let p,f="";if(""!==u&&null!=u&&(f="cursor:pointer;"),1===i.msgContent.type)p=i.msgContent.html,p=p.replace(/##campaignId##/g,o),p=p.replace(/##campaignId_batchId##/g,i.wzrk_id);else{const e='";let t,n,s,r;"dark"===i.display.theme?(t="#2d2d2e",n="#eaeaea",s="#353535",r="#ffffff"):(t="#ffffff",n="#000000",s="#a5a6a6",r="#ffffff");const a=i.msgContent.title,l=i.msgContent.description;let c="";null!=i.msgContent.ctaText&&""!==i.msgContent.ctaText&&(c="");let h="";null!=i.msgContent.imageUrl&&""!==i.msgContent.imageUrl&&(h="
+a+
");p=e+("
×
"+a+"
")+("
"+l+"
"+h+c+"
")}c.setAttribute("style","z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;"),l.appendChild(c);const v=(c.contentWindow?c.contentWindow:c.contentDocument.document?c.contentDocument.document:c.contentDocument).document,b=new Event("CT_campaign_rendered");document.dispatchEvent(b),v.open(),v.write(p),i.display["custom-editor"]&&k(i,v),v.close();const m=document.getElementById("wiz-iframe-intent").contentDocument.getElementById("contentDiv");g(u,i,m,0,n)};if(!document.body)return void(d<6&&(d++,setTimeout(Yt,1e3,e,{device:r,session:a,request:l,logger:c})));const _=e=>{Object.keys(e).map((t=>{var i,o;e[t].display.divId?(i=e[t].display.divId,o=document.getElementById(i)):(i=e[t].display.divSelector,o=document.querySelector(i)),null!==o&&(2===e[t].msgContent.type?v(e[t]):m(e[t]),delete e[t])}))};if(null!=e.inapp_notifs){const t={};for(let i=0;i{window.addEventListener("load",(()=>{let t=0;if(t<20){const i=setInterval((()=>{_(e),0!==Object.keys(e).length&&20!==t||(clearInterval(i),e={}),t++}),500)}}))})(t))}const E=()=>{if(e.inbox_preview)Dt(e);else if(e.inbox_notifs){const t=[];for(let i=0;i1&&void 0!==arguments[1]&&arguments[1];const i=ae.readFromLSorCookie(q)||{};t?(le.inbox.inboxConfigForPreview=e,le.inbox.isPreview=!0,le.inbox&&le.inbox.init()):JSON.stringify(i)!==JSON.stringify(e)&&(ae.saveToLSorCookie(q,e),le.inbox&&le.inbox.init())}(e.webInboxSetting),Ut(c).then((()=>{E()})).catch((e=>{}))):E()),e.vars)return void le.variableStore.mergeVariables(e.vars);const A=(e,t)=>{const i=Xe(),o=i[t].global;if(null!=o&&t)for(const i in e)if(e.hasOwnProperty(i)&&(delete o[e[i]],ae.read(w))){const o=JSON.parse(decodeURIComponent(ae.read(w))),n=JSON.parse(decodeURIComponent(ae.read(b)));o[n]&&o[n][t]&&o[n][t][e[i]]&&(delete o[n][t][e[i]],ae.save(w,encodeURIComponent(JSON.stringify(o))))}et(i)};if(ae._isLocalStorageSupported())try{if(null!=e.evpr){const t=e.evpr.events,i=e.evpr.profile,o=e.evpr.expires_in,n=oe();ae.setMetaProp("lsTime",n),ae.setMetaProp("exTs",o),(e=>{if(null!=le.globalEventsMap||(le.globalEventsMap=ae.readFromLSorCookie(C),null!=le.globalEventsMap)){for(const t in e)if(e.hasOwnProperty(t)){const i=le.globalEventsMap[t],o=e[t];null!=le.globalEventsMap[t]?null!=o[0]&&o[0]>i[0]&&(le.globalEventsMap[t]=o):le.globalEventsMap[t]=o}}else le.globalEventsMap=e})(t),ae.saveToLSorCookie(C,le.globalEventsMap),null==le.globalProfileMap?rt(i,!0):rt(i,!1)}null!=e.arp&&(e=>{if(null!=e.skipResARP&&e.skipResARP)return console.debug("Update ARP Request rejected",e),null;const t=!0===e.isOUL;if(ae._isLocalStorageSupported())try{let i=ae.readFromLSorCookie(P);if(null==i||t){i={};for(const t in e)e.hasOwnProperty(t)&&(-1===e[t]?delete i[t]:i[t]=e[t]);ae.saveToLSorCookie(P,i)}}catch(e){console.error("Unable to parse ARP JSON: "+e)}})(e.arp),null!=e.inapp_stale&&e.inapp_stale.length>0&&A(e.inapp_stale,"wp"),null!=e.inbox_stale&&e.inbox_stale.length>0&&A(e.inbox_stale,"wi")}catch(e){c.error("Unable to persist evrp/arp: "+e)}};var Qt=t("isPersonalisationActive");class Xt{constructor(e){let{isPersonalisationActive:t}=e;Object.defineProperty(this,Qt,{writable:!0,value:void 0}),i(this,Qt)[Qt]=t}getTotalVisits(){if(!i(this,Qt)[Qt]())return;let e=ae.getMetaProp("sc");return null==e&&(e=1),e}getLastVisit(){if(!i(this,Qt)[Qt]())return;const e=ae.getMetaProp("ps");return null!=e?new Date(1e3*e):void 0}}const ei=1,ti=2,ii=3,oi=4;var ni=t("logLevel"),si=t("log"),ri=t("isLegacyDebug");class ai{constructor(e){Object.defineProperty(this,ri,{get:ci,set:void 0}),Object.defineProperty(this,si,{value:li}),Object.defineProperty(this,ni,{writable:!0,value:void 0}),this.wzrkError={},i(this,ni)[ni]=null==e?e:ti,this.wzrkError={}}get logLevel(){return i(this,ni)[ni]}set logLevel(e){i(this,ni)[ni]=e}error(e){i(this,ni)[ni]>=ei&&i(this,si)[si]("error",e)}info(e){i(this,ni)[ni]>=ti&&i(this,si)[si]("log",e)}debug(e){(i(this,ni)[ni]>=ii||i(this,ri)[ri])&&i(this,si)[si]("debug",e)}debugPE(e){i(this,ni)[ni]>=oi&&i(this,si)[si]("debug_pe",e)}reportError(e,t){this.wzrkError.c=e,this.wzrkError.d=t,this.error("".concat(Ce," ").concat(e,": ").concat(t))}}var li=function(e,t){if(window.console)try{const i=(new Date).getTime();console[e]("CleverTap [".concat(i,"]: ").concat(t))}catch(e){}},ci=function(){return"undefined"!=typeof sessionStorage&&""===sessionStorage.WZRK_D},di=t("logger"),hi=t("sessionId"),ui=t("isPersonalisationActive");class pi{constructor(e){let{logger:t,isPersonalisationActive:o}=e;Object.defineProperty(this,di,{writable:!0,value:void 0}),Object.defineProperty(this,hi,{writable:!0,value:void 0}),Object.defineProperty(this,ui,{writable:!0,value:void 0}),this.cookieName=void 0,this.scookieObj=void 0,this.sessionId=ae.getMetaProp("cs"),i(this,di)[di]=t,i(this,ui)[ui]=o}get sessionId(){return i(this,hi)[hi]}set sessionId(e){i(this,hi)[hi]=e}getSessionCookieObject(){let e=ae.readCookie(this.cookieName),t={};if(null!=e)if(e=e.replace(p,'"'),t=JSON.parse(e),J(t)){if(void 0!==t.t){const e=t.t;oe()-e>1260&&(t={})}}else t={};return this.scookieObj=t,t}setSessionCookieObject(e){const t=JSON.stringify(e);ae.createBroadCookie(this.cookieName,t,1200,We())}manageSession(e){if(void 0===this.sessionId||this.sessionId!==e){const t=ae.getMetaProp("cs");if(void 0===t)ae.setMetaProp("ps",e),ae.setMetaProp("cs",e),ae.setMetaProp("sc",1);else if(t!==e){ae.setMetaProp("ps",t),ae.setMetaProp("cs",e);let i=ae.getMetaProp("sc");void 0===i&&(i=0),ae.setMetaProp("sc",i+1)}this.sessionId=e}}getTimeElapsed(){if(!i(this,ui)[ui]())return;null!=this.scookieObj&&(this.scookieObj=this.getSessionCookieObject());const e=this.scookieObj.s;if(null!=e){const t=oe();return Math.floor(t-e)}}getPageCount(){if(i(this,ui)[ui]())return null!=this.scookieObj&&(this.scookieObj=this.getSessionCookieObject()),this.scookieObj.p}}let gi=0,fi=0;var vi=t("logger"),bi=t("account"),mi=t("device"),yi=t("session"),wi=t("isPersonalisationActive"),Ci=t("clearCookie"),ki=t("addToLocalEventMap");class xi{constructor(e){let{logger:t,account:o,device:n,session:s,isPersonalisationActive:r}=e;Object.defineProperty(this,ki,{value:Pi}),Object.defineProperty(this,vi,{writable:!0,value:void 0}),Object.defineProperty(this,bi,{writable:!0,value:void 0}),Object.defineProperty(this,mi,{writable:!0,value:void 0}),Object.defineProperty(this,yi,{writable:!0,value:void 0}),Object.defineProperty(this,wi,{writable:!0,value:void 0}),Object.defineProperty(this,Ci,{writable:!0,value:!1}),this.processingBackup=!1,i(this,vi)[vi]=t,i(this,bi)[bi]=o,i(this,mi)[mi]=n,i(this,yi)[yi]=s,i(this,wi)[wi]=r,Qe.logger=t,Qe.device=n,Qe.account=o}processBackupEvents(){const e=ae.readFromLSorCookie(S);if(null!=e){this.processingBackup=!0;for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];void 0===o.fired&&(i(this,vi)[vi].debug("Processing backup event : "+o.q),void 0!==o.q&&Qe.fireRequest(o.q),o.fired=!0)}ae.saveToLSorCookie(S,e),this.processingBackup=!1}}addSystemDataToObject(e,t){void 0===t&&(e=ee(e,i(this,vi)[vi])),$(i(this,vi)[vi].wzrkError)||(e.wzrk_error=i(this,vi)[vi].wzrkError,i(this,vi)[vi].wzrkError={}),e.id=i(this,bi)[bi].id,X(i(this,mi)[mi].gcookie)&&(e.g=i(this,mi)[mi].gcookie);const o=i(this,yi)[yi].getSessionCookieObject();e.s=o.s,e.pg=void 0===o.p?1:o.p;let n=document.location.protocol;return n=n.replace(":",""),e.af={lib:"web-sdk-v1.7.3",protocol:n,...le.flutterVersion},sessionStorage.hasOwnProperty("WZRK_D")&&(e.debug=!0),e}addFlags(e){if(i(this,Ci)[Ci]=ae.getAndClearMetaProp(g),void 0!==i(this,Ci)[Ci]&&i(this,Ci)[Ci]&&(e.rc=!0,i(this,vi)[vi].debug("reset cookie sent in request and cleared from meta for future requests.")),i(this,wi)[wi]()){const t=ae.getMetaProp("lsTime"),i=ae.getMetaProp("exTs");if(void 0===t||void 0===i)return void(e.dsync=!0);t+i{if(e.ok)return e.json();throw e})).then((e=>(i(this,vi)[vi].debug("Sync data successful",e),e))).catch((e=>{throw i(this,vi)[vi].debug("Error in syncing variables",e),e}))}}var Pi=function(e){if(ae._isLocalStorageSupported()){void 0===le.globalEventsMap&&(le.globalEventsMap=ae.readFromLSorCookie(C),void 0===le.globalEventsMap&&(le.globalEventsMap={}));const t=oe();let i=le.globalEventsMap[e];void 0!==i?(i[2]=t,i[0]++):(i=[],i.push(1),i.push(t),i.push(t)),le.globalEventsMap[e]=i,ae.saveToLSorCookie(C,le.globalEventsMap)}},Si=t("request"),Ii=t("account"),Oi=t("oldValues"),_i=t("logger"),Ei=t("processPrivacyArray");class Ai extends Array{constructor(e,t){let{request:o,account:n,logger:s}=e;super(),Object.defineProperty(this,Ei,{value:Li}),Object.defineProperty(this,Si,{writable:!0,value:void 0}),Object.defineProperty(this,Ii,{writable:!0,value:void 0}),Object.defineProperty(this,Oi,{writable:!0,value:void 0}),Object.defineProperty(this,_i,{writable:!0,value:void 0}),i(this,_i)[_i]=s,i(this,Si)[Si]=o,i(this,Ii)[Ii]=n,i(this,Oi)[Oi]=t}push(){for(var e=arguments.length,t=new Array(e),o=0;o0?le.privacyArray:t):le.privacyArray.push(...t),0}_processOldValues(){i(this,Oi)[Oi]&&i(this,Ei)[Ei](i(this,Oi)[Oi]),i(this,Oi)[Oi]=null}}var Li=function(e){if(Array.isArray(e)&&e.length>0){const o=e.reduce(((e,t)=>({...e,...t})),{});let n={};const s={};var t=!1;if(o.hasOwnProperty(O)&&"boolean"==typeof(t=o.optOut)&&(s.ct_optout=t,le.isOptInRequest=!t),o.hasOwnProperty(_)){const e=o.useIP,t="boolean"==typeof e&&e;ae.setMetaProp(_,t)}if(!$(s)){n.type="profile",n.profile=s,n=i(this,Si)[Si].addSystemDataToObject(n,void 0);const o=Ke(JSON.stringify(n),i(this,_i)[_i]);let r=i(this,Ii)[Ii].dataPostURL;r=Ve(r,"type",A),r=Ve(r,"d",o),r=Ve(r,O,t?"true":"false"),i(this,Si)[Si].saveAndFireRequest(r,le.blockRequest),e.splice(0,e.length)}}},Mi=t("oldValues"),Ti=t("logger"),Ri=t("request"),ji=t("account"),Di=t("wizAlertJSPath"),zi=t("fcmPublicKey"),Bi=t("setUpWebPush"),Ni=t("setUpWebPushNotifications"),Fi=t("setApplicationServerKey"),Ui=t("setUpSafariNotifications"),qi=t("setUpChromeFirefoxNotifications"),Vi=t("addWizAlertJS"),Wi=t("removeWizAlertJS"),Ki=t("handleNotificationRegistration");class Gi extends Array{constructor(e,t){let{logger:o,session:n,request:s,account:r}=e;super(),Object.defineProperty(this,Ki,{value:eo}),Object.defineProperty(this,Wi,{value:Xi}),Object.defineProperty(this,Vi,{value:Qi}),Object.defineProperty(this,qi,{value:Yi}),Object.defineProperty(this,Ui,{value:$i}),Object.defineProperty(this,Fi,{value:Zi}),Object.defineProperty(this,Ni,{value:Ji}),Object.defineProperty(this,Bi,{value:Hi}),Object.defineProperty(this,Mi,{writable:!0,value:void 0}),Object.defineProperty(this,Ti,{writable:!0,value:void 0}),Object.defineProperty(this,Ri,{writable:!0,value:void 0}),Object.defineProperty(this,ji,{writable:!0,value:void 0}),Object.defineProperty(this,Di,{writable:!0,value:void 0}),Object.defineProperty(this,zi,{writable:!0,value:void 0}),i(this,Di)[Di]="https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js",i(this,zi)[zi]=null,i(this,Mi)[Mi]=t,i(this,Ti)[Ti]=o,i(this,Ri)[Ri]=s,i(this,ji)[ji]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o0?i(this,Ki)[Ki](e):null==le.webPushEnabled&&e.length>0?(le.notifApi.notifEnabledFromApi=!0,le.notifApi.displayArgs=e.slice()):!1===le.webPushEnabled&&e.length>0&&i(this,Ti)[Ti].error("Make sure push notifications are fully enabled and integrated")},Ji=function(e,t,o,n){-1!==navigator.userAgent.indexOf("Chrome")||-1!==navigator.userAgent.indexOf("Firefox")?i(this,qi)[qi](e,t):-1!==navigator.userAgent.indexOf("Safari")&&i(this,Ui)[Ui](e,o,n)},Zi=function(e){i(this,zi)[zi]=e},$i=function(e,t,o){void 0===t&&i(this,Ti)[Ti].error("Ensure that APNS Web Push ID is supplied"),void 0===o&&i(this,Ti)[Ti].error("Ensure that APNS Web Push service path is supplied"),"safari"in window&&"pushNotification"in window.safari&&window.safari.pushNotification.requestPermission(o,t,{},(e=>{if("granted"===e.permission){const t=JSON.parse(JSON.stringify(e));t.endpoint=e.deviceToken,t.browser="Safari",ae.saveToLSorCookie(z,t),i(this,Ri)[Ri].registerToken(t),i(this,Ti)[Ti].info("Safari Web Push registered. Device Token: "+e.deviceToken)}else"denied"===e.permission&&i(this,Ti)[Ti].info("Error subscribing to Safari web push")}))},Yi=function(e,t){let o="";"serviceWorker"in navigator&&navigator.serviceWorker.register(t).then((e=>{if("undefined"!=typeof __wzrk_account_id)return new Promise((t=>setTimeout((()=>t(e)),5e3)));o=e.scope;return/^(\.?)(\/?)([^/]*).js$/.test(t)?navigator.serviceWorker.ready:-1!==navigator.userAgent.indexOf("Chrome")?new Promise((t=>setTimeout((()=>t(e)),5e3))):navigator.serviceWorker.getRegistrations()})).then((t=>{-1!==navigator.userAgent.indexOf("Firefox")&&Array.isArray(t)&&(t=t.filter((e=>e.scope===o))[0]);const n={userVisibleOnly:!0};null!=i(this,zi)[zi]&&(n.applicationServerKey=(e=>{let t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),i=window.atob(t),o=[];for(let e=0;e{i(this,Ti)[Ti].info("Service Worker registered. Endpoint: "+t.endpoint);const o=JSON.parse(JSON.stringify(t));-1!==navigator.userAgent.indexOf("Chrome")?(o.endpoint=o.endpoint.split("/").pop(),o.browser="Chrome"):-1!==navigator.userAgent.indexOf("Firefox")&&(o.endpoint=o.endpoint.split("/").pop(),o.browser="Firefox"),ae.saveToLSorCookie(z,o),i(this,Ri)[Ri].registerToken(o),void 0!==e&&"function"==typeof e&&e()})).catch((e=>{i(this,Ti)[Ti].error("Error subscribing: "+e),t.pushManager.getSubscription().then((e=>{null!==e&&e.unsubscribe().then((e=>{i(this,Ti)[Ti].info("Unsubscription successful")})).catch((e=>{i(this,Ti)[Ti].error("Error unsubscribing: "+e)}))}))}))})).catch((e=>{i(this,Ti)[Ti].error("error registering service worker: "+e)}))},Qi=function(){const e=document.createElement("script");return e.setAttribute("type","text/javascript"),e.setAttribute("id","wzrk-alert-js"),e.setAttribute("src",i(this,Di)[Di]),document.getElementsByTagName("body")[0].appendChild(e),e},Xi=function(){const e=document.getElementById("wzrk-alert-js");e.parentNode.removeChild(e)},eo=function(e){let t,o,n,s,r,a,l,c,d,h,u,p,g,f,v;if(1===e.length){if(J(e[0])){const i=e[0];t=i.titleText,o=i.bodyText,n=i.okButtonText,s=i.rejectButtonText,r=i.okButtonColor,a=i.skipDialog,l=i.askAgainTimeInSeconds,c=i.okCallback,d=i.rejectCallback,h=i.subscriptionCallback,u=i.serviceWorkerPath,p=i.httpsPopupPath,g=i.httpsIframePath,f=i.apnsWebPushId,v=i.apnsWebPushServiceUrl}}else t=e[0],o=e[1],n=e[2],s=e[3],r=e[4],a=e[5],l=e[6];if(null==a&&(a=!1),null==u&&(u="/clevertap_sw.js"),void 0===navigator.serviceWorker)return;const b=null!=p&&null!=g;if("https:"!==window.location.protocol&&"localhost"!==document.location.hostname&&!b)return void i(this,Ti)[Ti].error("Make sure you are https or localhost to register for notifications");if(-1!==navigator.userAgent.indexOf("Chrome")){const e=navigator.userAgent.match(/Chrome\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}else if(-1!==navigator.userAgent.indexOf("Firefox")){const e=navigator.userAgent.match(/Firefox\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}else{if(-1===navigator.userAgent.indexOf("Safari"))return;{const e=navigator.userAgent.match(/Safari\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}}if(!b){if(null==Notification)return;if("granted"===Notification.permission)return void i(this,Ni)[Ni](h,u,f,v);if("denied"===Notification.permission)return;if(a)return void i(this,Ni)[Ni](h,u,f,v)}if(!(t&&o&&n&&s))return void i(this,Ti)[Ti].error("Missing input parameters; please specify title, body, ok button and cancel button text");null!=r&&r.match(/^#[a-f\d]{6}$/i)||(r="#f28046");const m=(new Date).getTime()/1e3;if(null==ae.getMetaProp("notif_last_time"))ae.setMetaProp("notif_last_time",m);else{if(null==l&&(l=604800),m-ae.getMetaProp("notif_last_time"){if(null!=e.data){let a={};try{a=JSON.parse(e.data)}catch(e){return}null!=a.state&&"ct"===a.from&&"not"===a.state&&(i(this,Vi)[Vi]().onload=()=>{window.wzrkPermissionPopup.wizAlert({title:t,body:o,confirmButtonText:n,confirmButtonColor:r,rejectButtonText:s},(e=>{e?("function"==typeof c&&c(),window.open(p)):"function"==typeof d&&d(),i(this,Wi)[Wi]()}))})}}),!1)}else i(this,Vi)[Vi]().onload=()=>{window.wzrkPermissionPopup.wizAlert({title:t,body:o,confirmButtonText:n,confirmButtonColor:r,rejectButtonText:s},(e=>{e?("function"==typeof c&&c(),i(this,Ni)[Ni](h,u,f,v)):"function"==typeof d&&d(),i(this,Wi)[Wi]()}))}},to=t("variableStore");class io{constructor(e){let{variableStore:t}=e;Object.defineProperty(this,to,{writable:!0,value:void 0}),this.name=null,this.defaultValue=null,this.value=null,this.type=null,this.hadStarted=!1,this.valueChangedCallbacks=[],i(this,to)[to]=t}getValue(){return this.value}getdefaultValue(){return this.defaultValue}static define(e,t,i){if(!e||"string"!=typeof e)return console.error("Empty or invalid name parameter provided."),null;if(e.startsWith(".")||e.endsWith("."))return console.error("Variable name starts or ends with a `.` which is not allowed: "+e),null;const o=typeof t;if("string"!==o&&"number"!==o&&"boolean"!==o)return console.error("Only primitive types (string, number, boolean) are accepted as value"),null;const n=i.getVariable(e);if(n)return n;const s=new io({variableStore:i});try{s.name=e,s.defaultValue=t,s.value=t,s.type=o,i.registerVariable(s),s.update(t)}catch(e){console.error(e)}return s}update(e){const t=this.value;this.value=e,null===e&&null===t||null!==e&&e===t&&this.hadStarted||i(this,to)[to].hasVarsRequestCompleted()&&(this.hadStarted=!0,this.triggerValueChanged())}triggerValueChanged(){this.valueChangedCallbacks.forEach((e=>{e(this)}))}addValueChangedCallback(e){e?(this.valueChangedCallbacks.push(e),i(this,to)[to].hasVarsRequestCompleted()&&e(this)):console.log("Invalid callback parameter provided.")}removeValueChangedCallback(e){const t=this.valueChangedCallbacks.indexOf(e);-1!==t&&this.valueChangedCallbacks.splice(t,1)}clearStartFlag(){this.hadStarted=!1}}var oo=t("logger"),no=t("account"),so=t("request"),ro=t("event"),ao=t("variables"),lo=t("remoteVariables"),co=t("fetchCallback"),ho=t("variablesChangedCallbacks"),uo=t("oneTimeVariablesChangedCallbacks"),po=t("hasVarsRequestCompleted"),go=t("runVariablesChangedCallback");class fo{constructor(e){let{logger:t,request:o,account:n,event:s}=e;Object.defineProperty(this,go,{value:vo}),Object.defineProperty(this,oo,{writable:!0,value:void 0}),Object.defineProperty(this,no,{writable:!0,value:void 0}),Object.defineProperty(this,so,{writable:!0,value:void 0}),Object.defineProperty(this,ro,{writable:!0,value:void 0}),Object.defineProperty(this,ao,{writable:!0,value:void 0}),Object.defineProperty(this,lo,{writable:!0,value:void 0}),Object.defineProperty(this,co,{writable:!0,value:void 0}),Object.defineProperty(this,ho,{writable:!0,value:void 0}),Object.defineProperty(this,uo,{writable:!0,value:void 0}),Object.defineProperty(this,po,{writable:!0,value:!1}),i(this,oo)[oo]=t,i(this,no)[no]=n,i(this,so)[so]=o,i(this,ro)[ro]=s,i(this,ao)[ao]={},i(this,lo)[lo]={},i(this,ho)[ho]=[],i(this,uo)[uo]=[],le.variableStore=this}registerVariable(e){const{name:t}=e;i(this,ao)[ao][t]=e,console.log("registerVariable",i(this,ao)[ao])}getVariable(e){return i(this,ao)[ao][e]}hasVarsRequestCompleted(){return i(this,po)[po]}syncVariables(e,t){if(!i(this,no)[no].token){const e="Account token is missing.";return i(this,oo)[oo].error(e),Promise.reject(new Error(e))}const o={type:"varsPayload",vars:{}};for(const e in i(this,ao)[ao])o.vars[e]={defaultValue:i(this,ao)[ao][e].defaultValue,type:i(this,ao)[ao][e].type};if(0===Object.keys(o.vars).length){const e="No variables are defined.";return i(this,oo)[oo].error(e),Promise.reject(new Error(e))}let n={};n=i(this,so)[so].addSystemDataToObject(n,void 0),n.tk=i(this,no)[no].token,n.type="meta";const s=JSON.stringify([n,o]),r=i(this,no)[no].dataPostPEURL;return i(this,so)[so].post(r,s).then((t=>(e&&"function"==typeof e&&e(t),t))).catch((e=>{throw t&&"function"==typeof t&&t(e),400===e.status?i(this,oo)[oo].error("Invalid sync payload or clear the existing draft"):401===e.status?i(this,oo)[oo].error("This is not a test profile"):i(this,oo)[oo].error("Sync variable failed"),e}))}fetchVariables(e){i(this,ro)[ro].push(K,{t:4}),e&&"function"==typeof e&&(i(this,co)[co]=e)}mergeVariables(e){console.log("msg vars is ",e),i(this,po)[po]=!0,ae.saveToLSorCookie("WZRK_PE",e),i(this,lo)[lo]=e;for(const t in i(this,ao)[ao])e.hasOwnProperty(t)&&i(this,ao)[ao][t].update(e[t]);i(this,co)[co]&&i(this,co)[co](),i(this,go)[go]()}addVariablesChangedCallback(e){e&&"function"==typeof e?(i(this,ho)[ho].push(e),this.hasVarsRequestCompleted()&&e()):i(this,oo)[oo].error("callback is not a function")}addOneTimeVariablesChangedCallback(e){e&&"function"==typeof e&&(this.hasVarsRequestCompleted()?e():i(this,uo)[uo].push(e))}removeVariablesChangedCallback(e){const t=i(this,ho)[ho].indexOf(e);-1!==t&&i(this,ho)[ho].splice(t,1)}removeOneTimeVariablesChangedCallback(e){const t=i(this,uo)[uo].indexOf(e);-1!==t&&i(this,uo)[uo].splice(t,1)}}var vo=function(){for(var e of i(this,ho)[ho])e();for(var t of i(this,uo)[uo])t();i(this,uo)[uo].length=0},bo=t("logger"),mo=t("api"),yo=t("onloadcalled"),wo=t("device"),Co=t("session"),ko=t("account"),xo=t("request"),Po=t("variableStore"),So=t("isSpa"),Io=t("previousUrl"),Oo=t("boundCheckPageChanged"),_o=t("dismissSpamControl"),Eo=t("processOldValues"),Ao=t("debounce"),Lo=t("checkPageChanged"),Mo=t("handleMessageEvent"),To=t("pingRequest"),Ro=t("isPingContinuous"),jo=t("overrideDSyncFlag");var Do=function(){this.onUserLogin._processOldValues(),this.privacy._processOldValues(),this.event._processOldValues(),this.profile._processOldValues(),this.notifications._processOldValues()},zo=function(e){let t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300;return function(){clearTimeout(t),t=setTimeout(e,i)}},Bo=function(){i(this,Ao)[Ao]((()=>{i(this,Io)[Io]!==location.href&&this.pageChanged()}))()},No=function(e){var t;e.data&&e.data.message&&("Dashboard"===e.data.message&&e.data.url?Jt(e.data.url,null!==(t=e.data.variant)&&void 0!==t?t:null):"Overlay"===e.data.message&&$t(e.data,!0))},Fo=function(){let e=i(this,ko)[ko].dataPostURL,t={};t=i(this,xo)[xo].addSystemDataToObject(t,void 0),e=Ve(e,"type","ping"),e=Ve(e,"d",Ke(JSON.stringify(t),i(this,bo)[bo])),i(this,xo)[xo].saveAndFireRequest(e,le.blockRequest)},Uo=function(){return void 0!==window.wzrk_d&&"continuous"===window.wzrk_d.ping},qo=function(e){this._isPersonalisationActive()&&(e.dsync=!0)};const Vo=new class{get spa(){return i(this,So)[So]}set spa(e){const t=!0===e;i(this,So)[So]!==t&&1===i(this,yo)[yo]&&(t?document.addEventListener("click",i(this,Oo)[Oo]):document.removeEventListener("click",i(this,Oo)[Oo])),i(this,So)[So]=t}get dismissSpamControl(){return i(this,_o)[_o]}set dismissSpamControl(e){const t=!0===e;i(this,_o)[_o]=t,le.dismissSpamControl=t}constructor(){var e,t,o,n,s;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.defineProperty(this,jo,{value:qo}),Object.defineProperty(this,Ro,{value:Uo}),Object.defineProperty(this,To,{value:Fo}),Object.defineProperty(this,Mo,{value:No}),Object.defineProperty(this,Lo,{value:Bo}),Object.defineProperty(this,Ao,{value:zo}),Object.defineProperty(this,Eo,{value:Do}),Object.defineProperty(this,bo,{writable:!0,value:void 0}),Object.defineProperty(this,mo,{writable:!0,value:void 0}),Object.defineProperty(this,yo,{writable:!0,value:void 0}),Object.defineProperty(this,wo,{writable:!0,value:void 0}),Object.defineProperty(this,Co,{writable:!0,value:void 0}),Object.defineProperty(this,ko,{writable:!0,value:void 0}),Object.defineProperty(this,xo,{writable:!0,value:void 0}),Object.defineProperty(this,Po,{writable:!0,value:void 0}),Object.defineProperty(this,So,{writable:!0,value:void 0}),Object.defineProperty(this,Io,{writable:!0,value:void 0}),Object.defineProperty(this,Oo,{writable:!0,value:i(this,Lo)[Lo].bind(this)}),Object.defineProperty(this,_o,{writable:!0,value:void 0}),this.enablePersonalization=void 0,this.popupCallbacks={},this.popupCurrentWzrkId="",i(this,yo)[yo]=0,this._isPersonalisationActive=this._isPersonalisationActive.bind(this),this.raiseNotificationClicked=()=>{},i(this,bo)[bo]=new ai(ti),i(this,ko)[ko]=new d(null===(e=r.account)||void 0===e?void 0:e[0],r.region||(null===(t=r.account)||void 0===t?void 0:t[1]),r.targetDomain||(null===(o=r.account)||void 0===o?void 0:o[2]),r.token||(null===(n=r.account)||void 0===n?void 0:n[3])),i(this,wo)[wo]=new ye({logger:i(this,bo)[bo]}),i(this,_o)[_o]=r.dismissSpamControl||!1,i(this,Co)[Co]=new pi({logger:i(this,bo)[bo],isPersonalisationActive:this._isPersonalisationActive}),i(this,xo)[xo]=new xi({logger:i(this,bo)[bo],account:i(this,ko)[ko],device:i(this,wo)[wo],session:i(this,Co)[Co],isPersonalisationActive:this._isPersonalisationActive}),this.enablePersonalization=r.enablePersonalization||!1,this.event=new Fe({logger:i(this,bo)[bo],request:i(this,xo)[xo],isPersonalisationActive:this._isPersonalisationActive},r.event),this.profile=new gt({logger:i(this,bo)[bo],request:i(this,xo)[xo],account:i(this,ko)[ko],isPersonalisationActive:this._isPersonalisationActive},r.profile),this.onUserLogin=new It({request:i(this,xo)[xo],account:i(this,ko)[ko],session:i(this,Co)[Co],logger:i(this,bo)[bo],device:i(this,wo)[wo]},r.onUserLogin),this.privacy=new Ai({request:i(this,xo)[xo],account:i(this,ko)[ko],logger:i(this,bo)[bo]},r.privacy),this.notifications=new Gi({logger:i(this,bo)[bo],request:i(this,xo)[xo],account:i(this,ko)[ko]},r.notifications),i(this,Po)[Po]=new fo({logger:i(this,bo)[bo],request:i(this,xo)[xo],account:i(this,ko)[ko],event:this.event}),i(this,mo)[mo]=new be({logger:i(this,bo)[bo],request:i(this,xo)[xo],device:i(this,wo)[wo],session:i(this,Co)[Co]}),this.spa=r.spa,this.dismissSpamControl=r.dismissSpamControl,this.user=new Xt({isPersonalisationActive:this._isPersonalisationActive}),this.session={getTimeElapsed:()=>i(this,Co)[Co].getTimeElapsed(),getPageCount:()=>i(this,Co)[Co].getPageCount()},this.logout=()=>{i(this,bo)[bo].debug("logout called"),ae.setInstantDeleteFlagInK()},this.clear=()=>{this.onUserLogin.clear()},this.getCleverTapID=()=>i(this,wo)[wo].getGuid(),this.getAccountID=()=>i(this,ko)[ko].id,this.getSCDomain=()=>i(this,ko)[ko].finalTargetDomain,this.setLibrary=(e,t)=>{le.flutterVersion={[e]:t}},this.setSCSDKVersion=e=>{i(this,ko)[ko].scSDKVersion=e;const t={};t.af={scv:"sc-sdk-v"+i(this,ko)[ko].scSDKVersion};let o=i(this,ko)[ko].dataPostURL;o=Ve(o,"type","page"),o=Ve(o,"d",Ke(JSON.stringify(t),i(this,bo)[bo])),i(this,xo)[xo].saveAndFireRequest(o,le.blockRequest)},Kt()&&(qt(),Ut(i(this,bo)[bo])),this.getInboxMessageCount=()=>{const e=Nt();return Object.keys(e).length},this.getInboxMessageUnreadCount=()=>{if(le.inbox)return le.inbox.unviewedCounter;i(this,bo)[bo].debug("No unread messages")},this.getAllInboxMessages=()=>Nt(),this.getUnreadInboxMessages=()=>{if(le.inbox)return le.inbox.unviewedMessages;i(this,bo)[bo].debug("No unread messages")},this.getInboxMessageForId=e=>{const t=Nt();if((null!==e||""!==e)&&t.hasOwnProperty(e))return t[e];i(this,bo)[bo].error("No message available for message Id "+e)},this.deleteInboxMessage=e=>{const t=Nt();if(null===e&&""===e||!t.hasOwnProperty(e))i(this,bo)[bo].error("No message available for message Id "+e);else{const i=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);0===t[e].viewed&&(le.inbox.unviewedCounter--,delete le.inbox.unviewedMessages[e],document.getElementById("unviewedBadge").innerText=le.inbox.unviewedCounter,document.getElementById("unviewedBadge").style.display=le.inbox.unviewedCounter>0?"flex":"none"),i&&i.remove(),delete t[e],Ft(t)}},this.markReadInboxMessage=e=>{const t=le.inbox.unviewedMessages,o=Nt();if(null===e&&""===e||!t.hasOwnProperty(e))i(this,bo)[bo].error("No message available for message Id "+e);else{const t=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);if(null!==t&&(t.shadowRoot.getElementById("unreadMarker").style.display="none"),o[e].viewed=1,document.getElementById("unviewedBadge")){var n=parseInt(document.getElementById("unviewedBadge").innerText)-1;document.getElementById("unviewedBadge").innerText=n,document.getElementById("unviewedBadge").style.display=n>0?"flex":"none"}window.clevertap.renderNotificationViewed({msgId:o[e].wzrk_id,pivotId:o[e].pivotId}),le.inbox.unviewedCounter--,delete le.inbox.unviewedMessages[e],Ft(o)}},this.markReadInboxMessagesForIds=e=>{if(Array.isArray(e))for(var t=0;t{const e=le.inbox.unviewedMessages,t=Nt();if(Object.keys(e).length>0){Object.keys(e).forEach((e=>{const i=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);null!==i&&(i.shadowRoot.getElementById("unreadMarker").style.display="none"),t[e].viewed=1,window.clevertap.renderNotificationViewed({msgId:t[e].wzrk_id,pivotId:t[e].wzrk_pivot})})),document.getElementById("unviewedBadge").innerText=0,document.getElementById("unviewedBadge").style.display="none",Ft(t),le.inbox.unviewedCounter=0,le.inbox.unviewedMessages={}}else i(this,bo)[bo].debug("All messages are already read")},this.toggleInbox=e=>{var t;return null===(t=le.inbox)||void 0===t?void 0:t.toggleInbox(e)},this.renderNotificationViewed=e=>{a(R,e)},this.renderNotificationClicked=e=>{a(j,e)};const a=(e,t)=>{if(!t||!t.msgId)return;const o={type:"event"};if(o.evtName=e,o.evtData={[T]:t.msgId},t.pivotId&&(o.evtData={...o.evtData,wzrk_pivot:t.pivotId}),t.wzrk_slideNo&&(o.evtData={...o.evtData,wzrk_slideNo:t.wzrk_slideNo}),t.kv&&null!==t.kv&&void 0!==t.kv)for(const e in t.kv)e.startsWith(M)&&(o.evtData={...o.evtData,[e]:t.kv[e]});if(t.msgCTkv&&null!==t.msgCTkv&&void 0!==t.msgCTkv)for(const e in t.msgCTkv)e.startsWith(M)&&(o.evtData={...o.evtData,[e]:t.msgCTkv[e]});i(this,xo)[xo].processEvent(o)};this.setLogLevel=e=>{i(this,bo)[bo].logLevel=Number(e),3===e?sessionStorage.WZRK_D="":delete sessionStorage.WZRK_D},this.handleIncrementValue=(e,t)=>{this.profile._handleIncrementDecrementValue(e,t,B)},this.handleDecrementValue=(e,t)=>{this.profile._handleIncrementDecrementValue(e,t,"$decr")},this.setMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueSet(e,t,"$set"):console.error("setMultiValuesForKey should be called with a value of type array")},this.addMultiValueForKey=(e,t)=>{"string"==typeof t||"number"==typeof t?this.profile._handleMultiValueAdd(e,t,N):console.error("addMultiValueForKey should be called with a value of type string or number.")},this.addMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueAdd(e,t,N):console.error("addMultiValuesForKey should be called with a value of type array.")},this.removeMultiValueForKey=(e,t)=>{"string"==typeof t||"number"==typeof t?this.profile._handleMultiValueRemove(e,t,F):console.error("removeMultiValueForKey should be called with a value of type string or number.")},this.removeMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueRemove(e,t,F):console.error("removeMultiValuesForKey should be called with a value of type array.")},this.removeValueForKey=e=>{this.profile._handleMultiValueDelete(e,U)};const l=(e,t,o)=>{((e,t,i,o,n)=>{const s=qe(location.href),r=s.e,a=s.p,l=s.page_type;if(void 0!==r){const s={};s.id=o.id,s.unsubGroups=le.unsubGroups,le.updatedCategoryLong&&(s.cUsY=le.updatedCategoryLong);let c=o.emailURL;i&&(c=Ve(c,"fetchGroups",i)),t&&(c=Ve(c,"encoded",t)),c=Ve(c,"e",r),c=Ve(c,"d",Ke(JSON.stringify(s),n)),a&&(c=Ve(c,"p",a)),"-1"!==e&&(c=Ve(c,"sub",e)),l&&(le.globalUnsubscribe=l===I,c=Ve(c,"page_type",l)),Qe.fireRequest(c)}})(e,t,o,i(this,ko)[ko],i(this,bo)[bo])};function c(e){var t=e.coords.latitude,i=e.coords.longitude;le.location={Latitude:t,Longitude:i},this.sendLocationData({Latitude:t,Longitude:i})}function h(e){switch(e.code){case e.PERMISSION_DENIED:console.log("User denied the request for Geolocation.");break;case e.POSITION_UNAVAILABLE:console.log("Location information is unavailable.");break;case e.TIMEOUT:console.log("The request to get user location timed out.");break;case e.UNKNOWN_ERROR:console.log("An unknown error occurred.")}}this.getLocation=function(e,t){if(e&&"number"!=typeof e||t&&"number"!=typeof t)console.log("Latitude and Longitude must be of number type");else if(e&&t){if(e<=-90||e>90)return void console.log("A vaid latitude must range between -90 and 90");if(t<=-180||t>180)return void console.log("A valid longitude must range between -180 and 180");le.location={Latitude:e,Longitude:t},this.sendLocationData({Latitude:e,Longitude:t})}else navigator.geolocation?navigator.geolocation.getCurrentPosition(c.bind(this),h):console.log("Geolocation is not supported by this browser.")};const u=i(this,mo)[mo];u.logout=this.logout,u.clear=this.clear,u.closeIframe=(e,t)=>{at(e,0,i(this,Co)[Co].sessionId)},u.enableWebPush=(e,t)=>{this.notifications._enableWebPush(e,t)},u.tr=e=>{Yt(e,{device:i(this,wo)[wo],session:i(this,Co)[Co],request:i(this,xo)[xo],logger:i(this,bo)[bo]})},u.setEnum=e=>{((e,t)=>{if(H(e)||Q(e))return"$E_"+e;t.error(Ae)})(e,i(this,bo)[bo])},u.is_onloadcalled=()=>1===i(this,yo)[yo],u.subEmail=e=>{l("1",e)},u.getEmail=(e,t)=>{l("-1",e,t)},u.unSubEmail=e=>{l("0",e)},u.unsubEmailGroups=e=>{le.unsubGroups=[];const t=document.getElementsByClassName("ct-unsub-group-input-item");for(let e=0;e{le.unsubGroups=e},u.getSubscriptionGroups=()=>le.unsubGroups,u.changeSubscriptionGroups=(e,t)=>{u.setSubscriptionGroups(t),l("2",e)},u.isGlobalUnsubscribe=()=>le.globalUnsubscribe,u.setIsGlobalUnsubscribe=e=>{le.globalUnsubscribe=e},u.setUpdatedCategoryLong=e=>{e.cUsY&&(le.updatedCategoryLong=e.cUsY)},window.$CLTP_WR=window.$WZRK_WR=u,(null===(s=r.account)||void 0===s?void 0:s[0].id)&&this.init()}init(e,t,o,n){if(1===i(this,yo)[yo])return;if(ae.removeCookie("WZRK_P",window.location.hostname),!i(this,ko)[ko].id){if(!e)return void i(this,bo)[bo].error(ke);i(this,ko)[ko].id=e}i(this,Co)[Co].cookieName="WZRK_S_"+i(this,ko)[ko].id,t&&(i(this,ko)[ko].region=t),o&&(i(this,ko)[ko].targetDomain=o),n&&(i(this,ko)[ko].token=n);const s=location.href,r=qe(s.toLowerCase());if(void 0!==r.e&&"0"==r.wzrk_ex)return;le.isPrivacyArrPushed=!0,le.privacyArray.length>0&&this.privacy.push(le.privacyArray),i(this,Eo)[Eo](),this.pageChanged();const a=setInterval((()=>{i(this,wo)[wo].gcookie&&(clearInterval(a),i(this,xo)[xo].processBackupEvents())}),3e3);i(this,So)[So]?document.addEventListener("click",i(this,Oo)[Oo]):document.removeEventListener("click",i(this,Oo)[Oo]),i(this,yo)[yo]=1}pageChanged(){const e=window.location.search,t=window.opener;if("?ctBuilder"===e)return console.log("open in visual builder mode"),window.addEventListener("message",i(this,Mo)[Mo],!1),void(t&&t.postMessage("builder","*"));if("?ctBuilderPreview"===e)return window.addEventListener("message",i(this,Mo)[Mo],!1),void(t&&t.postMessage("preview","*"));const o=window.location.href,n=qe(o.toLowerCase()),s=i(this,Co)[Co].getSessionCookieObject();let r=void 0===s.p?0:s.p;s.p=++r,i(this,Co)[Co].setSessionCookieObject(s);let a={},l=(e=>{if(""===e)return"";var t=document.createElement("a");return t.href=e,t.hostname})(document.referrer);if(window.location.hostname!==l){const e=120;""!==l&&(l=l.length>e?l.substring(0,e):l,a.referrer=l);let t=n.utm_source||n.wzrk_source;void 0!==t&&(t=t.length>e?t.substring(0,e):t,a.us=t);let i=n.utm_medium||n.wzrk_medium;void 0!==i&&(i=i.length>e?i.substring(0,e):i,a.um=i);let o=n.utm_campaign||n.wzrk_campaign;if(void 0!==o&&(o=o.length>e?o.substring(0,e):o,a.uc=o),void 0!==n.wzrk_medium){const e=n.wzrk_medium;e.match(/^email$|^social$|^search$/)&&(a.wm=e)}}a=i(this,xo)[xo].addSystemDataToObject(a,void 0),a.cpg=o,a.WZRK_CAMP=it();let c=i(this,ko)[ko].dataPostURL;i(this,xo)[xo].addFlags(a),1===parseInt(a.pg)&&i(this,jo)[jo](a),c=Ve(c,"type","page"),c=Ve(c,"d",Ke(JSON.stringify(a),i(this,bo)[bo])),i(this,xo)[xo].saveAndFireRequest(c,le.blockRequest),1===parseInt(a.pg)&&this.event.push(K,{t:4}),i(this,Io)[Io]=o,setTimeout((()=>{r<=3&&i(this,To)[To](),i(this,Ro)[Ro]()&&setInterval((()=>{i(this,To)[To]()}),3e5)}),12e4)}_isPersonalisationActive(){return ae._isLocalStorageSupported()&&this.enablePersonalization}set popupCallback(e){this.popupCallbacks[this.popupCurrentWzrkId]=e}sendLocationData(e){let t={af:{}};const o={};if(t.type="profile",null==o.tz&&(o.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),t.profile=o,e){Object.keys(e).forEach((i=>{t.af[i]=e[i]}))}le.location&&(t.af={...t.af,...le.location}),t=i(this,xo)[xo].addSystemDataToObject(t,!0),i(this,xo)[xo].addFlags(t);const n=Ke(JSON.stringify(t),i(this,bo)[bo]);let s=i(this,ko)[ko].dataPostURL;s=Ve(s,"type",A),s=Ve(s,"d",n),i(this,xo)[xo].saveAndFireRequest(s,le.blockRequest)}setOffline(e){"boolean"==typeof e?(le.offline=e,e||i(this,xo)[xo].processBackupEvents()):console.error("setOffline should be called with a value of type boolean")}defineVariable(e,t){return io.define(e,t,i(this,Po)[Po])}syncVariables(e,t){if(4===i(this,bo)[bo].logLevel)return i(this,Po)[Po].syncVariables(e,t);{const e="App log level is not set to 4";return i(this,bo)[bo].error(e),Promise.reject(new Error(e))}}fetchVariables(e){i(this,Po)[Po].fetchVariables(e)}addVariablesChangedCallback(e){i(this,Po)[Po].addVariablesChangedCallback(e)}addOneTimeVariablesChangedCallback(e){i(this,Po)[Po].addOneTimeVariablesChangedCallback(e)}}(window.clevertap);return window.clevertap=window.wizrocket=Vo,Vo})); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).clevertap=t()}(this,(function(){"use strict";var e=0;function t(t){return"__private_"+e+++"_"+t}function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}const o="clevertap-prod.com",n="https:";var s=t("accountId"),r=t("region"),a=t("targetDomain"),l=t("dcSdkversion"),c=t("token");class d{constructor(){let{id:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";Object.defineProperty(this,s,{writable:!0,value:void 0}),Object.defineProperty(this,r,{writable:!0,value:""}),Object.defineProperty(this,a,{writable:!0,value:o}),Object.defineProperty(this,l,{writable:!0,value:""}),Object.defineProperty(this,c,{writable:!0,value:""}),this.id=e,t&&(this.region=t),i&&(this.targetDomain=i),n&&(this.token=n)}get id(){return i(this,s)[s]}set id(e){i(this,s)[s]=e}get region(){return i(this,r)[r]}set region(e){i(this,r)[r]=e}get dcSDKVersion(){return i(this,l)[l]}set dcSDKVersion(e){i(this,l)[l]=e}get targetDomain(){return i(this,a)[a]}set targetDomain(e){i(this,a)[a]=e}get token(){return i(this,c)[c]}set token(e){i(this,c)[c]=e}get finalTargetDomain(){return this.region?"".concat(this.region,".").concat(this.targetDomain):this.targetDomain===o?"".concat("eu1",".").concat(this.targetDomain):this.targetDomain}get dataPostPEURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/defineVars")}get dataPostURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/a?t=96")}get recorderURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/r?r=1")}get emailURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/e?r=1")}}const h=new RegExp("^\\s+|\\.|:|\\$|'|\"|\\\\|\\s+$","g"),u=new RegExp("^\\s+|'|\"|\\\\|\\s+$","g"),p=new RegExp("'","g"),g="clear",f="Charged ID",v="WZRK_CHARGED_ID",b="WZRK_G",m="WZRK_K",y="WZRK_CAMP",w="WZRK_CAMP_G",C="WZRK_EV",k="WZRK_META",x="WZRK_PR",P="WZRK_ARP",S="WZRK_L",I="global",O="optOut",_="useIP",E="WZRK_X",A="push",L=31536e3,M="wzrk_",T="wzrk_id",R="Notification Viewed",j="Notification Clicked",D="WZRK_FPU",z="WZRK_PSD",B="$incr",N="$add",F="$remove",U="$delete",q="WZRK_INBOX_CONFIG",V="WZRK_INBOX",W=1e3,K="wzrk_fetch",G=["Stayed","UTM Visited","App Launched","Notification Sent",R,j],H=e=>"string"==typeof e||e instanceof String,J=e=>"[object Object]"===Object.prototype.toString.call(e),Z=e=>"object"==typeof e&&e instanceof Date,$=e=>{for(const t in e)if(e.hasOwnProperty(t))return!1;return!0},Y=e=>!isNaN(parseFloat(e))&&isFinite(e),Q=e=>/^-?[\d.]+(?:e-?\d+)?$/.test(e)&&"number"==typeof e,X=e=>null!=e&&"undefined"!==e,ee=(e,t)=>{if("object"!=typeof e){let i;return H(e)?(i=te(e,u),i.length>1024&&(i=i.substring(0,1024),t.reportError(521,i+"... length exceeded 1024 chars. Trimmed."))):i=e,i}for(const i in e)if(e.hasOwnProperty(i)){const o=ee(e[i],t);let n;n=te(i,h),n.length>1024&&(n=n.substring(0,1024),t.reportError(520,n+"... length exceeded 1024 chars. Trimmed.")),delete e[i],e[n]=o}return e},te=(e,t)=>e.replace(t,""),ie=()=>{const e=new Date;return e.getFullYear()+""+e.getMonth()+e.getDay()},oe=()=>Math.floor((new Date).getTime()/1e3),ne=e=>"$D_"+Math.round(e.getTime()/1e3),se=e=>{if(re(e))return"$D_"+e},re=e=>{const t=/^(\d{4})(\d{2})(\d{2})$/.exec(e);if(null==t)return!1;const i=t[3],o=t[2]-1,n=t[1],s=new Date(n,o,i);return s.getDate()==i&&s.getMonth()==o&&s.getFullYear()==n};class ae{static save(e,t){return!(!e||!t)&&(this._isLocalStorageSupported()?(localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),!0):void 0)}static read(e){if(!e)return!1;let t=null;if(this._isLocalStorageSupported()&&(t=localStorage.getItem(e)),null!=t)try{t=JSON.parse(t)}catch(e){}return t}static remove(e){return!!e&&(this._isLocalStorageSupported()?(localStorage.removeItem(e),!0):void 0)}static removeCookie(e,t){let i=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";t&&(i=i+" domain="+t+"; path=/"),document.cookie=i}static createCookie(e,t,i,o){let n="",s="";if(i){const e=new Date;e.setTime(e.getTime()+1e3*i),n="; expires="+e.toGMTString()}o&&(s="; domain="+o),t=encodeURIComponent(t),document.cookie=e+"="+t+n+s+"; path=/"}static readCookie(e){const t=e+"=",i=document.cookie.split(";");for(let e=0;e=0;o--){if(a=0===o?r[o]+a:"."+r[o]+a,this.readCookie(e)){var n="test_"+e+o;if(this.createCookie(n,t,10,a),!this.readCookie(n))continue;this.removeCookie(n,a)}this.createCookie(e,t,i,a);if(this.readCookie(e)==t){s=a,le.broadDomain=s;break}}}else this.createCookie(e,t,i,s)}else this.createCookie(e,t,i,o)}static getMetaProp(e){const t=this.readFromLSorCookie(k);if(null!=t)return t[e]}static setMetaProp(e,t){if(this._isLocalStorageSupported()){let i=this.readFromLSorCookie(k);null==i&&(i={}),void 0===t?delete i[e]:i[e]=t,this.saveToLSorCookie(k,i)}}static getAndClearMetaProp(e){const t=this.getMetaProp(e);return this.setMetaProp(e,void 0),t}static setInstantDeleteFlagInK(){let e=this.readFromLSorCookie(m);null==e&&(e={}),e.flag=!0,this.saveToLSorCookie(m,e)}static backupEvent(e,t,i){let o=this.readFromLSorCookie(S);void 0===o&&(o={}),o[t]={q:e},this.saveToLSorCookie(S,o),i.debug("stored in ".concat(S," reqNo : ").concat(t," -> ").concat(e))}static removeBackup(e,t){const i=this.readFromLSorCookie(S);null!=i&&void 0!==i[e]&&(t.debug("del event: ".concat(e," data-> ").concat(i[e].q)),delete i[e],this.saveToLSorCookie(S,i))}}const le={globalCache:{gcookie:null,REQ_N:0,RESP_N:0},LRU_CACHE:null,globalProfileMap:void 0,globalEventsMap:void 0,blockRequest:!1,isOptInRequest:!1,broadDomain:null,webPushEnabled:null,campaignDivMap:{},currentSessionId:null,wiz_counter:0,notifApi:{notifEnabledFromApi:!1},unsubGroups:[],updatedCategoryLong:null,inbox:null,isPrivacyArrPushed:!1,privacyArray:[],offline:!1,location:null,dismissSpamControl:!1,globalUnsubscribe:!0,flutterVersion:null,variableStore:{}};var ce=t("keyOrder"),de=t("deleteFromObject");class he{constructor(e){Object.defineProperty(this,de,{value:ue}),Object.defineProperty(this,ce,{writable:!0,value:void 0}),this.max=e;let t=ae.readFromLSorCookie(E);if(t){const e={};i(this,ce)[ce]=[],t=t.cache;for(const o in t)t.hasOwnProperty(o)&&(e[t[o][0]]=t[o][1],i(this,ce)[ce].push(t[o][0]));this.cache=e}else this.cache={},i(this,ce)[ce]=[]}get(e){const t=this.cache[e];return t&&(this.cache=i(this,de)[de](e,this.cache),this.cache[e]=t,i(this,ce)[ce].push(e)),this.saveCacheToLS(this.cache),t}set(e,t){const o=this.cache[e],n=i(this,ce)[ce];null!=o?this.cache=i(this,de)[de](e,this.cache):n.length===this.max&&(this.cache=i(this,de)[de](n[0],this.cache)),this.cache[e]=t,i(this,ce)[ce][i(this,ce)[ce]-1]!==e&&i(this,ce)[ce].push(e),this.saveCacheToLS(this.cache)}saveCacheToLS(e){const t=[],o=i(this,ce)[ce];for(const i in o)if(o.hasOwnProperty(i)){const n=[];n.push(o[i]),n.push(e[o[i]]),t.push(n)}ae.saveToLSorCookie(E,{cache:t})}getKey(e){if(null===e)return null;const t=i(this,ce)[ce];for(const i in t)if(t.hasOwnProperty(i)&&this.cache[t[i]]===e)return t[i];return null}getSecondLastKey(){const e=i(this,ce)[ce];return null!=e&&e.length>1?e[e.length-2]:-1}getLastKey(){const e=i(this,ce)[ce].length;if(e)return i(this,ce)[ce][e-1]}}var ue=function(e,t){const o=JSON.parse(JSON.stringify(i(this,ce)[ce])),n={};let s;for(const i in o)o.hasOwnProperty(i)&&(o[i]!==e?n[o[i]]=t[o[i]]:s=i);return o.splice(s,1),i(this,ce)[ce]=JSON.parse(JSON.stringify(o)),n},pe=t("logger"),ge=t("request"),fe=t("device"),ve=t("session");class be{constructor(e){let{logger:t,request:o,device:n,session:s}=e;Object.defineProperty(this,pe,{writable:!0,value:void 0}),Object.defineProperty(this,ge,{writable:!0,value:void 0}),Object.defineProperty(this,fe,{writable:!0,value:void 0}),Object.defineProperty(this,ve,{writable:!0,value:void 0}),i(this,pe)[pe]=t,i(this,ge)[ge]=o,i(this,fe)[fe]=n,i(this,ve)[ve]=s}s(e,t,o,n,s){let r=!1,a=!1;if(window.isOULInProgress&&(o||"undefined"!==n&&n===window.oulReqN)&&(window.isOULInProgress=!1,r=!0),void 0===n&&(n=0),ae.removeBackup(n,i(this,pe)[pe]),n>le.globalCache.REQ_N)return;if(X(i(this,fe)[fe].gcookie)||e&&(a=!0),!X(i(this,fe)[fe].gcookie)||o||"boolean"==typeof s){const n=i(this,ve)[ve].getSessionCookieObject();if(window.isOULInProgress||n.s&&t{if(J(e)){for(var t in e)if(e.hasOwnProperty(t)){if(J(e[t])||Array.isArray(e[t]))return!1;Z(e[t])&&(e[t]=ne(e[t]))}return!0}return!1},Re=(e,t)=>{if(J(e)){for(var i in e)if(e.hasOwnProperty(i))if("Items"===i){if(!Array.isArray(e[i]))return!1;for(var o in e[i].length>50&&t.reportError(522,"Charged Items exceed 50 limit. Actual count: "+e[i].length),e[i])if(e[i].hasOwnProperty(o)&&(!J(e[i][o])||!Te(e[i][o])))return!1}else{if(J(e[i])||Array.isArray(e[i]))return!1;Z(e[i])&&(e[i]=ne(e[i]))}if(H(e[f])||Q(e[f])){const i=e[f]+"";if(void 0===Me&&(Me=ae.readFromLSorCookie(v)),void 0!==Me&&Me.trim()===i.trim())return t.error("Duplicate charged Id - Dropped"+e),!1;Me=i,ae.saveToLSorCookie(v,i)}return!0}return!1};var je=t("logger"),De=t("oldValues"),ze=t("request"),Be=t("isPersonalisationActive"),Ne=t("processEventArray");class Fe extends Array{constructor(e,t){let{logger:o,request:n,isPersonalisationActive:s}=e;super(),Object.defineProperty(this,Ne,{value:Ue}),Object.defineProperty(this,je,{writable:!0,value:void 0}),Object.defineProperty(this,De,{writable:!0,value:void 0}),Object.defineProperty(this,ze,{writable:!0,value:void 0}),Object.defineProperty(this,Be,{writable:!0,value:void 0}),i(this,je)[je]=o,i(this,De)[De]=t,i(this,ze)[ze]=n,i(this,Be)[Be]=s}push(){for(var e=arguments.length,t=new Array(e),o=0;o0;){var t=e.shift();if(!H(t)){i(this,je)[je].error(xe);continue}if(t.length>1024&&(t=t.substring(0,1024),i(this,je)[je].reportError(510,t+"... length exceeded 1024 chars. Trimmed.")),G.includes(t)){i(this,je)[je].reportError(513,t+" is a restricted system event. It cannot be used as an event name.");continue}const o={type:"event"};if(o.evtName=te(t,h),0!==e.length){const n=e.shift();if(J(n)){if("Charged"===t){if(!Re(n,i(this,je)[je])){i(this,je)[je].reportError(511,"Charged event structure invalid. Not sent.");continue}}else if(!Te(n)){i(this,je)[je].reportError(512,t+" event structure invalid. Not sent.");continue}o.evtData=n}else e.unshift(n)}i(this,ze)[ze].processEvent(o)}};const qe=e=>{const t={},i=e.indexOf("?");if(i>1){const o=e.substring(i+1);let n;const s=/\+/g,r=/([^&=]+)=?([^&]*)/g,a=function(e){let t=e.replace(s," ");try{t=decodeURIComponent(t)}catch(e){}return t};for(n=r.exec(o);n;)t[a(n[1])]=a(n[2]),n=r.exec(o)}return t},Ve=(e,t,i)=>e+"&"+t+"="+encodeURIComponent(i),We=()=>window.location.hostname,Ke=(e,t)=>(t&&"function"==typeof t.debug&&t.debug("dobj:"+e),He(e)),Ge=(()=>{let e="",t=0;for(t=0;t<=25;t++)e+=String.fromCharCode(t+65);for(t=0;t<=25;t++)e+=String.fromCharCode(t+97);for(t=0;t<10;t++)e+=t;return e+"+/="})(),He=e=>{if(null==e)return"";var t,i,o,n,s,r,a,l="",c=0;for(e=(e=>{if(null==e)return"";let t,i,o,n={},s={},r="",a="",l="",c=2,d=3,h=2,u="",p=0,g=0,f=String.fromCharCode;for(o=0;o>=1}else{for(i=1,t=0;t>=1}c--,0==c&&(c=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;c--,0==c&&(c=Math.pow(2,h),h++),n[a]=d++,l=String(r)}if(""!==l){if(Object.prototype.hasOwnProperty.call(s,l)){if(l.charCodeAt(0)<256){for(t=0;t>=1}else{for(i=1,t=0;t>=1}c--,0==c&&(c=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;c--,0==c&&(c=Math.pow(2,h),h++)}for(i=2,t=0;t>=1;for(;;){if(p<<=1,15==g){u+=f(p);break}g++}return u})(e);c<2*e.length;)c%2==0?(t=e.charCodeAt(c/2)>>8,i=255&e.charCodeAt(c/2),o=c/2+1>8:NaN):(t=255&e.charCodeAt((c-1)/2),(c+1)/2>8,o=255&e.charCodeAt((c+1)/2)):i=o=NaN),c+=3,n=t>>2,s=(3&t)<<4|i>>4,r=(15&i)<<2|o>>6,a=63&o,isNaN(i)?r=a=64:isNaN(o)&&(a=64),l=l+Ge.charAt(n)+Ge.charAt(s)+Ge.charAt(r)+Ge.charAt(a);return l};var Je=t("fireRequest"),Ze=t("dropRequestDueToOptOut"),$e=t("addUseIPToRequest"),Ye=t("addARPToRequest");class Qe{constructor(){this.networkRetryCount=0,this.minDelayFrequency=0}static fireRequest(e,t,o,n){i(this,Je)[Je](e,1,t,o,n)}getDelayFrequency(){if(this.logger.debug("Network retry #"+this.networkRetryCount),this.networkRetryCount<10)return this.logger.debug(this.account.id,"Failure count is "+this.networkRetryCount+". Setting delay frequency to 1s"),this.minDelayFrequency=W,this.minDelayFrequency;if(null==this.account.region)return this.logger.debug(this.account.id,"Setting delay frequency to 1s"),W;{const e=1e3*(Math.floor(10*Math.random())+1);return this.minDelayFrequency+=e,this.minDelayFrequency<6e5?(this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency):(this.minDelayFrequency=W,this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency)}}}Qe.logger=void 0,Qe.device=void 0,Qe.account=void 0,Object.defineProperty(Qe,Je,{value:function(e,t,o,n,s){var r,a;if(i(this,Ze)[Ze]())return void this.logger.debug("req dropped due to optout cookie: "+this.device.gcookie);if(X(this.device.gcookie)||(le.blockRequest=!0),s&&s===K)!X(this.device.gcookie)&&le.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(this.networkRetryCount)),i(this,Je)[Je](e,void 0,o,n)}),this.getDelayFrequency());else if(!X(this.device.gcookie)&&le.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(t)),i(this,Je)[Je](e,t+1,o,n)}),50);if(n?window.isOULInProgress=!0:(X(this.device.gcookie)&&(e=Ve(e,"gc",this.device.gcookie)),e=i(this,Ye)[Ye](e,o)),e=Ve(e,"tries",t),e=i(this,$e)[$e](e),e=Ve(e,"r",(new Date).getTime()),(null===(r=window.clevertap)||void 0===r?void 0:r.hasOwnProperty("plugin"))||(null===(a=window.wizrocket)||void 0===a?void 0:a.hasOwnProperty("plugin"))){const t=window.clevertap.plugin||window.wizrocket.plugin;e=Ve(e,"ct_pl",t)}-1!==e.indexOf("chrome-extension:")&&(e=e.replace("chrome-extension:","https:"));for(var l=document.getElementsByClassName("ct-jp-cb");l[0]&&l[0].parentNode;)l[0].parentNode.removeChild(l[0]);const c=document.createElement("script");c.setAttribute("type","text/javascript"),c.setAttribute("src",e),c.setAttribute("class","ct-jp-cb"),c.setAttribute("rel","nofollow"),c.async=!0,document.getElementsByTagName("head")[0].appendChild(c),this.logger.debug("req snt -> url: "+e)}}),Object.defineProperty(Qe,Ze,{value:function(){return!le.isOptInRequest&&X(this.device.gcookie)&&H(this.device.gcookie)?":OO"===this.device.gcookie.slice(-3):(le.isOptInRequest=!1,!1)}}),Object.defineProperty(Qe,$e,{value:function(e){var t=ae.getMetaProp(_);return"boolean"!=typeof t&&(t=!1),Ve(e,_,t?"true":"false")}}),Object.defineProperty(Qe,Ye,{value:function(e,t){if(!0===t){const t={skipResARP:!0};return Ve(e,"arp",Ke(JSON.stringify(t),this.logger))}return ae._isLocalStorageSupported()&&void 0!==localStorage.getItem(P)&&null!==localStorage.getItem(P)?Ve(e,"arp",Ke(JSON.stringify(ae.readFromLSorCookie(P)),this.logger)):e}});const Xe=()=>{let e={};if(ae._isLocalStorageSupported()){let t=ae.read(y);null!=t?(t=JSON.parse(decodeURIComponent(t).replace(p,'"')),t.hasOwnProperty("global")?e.wp=t:e=t):e={}}return e},et=e=>{if(ae._isLocalStorageSupported()){const t={...Xe(),...e},i=JSON.stringify(t);ae.save(y,encodeURIComponent(i)),tt()}},tt=()=>{if(ae._isLocalStorageSupported()){let i=ae.read(b);if(X(i))try{i=JSON.parse(decodeURIComponent(ae.read(b)));const o=ae.read(w)?JSON.parse(decodeURIComponent(ae.read(w))):{};if(i&&ae._isLocalStorageSupported()){var e={},t=Xe();Object.keys(t).forEach((n=>{const s=i in o&&Object.keys(o[i]).length&&o[i][n]?o[i][n]:{},r=t[n].global,a=ie(),l=t[n][a];if(void 0!==r){const e=Object.keys(r);for(const t in e){let i=[];if(e.hasOwnProperty(t)){let o=0,n=0;const a=e[t];if("tc"===a)continue;void 0!==l&&void 0!==l[a]&&(o=l[a]),void 0!==r&&void 0!==r[a]&&(n=r[a]),i=[a,o,n],s[a]=i}}}e={...e,[n]:s}})),o[i]=e,ae.save(w,encodeURIComponent(JSON.stringify(o)))}}catch(e){console.error("Invalid clevertap Id "+e)}}},it=()=>{const e=JSON.parse(decodeURIComponent(ae.read(b)));let t={};if(ae._isLocalStorageSupported()){let i={};t=Xe();const o=ae.read(w),n=o?decodeURIComponent(o):null,s=n?JSON.parse(n):null,r=e&&null!=o&&s&&s[e]&&s[e].wp?Object.values(s[e].wp):[],a=e&&null!=o&&s&&s[e]&&s[e].wi?Object.values(s[e].wi):[],l=ie();let c=0,d=0;return t.wp&&t.wp[l]&&"undefined"!==t.wp[l].tc&&(c=t.wp[l].tc),t.wi&&t.wi[l]&&"undefined"!==t.wi[l].tc&&(d=t.wi[l].tc),i={wmp:c,wimp:d,tlc:r,witlc:a},i}},ot=(e,t)=>{let{logger:i}=t,o=!1;if(J(e))for(const t in e)if(e.hasOwnProperty(t)){o=!0;let n=e[t];if(null==n){delete e[t];continue}"Gender"!==t||n.match(/^M$|^F$/)||(o=!1,i.error(Pe)),"Employed"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Se)),"Married"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Ie)),"Education"!==t||n.match(/^School$|^College$|^Graduate$/)||(o=!1,i.error(Oe)),"Age"===t&&null!=n&&(Y(n)?e.Age=+n:(o=!1,i.error(_e))),"DOB"===t?(/^\$D_/.test(n)&&11===(n+"").length||Z(n)||(o=!1,i.error(Ee)),Z(n)&&(e[t]=ne(n))):Z(n)&&(e[t]=ne(n)),"Phone"!==t||$(n)||(n.length>8&&"+"===n.charAt(0)?(n=n.substring(1,n.length),Y(n)?e.Phone=+n:(o=!1,i.error(Le+". Removed."))):(o=!1,i.error(Le+". Removed."))),o||delete e[t]}return o},nt=e=>{const t={};t.Name=e.name,null!=e.id&&(t.FBID=e.id+""),"male"===e.gender?t.Gender="M":"female"===e.gender?t.Gender="F":t.Gender="O";null!=e.relationship_status&&(t.Married="N","Married"===e.relationship_status&&(t.Married="Y"));const i=function(e){if(null!=e){let t="",i="";for(let o=0;o0?"Y":"N",null!=e.email&&(t.Email=e.email),null!=e.birthday){const i=e.birthday.split("/");t.DOB=se(i[2]+i[0]+i[1])}return t},st=(e,t)=>{let{logger:i}=t;const o={};if(null!=e.displayName&&(o.Name=e.displayName),null!=e.id&&(o.GPID=e.id+""),null!=e.gender&&("male"===e.gender?o.Gender="M":"female"===e.gender?o.Gender="F":"other"===e.gender&&(o.Gender="O")),null!=e.image&&!1===e.image.isDefault&&(o.Photo=e.image.url.split("?sz")[0]),null!=e.emails)for(let t=0;t{if(ae._isLocalStorageSupported()){if(null==le.globalProfileMap&&(le.globalProfileMap=ae.readFromLSorCookie(x),null==le.globalProfileMap&&(le.globalProfileMap={})),null!=e._custom){const t=e._custom;for(const i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);delete e._custom}for(const i in e)if(e.hasOwnProperty(i)){if(le.globalProfileMap.hasOwnProperty(i)&&!t)continue;le.globalProfileMap[i]=e[i]}null!=le.globalProfileMap._custom&&delete le.globalProfileMap._custom,ae.saveToLSorCookie(x,le.globalProfileMap)}},at=(e,t,i)=>{if(null!=e&&"-1"!==e&&ae._isLocalStorageSupported()){const t=Xe();let o=t.wp[i];null==o&&(o={},t[i]=o),o[e]="dnd",et(t)}if(null!=le.campaignDivMap){const t=le.campaignDivMap[e];null!=t&&(document.getElementById(t).style.display="none","intentPreview"===t&&null!=document.getElementById("intentOpacityDiv")&&(document.getElementById("intentOpacityDiv").style.display="none"))}};var lt=t("logger"),ct=t("request"),dt=t("account"),ht=t("oldValues"),ut=t("isPersonalisationActive"),pt=t("processProfileArray");class gt extends Array{constructor(e,t){let{logger:o,request:n,account:s,isPersonalisationActive:r}=e;super(),Object.defineProperty(this,pt,{value:ft}),Object.defineProperty(this,lt,{writable:!0,value:void 0}),Object.defineProperty(this,ct,{writable:!0,value:void 0}),Object.defineProperty(this,dt,{writable:!0,value:void 0}),Object.defineProperty(this,ht,{writable:!0,value:void 0}),Object.defineProperty(this,ut,{writable:!0,value:void 0}),i(this,lt)[lt]=o,i(this,ct)[ct]=n,i(this,dt)[dt]=s,i(this,ht)[ht]=t,i(this,ut)[ut]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o0)for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];let n,s={};if(null!=o.Site){if(n=o.Site,$(n)||!ot(n,{logger:i(this,lt)[lt]}))return}else if(null!=o.Facebook){const e=o.Facebook;$(e)||e.error||(n=nt(e))}else if(null!=o["Google Plus"]){const e=o["Google Plus"];$(e)||e.error||(n=st(e,{logger:i(this,lt)[lt]}))}if(null!=n&&!$(n)){s.type="profile",null==n.tz&&(n.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),s.profile=n,rt(n,!0),s=i(this,ct)[ct].addSystemDataToObject(s,void 0),i(this,ct)[ct].addFlags(s);const e=Ke(JSON.stringify(s),i(this,lt)[lt]);let t=i(this,dt)[dt].dataPostURL;t=Ve(t,"type",A),t=Ve(t,"d",e),i(this,ct)[ct].saveAndFireRequest(t,le.blockRequest)}}},vt=t("request"),bt=t("logger"),mt=t("account"),yt=t("session"),wt=t("oldValues"),Ct=t("device"),kt=t("processOUL"),xt=t("handleCookieFromCache"),Pt=t("deleteUser"),St=t("processLoginArray");class It extends Array{constructor(e,t){let{request:o,account:n,session:s,logger:r,device:a}=e;super(),Object.defineProperty(this,St,{value:At}),Object.defineProperty(this,Pt,{value:Et}),Object.defineProperty(this,xt,{value:_t}),Object.defineProperty(this,kt,{value:Ot}),Object.defineProperty(this,vt,{writable:!0,value:void 0}),Object.defineProperty(this,bt,{writable:!0,value:void 0}),Object.defineProperty(this,mt,{writable:!0,value:void 0}),Object.defineProperty(this,yt,{writable:!0,value:void 0}),Object.defineProperty(this,wt,{writable:!0,value:void 0}),Object.defineProperty(this,Ct,{writable:!0,value:void 0}),i(this,vt)[vt]=o,i(this,mt)[mt]=n,i(this,yt)[yt]=s,i(this,bt)[bt]=r,i(this,wt)[wt]=t,i(this,Ct)[Ct]=a}clear(){i(this,bt)[bt].debug("clear called. Reset flag has been set."),i(this,Pt)[Pt](),ae.setMetaProp(g,!0)}push(){for(var e=arguments.length,t=new Array(e),o=0;o{let o=ae.readFromLSorCookie(m);const n=ae.readFromLSorCookie(b);let s;if(null==o)o={},s=e;else{s=o.id;let r=!1,a=!1;if(null==s&&(s=e[0],r=!0),null==le.LRU_CACHE&&ae._isLocalStorageSupported()&&(le.LRU_CACHE=new he(100)),r)null!=n&&(le.LRU_CACHE.set(s,n),le.blockRequest=!1);else for(const t in e)if(e.hasOwnProperty(t)){const i=e[t];if(le.LRU_CACHE.cache[i]){s=i,a=!0;break}}if(a){s!==le.LRU_CACHE.getLastKey()?i(this,xt)[xt]():(t=!1,ae.saveToLSorCookie(D,t));const e=le.LRU_CACHE.get(s);le.LRU_CACHE.set(s,e),ae.saveToLSorCookie(b,e),i(this,Ct)[Ct].gcookie=e;const o=le.LRU_CACHE.getSecondLastKey();if(ae.readFromLSorCookie(D)&&-1!==o){const e=le.LRU_CACHE.cache[o];i(this,vt)[vt].unregisterTokenForGuid(e)}}else r?null!=n&&(i(this,Ct)[Ct].gcookie=n,ae.saveToLSorCookie(b,n),t=!1):this.clear(),ae.saveToLSorCookie(D,!1),s=e[0]}o.id=s,ae.saveToLSorCookie(m,o)};if(Array.isArray(e)&&e.length>0)for(const n in e)if(e.hasOwnProperty(n)){const s=e[n];let r,a={};if(null!=s.Site){if(r=s.Site,$(r)||!ot(r,{logger:i(this,bt)[bt]}))return}else if(null!=s.Facebook){const e=s.Facebook;$(e)||e.error||(r=nt(e))}else if(null!=s["Google Plus"]){const e=s["Google Plus"];$(e)&&!e.error&&(r=st(e,{logger:i(this,bt)[bt]}))}if(null!=r&&!$(r)){a.type="profile",null==r.tz&&(r.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),a.profile=r;const e=[];ae._isLocalStorageSupported()&&(r.Identity&&e.push(r.Identity),r.Email&&e.push(r.Email),r.GPID&&e.push("GP:"+r.GPID),r.FBID&&e.push("FB:"+r.FBID),e.length>0&&o(e)),rt(r,!0),a=i(this,vt)[vt].addSystemDataToObject(a,void 0),i(this,vt)[vt].addFlags(a),t&&(a.isOUL=!0);const n=Ke(JSON.stringify(a),i(this,bt)[bt]);let s=i(this,mt)[mt].dataPostURL;s=Ve(s,"type",A),s=Ve(s,"d",n),i(this,vt)[vt].saveAndFireRequest(s,le.blockRequest,t)}}},_t=function(){le.blockRequest=!1,console.debug("Block request is false"),ae._isLocalStorageSupported()&&(delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),ae.removeCookie(y,We()),ae.removeCookie(i(this,yt)[yt].cookieName,le.broadDomain),ae.removeCookie(P,le.broadDomain),i(this,yt)[yt].setSessionCookieObject("")},Et=function(){le.blockRequest=!0,i(this,bt)[bt].debug("Block request is true"),le.globalCache={gcookie:null,REQ_N:0,RESP_N:0},ae._isLocalStorageSupported()&&(delete localStorage.WZRK_G,delete localStorage.WZRK_K,delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),ae.removeCookie(b,le.broadDomain),ae.removeCookie(y,We()),ae.removeCookie(m,We()),ae.removeCookie(i(this,yt)[yt].cookieName,le.broadDomain),ae.removeCookie(P,le.broadDomain),i(this,Ct)[Ct].gcookie=null,i(this,yt)[yt].setSessionCookieObject("")},At=function(e){if(Array.isArray(e)&&e.length>0){const t=e.pop();if(null!=t&&J(t)&&(null!=t.Site&&Object.keys(t.Site).length>0||null!=t.Facebook&&Object.keys(t.Facebook).length>0||null!=t["Google Plus"]&&Object.keys(t["Google Plus"]).length>0)){ae.setInstantDeleteFlagInK();try{i(this,kt)[kt]([t])}catch(e){i(this,bt)[bt].debug(e)}}else i(this,bt)[bt].error("Profile object is in incorrect format")}};class Lt extends HTMLElement{constructor(){super(),this._details=null,this.shadow=null,this.shadow=this.attachShadow({mode:"open"})}get details(){return this._details||""}set details(e){null===this._details&&(this._details=e,this.renderBanner())}renderBanner(){this.shadow.innerHTML=this.getBannerContent(),!1!==this.trackClick&&this.addEventListener("click",(()=>{const e=this.details.onClick;e&&(this.details.window?window.open(e,"_blank"):window.parent.location.href=e),window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId})}getBannerContent(){return'\n \n \n ")}}class Mt extends HTMLElement{constructor(){super(),this._target=null,this._carousel=null,this.shadow=null,this.slides=0,this.previouslySelectedItem=-1,this.selectedItem=1,this.autoSlide=null,this.stopAutoSlideTimeout=null,this.shadow=this.attachShadow({mode:"open"}),void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Lt)}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderCarousel())}get details(){return this.target.display.details}get display(){return this.target.display}renderCarousel(){this.slides=this.details.length,this.shadow.innerHTML=this.getStyles();const e=this.getCarouselContent();this.display.showNavBtns&&e.insertAdjacentHTML("beforeend",this.display.navBtnsHtml),this.display.showNavArrows&&(e.insertAdjacentHTML("beforeend",this.display.leftNavArrowHtml),e.insertAdjacentHTML("beforeend",this.display.rightNavArrowHtml)),this._carousel=e,this.shadow.appendChild(e),this.setupClick(),this.updateSelectedItem(),this.startAutoSlide(),this.setupOnHover(),window.clevertap.renderNotificationViewed({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot})}setupClick(){this._carousel.addEventListener("click",(e=>{const t=e.target.id;if(t.startsWith("carousel__button")){const e=+t.split("-")[1];e!==this.selectedItem&&(this.previouslySelectedItem=this.selectedItem,this.selectedItem=e,this.updateSelectedItem(),this.startAutoSlide())}else if(t.startsWith("carousel__arrow"))t.endsWith("right")?this.goToNext():this.goToPrev(),this.startAutoSlide();else if(t.indexOf("-")>-1){const e=+t.split("-")[1],i=e-1;window.parent.clevertap&&window.clevertap.renderNotificationClicked({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot,wzrk_slideNo:e});const o=this.details[i].onClick;""!==o&&(this.details[i].window?window.open(o,"_blank"):window.location.href=o)}}))}setupOnHover(){this._carousel.addEventListener("mouseenter",(e=>{this.stopAutoSlideTimeout=setTimeout((()=>{this.autoSlide=clearInterval(this.autoSlide)}),500)})),this._carousel.addEventListener("mouseleave",(e=>{clearTimeout(this.stopAutoSlideTimeout),void 0===this.autoSlide&&this.startAutoSlide()}))}getCarouselContent(){const e=document.createElement("div");return e.setAttribute("class","carousel"),this.details.forEach(((t,i)=>{const o=document.createElement("ct-web-personalisation-banner");o.classList.add("carousel__item"),o.trackClick=!1,o.setAttribute("id","carousel__item-".concat(i+1)),o.details=t,e.appendChild(o)})),e}getStyles(){var e,t;return"\n \n ")}updateSelectedItem(){if(-1!==this.previouslySelectedItem){const e=this.shadow.getElementById("carousel__item-".concat(this.previouslySelectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.previouslySelectedItem));e.classList.remove("carousel__item--selected"),t&&t.classList.remove("carousel__button--selected")}const e=this.shadow.getElementById("carousel__item-".concat(this.selectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.selectedItem));e.classList.add("carousel__item--selected"),t&&t.classList.add("carousel__button--selected")}startAutoSlide(){clearInterval(this.autoSlide),this.autoSlide=setInterval((()=>{this.goToNext()}),this.display.sliderTime?1e3*this.display.sliderTime:3e3)}goToNext(){this.goTo(this.selectedItem,(this.selectedItem+1)%this.slides)}goToPrev(){this.goTo(this.selectedItem,this.selectedItem-1)}goTo(e,t){this.previouslySelectedItem=e,this.selectedItem=t,0===t&&(this.selectedItem=this.slides),this.updateSelectedItem()}}class Tt extends HTMLElement{constructor(){super(),this._target=null,this._session=null,this.shadow=null,this.popup=null,this.container=null,this.resizeObserver=null,this.shadow=this.attachShadow({mode:"open"})}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderImageOnlyPopup())}get session(){return this._session||""}set session(e){this._session=e}get msgId(){return this.target.wzrk_id}get pivotId(){return this.target.wzrk_pivot}get onClickUrl(){return this.target.display.onClickUrl}renderImageOnlyPopup(){const e=this.target.wzrk_id.split("_")[0],t=this.session.sessionId;this.shadow.innerHTML=this.getImageOnlyPopupContent(),this.popup=this.shadowRoot.getElementById("imageOnlyPopup"),this.container=this.shadowRoot.getElementById("container"),this.closeIcon=this.shadowRoot.getElementById("close"),this.popup.addEventListener("load",this.updateImageAndContainerWidth()),this.resizeObserver=new ResizeObserver((()=>this.handleResize(this.popup,this.container))),this.resizeObserver.observe(this.popup),this.closeIcon.addEventListener("click",(()=>{if(this.resizeObserver.unobserve(this.popup),document.getElementById("wzrkImageOnlyDiv").style.display="none",this.remove(),null!=e&&"-1"!==e&&ae._isLocalStorageSupported()){const i=Xe();let o=i.wp[t];null==o&&(o={},i[t]=o),o[e]="dnd",et(i)}})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId}),this.onClickUrl&&this.popup.addEventListener("click",(()=>{this.target.display.window?window.open(this.onClickUrl,"_blank"):window.parent.location.href=this.onClickUrl,window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})}))}handleResize(e,t){const i=this.getRenderedImageWidth(e);t.style.setProperty("width","".concat(i,"px"))}getImageOnlyPopupContent(){return"\n ".concat(this.target.msgContent.css,"\n ").concat(this.target.msgContent.html,"\n ")}updateImageAndContainerWidth(){return()=>{const e=this.getRenderedImageWidth(this.popup);this.popup.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("height","auto"),this.container.style.setProperty("position","fixed"),this.popup.style.setProperty("visibility","visible"),this.closeIcon.style.setProperty("visibility","visible"),document.getElementById("wzrkImageOnlyDiv").style.visibility="visible"}}getRenderedImageWidth(e){const t=e.naturalWidth/e.naturalHeight;return e.height*t}}class Rt extends HTMLElement{constructor(e,t){super(),this.wrapper=null,this.snackBar=null,this.shadow=this.attachShadow({mode:"open"}),this.config=e,this.message=t,this.renderMessage(t)}get pivotId(){return this.message.wzrk_pivot}get campaignId(){return this.message.wzrk_id}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}renderMessage(e){switch(this.wrapper=this.createEl("div","messageWrapper"),e.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":{const t=this.prepareBasicMessage(e.msg[0]);this.wrapper.appendChild(t)}}const t=this.createEl("div","timeStamp");if(t.innerHTML="".concat(Wt(e.id.split("_")[1]),""),!e.viewed){const e=this.createEl("span","unreadMarker");t.appendChild(e)}this.wrapper.appendChild(t),this.shadow.appendChild(this.wrapper)}prepareBasicMessage(e){const t=this.createEl("div","message");if(e.imageUrl){const i=this.addImage(e.imageUrl,"mainImg");t.appendChild(i)}const i=this.createEl("div","iconTitleDescWrapper");if(e.iconUrl){const t=this.addImage(e.iconUrl,"iconImg");i.appendChild(t)}const o=this.createEl("div","titleDescWrapper");if(e.title){const t=this.createEl("div","title");t.innerText=e.title,o.appendChild(t)}if(e.description){const t=this.createEl("div","description");t.innerText=e.description,o.appendChild(t)}if((e.title||e.description)&&i.appendChild(o),(e.iconUrl||e.title||e.description)&&t.appendChild(i),e.buttons&&e.buttons.length){const i=this.addButtons(e.buttons);t.appendChild(i)}return t}addButtons(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.createEl("div","buttonsContainer");let i=!1;return e.forEach(((e,o)=>{const n=this.createEl("button","button-".concat(o),"button");n.innerText=e.text,o>0&&(n.style.cssText+="margin-left: 2px;"),"copy"===e.action&&(i=!0),t.appendChild(n)})),i&&this.addSnackbar(t),t}addSnackbar(e){this.snackBar=this.createEl("div","snackbar-".concat(this.campaignId),"snackbar"),this.snackBar.innerHTML=Ht;const t=this.createEl("span","snackbar-msg-".concat(this.campaignId),"snackbar-msg");t.innerText="Copied to clipboard",this.snackBar.appendChild(t),e.appendChild(this.snackBar)}addImage(e,t){const i=this.createEl("div","".concat(t,"Container")),o=this.createEl("img",t);return o.setAttribute("src",e),o.setAttribute("loading","lazy"),i.appendChild(o),i}raiseClickedEvent(e,t){switch(this.message.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":this.raiseClickedForBasicTemplates(e,t)}}raiseClickedForBasicTemplates(e,t){const i=this.message.msg[0],o={msgId:this.campaignId,pivotId:this.pivotId};if("BUTTON"===e.tagName){const t=e.id.split("-")[1],n=i.buttons[t];o.kv={wzrk_c2a:n.text},"url"===n.action?n.openUrlInNewTab?window.open(n.url,"_blank"):window.location=n.url:"copy"===n.action&&(window.focus(),navigator.clipboard.writeText(n.clipboardText),this.snackBar.style.setProperty("display","flex","important"),setTimeout((()=>{this.snackBar.style.setProperty("display","none","important")}),2e3))}else"CT-INBOX-MESSAGE"===e.tagName&&i.onClickUrl&&(i.openUrlInNewTab?window.open(i.onClickUrl,"_blank"):window.location=i.onClickUrl);t?console.log("Notifiction clicked event will be raised at run time with payload ::",o):window.clevertap.renderNotificationClicked(o)}}class jt extends HTMLElement{constructor(e){super(),this.isInboxOpen=!1,this.isInboxFromFlutter=!1,this.selectedCategory=null,this.unviewedMessages={},this.unviewedCounter=0,this.isPreview=!1,this.inboxConfigForPreview={},this.inboxSelector=null,this.inbox=null,this.emptyInboxMsg=null,this.inboxCard=null,this.unviewedBadge=null,this.observer=null,this.selectedCategoryRef=null,this.addClickListenerOnDocument=(()=>e=>{if(e.composedPath().includes(this.inbox)){const t=e.path||e.composedPath&&e.composedPath();if(t.length){const e=t[0].id;if("closeInbox"===e)this.toggleInbox();else if(e.startsWith("category-"))this.prevCategoryRef=this.selectedCategoryRef,this.selectedCategoryRef=t[0],this.updateActiveCategory(t[0].innerText);else{const e=t.filter((e=>{var t;return(null===(t=e.id)||void 0===t?void 0:t.startsWith("button-"))||"CT-INBOX-MESSAGE"===e.tagName}));if(e.length){e[e.length-1].raiseClickedEvent(e[0],this.isPreview)}}}}else(this.inboxSelector.contains(e.target)||this.isInboxOpen)&&(this.isInboxFromFlutter?this.isInboxFromFlutter=!1:this.toggleInbox(e))})(),this.setBadgeStyle=e=>{null!==this.unviewedBadge&&(this.unviewedBadge.innerText=e>9?"9+":e,this.unviewedBadge.style.display=e>0?"flex":"none")},this.logger=e,this.shadow=this.attachShadow({mode:"open"})}get incomingMessages(){return[]}set incomingMessages(e){void 0===e&&(e=[]),e.length>0&&this.inbox&&this.updateInboxMessages(e)}get incomingMessagesForPreview(){return[]}set incomingMessagesForPreview(e){void 0===e&&(e=[]);const t={};e.length>0&&this.inbox&&(this.isPreview=!0,this.unviewedCounter=0,e.forEach((e=>{const i="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=i,t[i]=e,this.unviewedMessages[i]=e,this.unviewedCounter++})),this.buildUIForMessages(t),this.updateUnviewedBadgeCounter())}connectedCallback(){this.init()}init(){this.config=this.isPreview?this.inboxConfigForPreview:ae.readFromLSorCookie(q)||{},0!==Object.keys(this.config).length&&(this.inboxSelector=document.getElementById(this.config.inboxSelector),null!==this.inboxSelector&&(this.config.styles.notificationsBadge?this.addUnviewedBadge():this.unviewedBadge&&this.unviewedBadge.remove(),this.createinbox(),document.removeEventListener("click",this.addClickListenerOnDocument),document.addEventListener("click",this.addClickListenerOnDocument),this.config.categories.length&&this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadow.innerHTML=this.getInboxStyles(),this.shadow.appendChild(this.inbox)))}addMsgsToInboxFromLS(){const e=this.deleteExpiredAndGetUnexpiredMsgs(!1),t=e?Object.keys(e):[];0!==t.length&&(t.forEach((t=>{e[t].viewed||(this.unviewedMessages[t]=e[t],this.unviewedCounter++)})),this.buildUIForMessages(e),this.updateUnviewedBadgeCounter())}deleteExpiredAndGetUnexpiredMsgs(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Nt();const i=Math.floor(Date.now()/1e3);for(const o in t)if(t[o].wzrk_ttl&&t[o].wzrk_ttl>0&&t[o].wzrk_ttl0&&(t=Object.values(t).sort(((e,t)=>t.date-e.date)).reduce(((e,t)=>(e[t.id]=t,e)),{})),Ft(t),t}updateInboxMessages(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.deleteExpiredAndGetUnexpiredMsgs(),i=Date.now(),o={};e.forEach(((e,n)=>{const s="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=s,e.date=i-n,e.viewed=0,t[s]=e,o[s]=e,this.unviewedMessages[s]=e,this.unviewedCounter++})),Ft(t),this.buildUIForMessages(o),this.updateUnviewedBadgeCounter()}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}addUnviewedBadge(){this.unviewedBadge||(this.unviewedBadge=this.createEl("div","unviewedBadge"),this.unviewedBadge.style.cssText="display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ".concat(this.config.styles.notificationsBadge.backgroundColor,"; font-size: 12px; color: ").concat(this.config.styles.notificationsBadge.textColor,"; font-weight: bold; align-items: center; justify-content: center;"),document.body.appendChild(this.unviewedBadge)),this.updateUnviewedBadgePosition(),window.addEventListener("resize",(()=>{this.updateUnviewedBadgePosition()}))}updateUnviewedBadgePosition(){const{top:e,right:t}=this.inboxSelector.getBoundingClientRect();this.unviewedBadge.style.top="".concat(e-8,"px"),this.unviewedBadge.style.left="".concat(t-8,"px")}createinbox(){this.inbox=this.createEl("div","inbox");const e=this.createEl("div","header"),t=this.createEl("div","headerTitle");t.innerText=this.config.title;const i=this.createEl("div","closeInbox");if(i.innerHTML="×",e.appendChild(t),e.appendChild(i),this.inbox.appendChild(e),this.config.categories.length){const e=this.createCategories();this.inbox.appendChild(e)}this.inboxCard=this.createEl("div","inboxCard"),this.inbox.appendChild(this.inboxCard),this.emptyInboxMsg=this.createEl("div","emptyInboxMsg"),this.emptyInboxMsg.innerText="All messages will be displayed here.",this.inboxCard.appendChild(this.emptyInboxMsg);const o={root:this.inboxCard,rootMargin:"0px",threshold:.5};this.observer=new IntersectionObserver(((e,t)=>{this.handleMessageViewed(e)}),o),this.addMsgsToInboxFromLS()}createCategories(){const e=this.createEl("div","categoriesContainer"),t=this.createEl("div","leftArrow");t.innerHTML=Gt,t.children[0].style="transform: rotate(180deg)",t.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(-70,0)})),e.appendChild(t);const i=this.createEl("div","categoriesWrapper");["All",...this.config.categories].forEach(((e,t)=>{const o=this.createEl("div","category-".concat(t),"category");o.innerText=e,0===t&&(this.selectedCategoryRef=o),i.appendChild(o)})),e.appendChild(i);const o=this.createEl("div","rightArrow");o.innerHTML=Gt,o.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(70,0)})),e.appendChild(o);const n={root:e,threshold:.9},s=i.children[0],r=i.children[this.config.categories.length];new IntersectionObserver((e=>{this.categoryObserverCb(t,e[0].intersectionRatio>=.9)}),n).observe(s);return new IntersectionObserver((e=>{this.categoryObserverCb(o,e[0].intersectionRatio>=.9)}),n).observe(r),e}categoryObserverCb(e,t){e&&(e.style.display=t?"none":"flex")}updateActiveCategory(e){this.selectedCategory=e,this.inboxCard.scrollTop=0;let t=0;this.prevCategoryRef&&this.prevCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef.setAttribute("selected","true"),this.inboxCard.childNodes.forEach((e=>{"emptyInboxMsg"!==e.getAttribute("id")&&(e.style.display="All"===this.selectedCategory||e.getAttribute("category")===this.selectedCategory?"block":"none","block"===e.style.display&&t++)})),0===t?(this.emptyInboxMsg.innerText="".concat(e," messages will be displayed here."),this.emptyInboxMsg.style.display="block"):this.emptyInboxMsg.style.display="none"}buildUIForMessages(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!this.isPreview&&this.updateTSForRenderedMsgs(),this.inboxCard.scrollTop=0;const i=null!==(e=this.config.maxMsgsInInbox)&&void 0!==e?e:15,o=this.inboxCard.firstChild,n=Object.values(t).sort(((e,t)=>t.date-e.date)).map((e=>e.id));for(const e of n){const i=new Rt(this.config,t[e]);i.setAttribute("id",t[e].id),i.setAttribute("pivot",t[e].wzrk_pivot),i.setAttribute("part","ct-inbox-message"),this.config.categories.length>0?(i.setAttribute("category",t[e].tags[0]||""),i.style.display="All"===this.selectedCategory||t[e].category===this.selectedCategory?"block":"none"):i.style.display="block",this.inboxCard.insertBefore(i,o),this.observer.observe(i)}let s=this.inboxCard.querySelectorAll("ct-inbox-message").length;for(;s>i;){const e=this.inboxCard.querySelectorAll("ct-inbox-message");e.length>0&&e[e.length-1].remove(),s--}const r=this.inboxCard.querySelectorAll('ct-inbox-message[style*="display: block"]').length;this.emptyInboxMsg.style.display=r?"none":"block"}handleMessageViewed(e){const t=!this.isPreview;this.isInboxOpen&&e.forEach((e=>{e.isIntersecting&&this.unviewedMessages.hasOwnProperty(e.target.id)&&0===e.target.message.viewed&&(e.target.message.viewed=1,t?(window.clevertap.renderNotificationViewed({msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.updateMessageInLS(e.target.id,{...e.target.message,viewed:1}),setTimeout((()=>{e.target.shadowRoot.getElementById("unreadMarker").style.display="none"}),1e3)):console.log("Notifiction viewed event will be raised at run time with payload ::",{msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.unviewedCounter--,this.updateUnviewedBadgeCounter(),delete this.unviewedMessages[e.target.id])}))}updateMessageInLS(e,t){if(!this.isPreview){const i=Nt();i[e]=t,Ft(i)}}toggleInbox(e){this.isInboxOpen=!this.isInboxOpen,this.isInboxFromFlutter=!!(null==e?void 0:e.rect),this.isInboxOpen?(this.inboxCard.scrollTop=0,!this.isPreview&&this.deleteExpiredAndGetUnexpiredMsgs(),this.inbox.style.display="block",this.inbox.style.zIndex="2147483647",this.config.categories.length&&(this.selectedCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef=this.shadowRoot.getElementById("category-0"),this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadowRoot.getElementById("categoriesWrapper").scrollLeft-=this.shadowRoot.getElementById("categoriesWrapper").scrollWidth),this.setInboxPosition(e)):this.inbox.style.display="none"}setInboxPosition(e){const t=window.outerWidth,i=getComputedStyle(le.inbox),o=i.getPropertyValue("--inbox-top"),n=i.getPropertyValue("--inbox-bottom"),s=i.getPropertyValue("--inbox-left"),r=i.getPropertyValue("--inbox-right");if(t>481&&!(o||n||s||r)){const t=Vt(e,this.inbox.clientHeight,this.inbox.clientWidth),i=t.xPos,o=t.yPos;this.inbox.style.top=o+"px",this.inbox.style.left=i+"px"}}updateUnviewedBadgeCounter(){if(this.isPreview)return void this.setBadgeStyle(this.unviewedCounter);let e=0;this.inboxCard.querySelectorAll("ct-inbox-message").forEach((t=>{const i=Nt();i[t.id]&&0===i[t.id].viewed&&e++})),this.setBadgeStyle(e)}updateTSForRenderedMsgs(){this.inboxCard.querySelectorAll("ct-inbox-message").forEach((e=>{const t=e.id.split("_")[1];e.shadow.getElementById("timeStamp").firstChild.innerText=Wt(t)}))}getInboxStyles(){const e=this.config.categories.length?64:16,t={panelBackgroundColor:this.config.styles.panelBackgroundColor,panelBorderColor:this.config.styles.panelBorderColor,headerBackgroundColor:this.config.styles.header.backgroundColor,headerTitleColor:this.config.styles.header.titleColor,closeIconColor:this.config.styles.closeIconColor,categoriesTabColor:this.config.styles.categories.tabColor,categoriesTitleColor:this.config.styles.categories.titleColor,selectedCategoryTabColor:this.config.styles.categories.selectedTab.tabColor,selectedCategoryTitleColor:this.config.styles.categories.selectedTab.titleColor,headerCategoryHeight:36+e};this.config.styles.categories.borderColor&&(t.categoriesBorderColor=this.config.styles.categories.borderColor),this.config.styles.categories.selectedTab.borderColor&&(t.selectedCategoryBorderColor=this.config.styles.categories.selectedTab.borderColor);const i=(e=>{let{panelBackgroundColor:t,panelBorderColor:i,headerBackgroundColor:o,headerTitleColor:n,closeIconColor:s,categoriesTabColor:r,categoriesTitleColor:a,categoriesBorderColor:l,selectedCategoryTabColor:c,selectedCategoryTitleColor:d,selectedCategoryBorderColor:h,headerCategoryHeight:u}=e;return'\n \n ")})(t),o=this.config.styles.cards;return i+(e=>{let{backgroundColor:t,borderColor:i,titleColor:o,descriptionColor:n,buttonColor:s,buttonTextColor:r,unreadMarkerColor:a}=e;return'\n \n ")})({backgroundColor:o.backgroundColor,borderColor:o.borderColor,titleColor:o.titleColor,descriptionColor:o.descriptionColor,buttonColor:o.buttonColor,buttonTextColor:o.buttonTextColor,unreadMarkerColor:o.unreadMarkerColor})}}const Dt=e=>{e.inbox_preview?le.inbox.incomingMessagesForPreview=e.inbox_notifs:le.inbox.incomingMessages=e},zt=e=>{qt(),le.inbox=new jt({logger:e}),document.body.appendChild(le.inbox)},Bt=e=>{const t=ae.readFromLSorCookie(V)||{};if(Object.keys(t).length>0&&Object.keys(t)[0].includes("_")){const i={};return i[e]=t,ae.saveToLSorCookie(V,i),i}return t},Nt=()=>{const e=JSON.parse(decodeURIComponent(ae.read(b)));if(!X(e))return{};const t=Bt(e);return t.hasOwnProperty(e)?t[e]:{}},Ft=e=>{const t=JSON.parse(decodeURIComponent(ae.read(b)));if(!X(t))return;const i={...Bt(t),[t]:e};ae.saveToLSorCookie(V,i)},Ut=e=>new Promise(((t,i)=>{if("complete"===document.readyState)zt(e),t();else{const i=ae.readFromLSorCookie(q)||{},o=()=>{null===le.inbox&&zt(e),t()};window.addEventListener("load",(()=>{if(document.getElementById(i.inboxSelector))o();else{let n=0;if(n<20){const s=setInterval((()=>{document.getElementById(i.inboxSelector)?(o(),clearInterval(s),t()):n>=20&&(clearInterval(s),e.debug("Failed to add inbox")),n++}),500)}}}))}})),qt=()=>{void 0===customElements.get("ct-web-inbox")&&(customElements.define("ct-web-inbox",jt),customElements.define("ct-inbox-message",Rt))},Vt=(e,t,i)=>{const o=document.scrollingElement.scrollLeft,n=document.scrollingElement.scrollTop,s=window.innerWidth+o,r=window.innerHeight+n,a=e.rect||e.target.getBoundingClientRect(),l=a.x+o,c=a.y+n,d=a.left+o,h=a.right+o,u=a.top+n,p=a.bottom,g=a.height,f=a.width;let v,b,m=!1;const y=16;if(p+t<=r){const e=r-(p+t);b=e>=y?p+y:p+e}else if(u-t>=n){const e=u-t;b=e>=y?u-t-y:u-t-e}else m=!0,b=c+g/2-t/2,br&&(b=r-t);if(m){const e=h+i;if(e<=s){v=h+(e+y<=s?y:s-e)}else{const e=d-i;v=e-(e-y>=o?y:e-o)}}else v=l+f/2-i/2,vs&&(v=h-i>=o?h-i:s-i);return{xPos:v,yPos:b}},Wt=e=>{const t=Date.now();let i=Math.floor((t-e)/6e4);return i<5?"Just now":i<60?"".concat(i," minute").concat(i>1?"s":""," ago"):(i=Math.floor(i/60),i<24?"".concat(i," hour").concat(i>1?"s":""," ago"):(i=Math.floor(i/24),"".concat(i," day").concat(i>1?"s":""," ago")))},Kt=()=>Object.keys(ae.readFromLSorCookie(q)||{}).length>0,Gt='\n\n\n',Ht='\n\n\n',Jt=(e,t,i)=>{document.addEventListener("DOMContentLoaded",(()=>function(e,t,i){document.body.innerHTML="",Zt=document.createElement("div"),Zt.id="overlayDiv",Zt.style.position="relative",Zt.style.display="flex",document.body.appendChild(Zt);(function(e,t,i,o){return new Promise(((n,s)=>{var r=document.createElement("script");r.type="module",r.src=e,r.onload=function(){"function"==typeof window.Overlay?(window.Overlay("#overlayDiv",t,i,o),n()):s(new Error("ContentLayout not found in overlay.js"))},r.onerror=function(e){s(e)},document.head.appendChild(r)}))})("https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js",e,t,i).then((()=>{console.log("Overlay script loaded successfully.")})).catch((e=>{console.error("Error loading overlay script:",e)})),h=document.createElement("link"),h.rel="stylesheet",h.type="text/css",h.href="https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css",document.head.appendChild(h),n={kitId:"eqj6nom",scriptTimeout:3e3,async:!0},s=document,r=s.documentElement,a=setTimeout((function(){r.className=r.className.replace(/\bwf-loading\b/g,"")+" wf-inactive"}),n.scriptTimeout),l=s.createElement("script"),c=!1,d=s.getElementsByTagName("script")[0],r.className+=" wf-loading",l.src="https://use.typekit.net/"+n.kitId+".js",l.async=!0,l.onload=l.onreadystatechange=function(){if(o=this.readyState,!(c||o&&"complete"!==o&&"loaded"!==o)){c=!0,clearTimeout(a);try{Typekit.load(n)}catch(e){}}},d.parentNode.insertBefore(l,d);var o,n,s,r,a,l,c,d;var h}(e,t,i)))};let Zt;const $t=(e,t)=>{const i=t?e.details[0]:e.display.details[0],o=Object.keys(i)[0],n=i[o];if(o===window.location.href.split("?")[0])for(const i in n){const o=document.querySelector(i);if(o)n[i].html?o.outerHTML=n[i].html:Yt(e,n[i]),t||window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot});else{let o=0;const s=setInterval((()=>{const r=document.querySelector(i);r?(n[i].html?r.outerHTML=n[i].html:Yt(e,n[i]),t||window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot}),clearInterval(s)):(o++,o>=20&&(console.log("No element present on DOM with selector '".concat(i,"'.")),clearInterval(s)))}),500)}}};function Yt(e,t){const i={};i.msgId=e.wzrk_id,e.wzrk_pivot&&(i.pivotId=e.wzrk_pivot),null!=t.json&&(i.json=t.json);const o=new CustomEvent("CT_web_native_display_buider",{detail:i});document.dispatchEvent(o)}const Qt=(e,t)=>{let{device:i,session:o,request:n,logger:s}=t;const r=i,a=o,l=n,c=s;let d=0;const h=t=>{const i=t.wzrk_id.split("_")[0],o=ie(),n=(e,t,i)=>{let o=0,n=0;null!=e[t]&&(o=e[t]),o++,null!=e.tc&&(n=e.tc),i<0&&n++,e.tc=n,e[t]=o};if(ae._isLocalStorageSupported()){delete sessionStorage.WZRK_CAMP;var s={};const e=Xe();s=3===t.display.wtarget_type&&e.hasOwnProperty("wi")?e.wi:0!==t.display.wtarget_type&&1!==t.display.wtarget_type||!e.hasOwnProperty("wp")?{}:e.wp,e.hasOwnProperty("global")&&(s.wp=e),null==t.display.wmc&&(t.display.wmc=1),null==t.display.wimc&&(t.display.wimc=1);var d=-1;let n=-1,r=-1,l=-1,c=-1,g=-1,f=-1;null!=t.display.efc&&(d=parseInt(t.display.efc,10)),null!=t.display.mdc&&(n=parseInt(t.display.mdc,10)),null!=t.display.tdc&&(r=parseInt(t.display.tdc,10)),null!=t.display.tlc&&(l=parseInt(t.display.tlc,10)),null!=t.display.wmp&&(c=parseInt(t.display.wmp,10)),null!=t.display.wmc&&(g=parseInt(t.display.wmc,10)),null!=t.display.wimc&&(f=parseInt(t.display.wimc,10));var h=s[a.sessionId];if(h){const e=h[i],o=h.tc;if("dnd"===e&&!le.dismissSpamControl)return!1;if(3===t.display.wtarget_type){if(f>0&&o>=f&&d<0)return!1}else if(g>0&&o>=g&&d<0)return!1;if(n>0&&e>=n)return!1}else h={},s[a.sessionId]=h;var u=s[o];if(null!=u){const e=u[i],t=u.tc;if(c>0&&t>=c&&d<0)return!1;if(r>0&&e>=r)return!1}else u={},s[o]=u;var p=s.global;if(null!=p){const e=p[i];if(l>0&&e>=l)return!1}else p={},s.global=p}if(null!=t.display.delay&&t.display.delay>0){const i=t.display.delay;return t.display.delay=0,setTimeout(Qt,1e3*i,e,{device:r,session:a,request:l,logger:c}),!1}n(h,i,d),n(u,i,d),n(p,i,d);let g="wp";3===t.display.wtarget_type&&(g="wi");const f={};f[a.sessionId]=h,f[o]=u,f.global=p,et({[g]:f})},u=()=>{const e=r.getGuid(),t=a.getSessionCookieObject();return"&t=wc&d="+encodeURIComponent(He(e+"|"+t.p+"|"+t.s))},p=(e,t)=>{const i=window.parent[e];"function"==typeof i&&(null!=t.display.kv?i(t.display.kv):i())},g=(e,t,i,o,n)=>{f(t),((e,t,i,o,n)=>{if(""!==e&&null!=e){let o,s;n?o=i:null!==i&&(s=i.getElementsByClassName("jsCT_CTA"),null!=s&&1===s.length&&(o=s[0]));const r=t.display.jsFunc,l=t.display.preview;null==l&&(e+=u()),null!=o&&(o.onclick=()=>{if(null!=r)return null==l&&Qe.fireRequest(e),p(r,t),void at("-1",0,a.sessionId);1===t.display.window?window.open(e,"_blank"):window.location=e})}})(e,t,i,0,n)},f=e=>{const t={type:"event"};t.evtName=R,t.evtData={[T]:e.wzrk_id},e.wzrk_pivot&&(t.evtData={...t.evtData,wzrk_pivot:e.wzrk_pivot}),l.processEvent(t)},v=e=>{var t;void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Lt);const i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,o=document.createElement("ct-web-personalisation-banner");o.msgId=e.wzrk_id,o.pivotId=e.wzrk_pivot,o.divHeight=e.display.divHeight,o.details=e.display.details[0];const n=e.display.divId?document.getElementById(i):document.querySelector(i);n.innerHTML="",n.appendChild(o)},m=e=>{var t;void 0===customElements.get("ct-web-personalisation-carousel")&&customElements.define("ct-web-personalisation-carousel",Mt);const i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,o=document.createElement("ct-web-personalisation-carousel");o.target=e;const n=e.display.divId?document.getElementById(i):document.querySelector(i);n.innerHTML="",n.appendChild(o)},y=e=>{const t=e.wzrk_id.split("_")[0],i=e.display;if(2===i.wtarget_type&&1===e.msgContent.type){const t={};t.msgId=e.wzrk_id,e.wzrk_pivot&&(t.pivotId=e.wzrk_pivot),null!=e.msgContent.kv&&(t.kv=e.msgContent.kv);const i=new CustomEvent("CT_web_native_display",{detail:t});return void document.dispatchEvent(i)}if(1===i.layout)return O(void 0,e);if(3===i.layout){const t="wzrkImageOnlyDiv";if(!1===h(e))return;if(le.dismissSpamControl&&null!=document.getElementById(t)){document.getElementById(t).remove()}if(null!=document.getElementById(t)||null!=document.getElementById("intentPreview"))return;const i=document.createElement("div");return i.id=t,document.body.appendChild(i),void 0===customElements.get("ct-web-popup-imageonly")&&customElements.define("ct-web-popup-imageonly",Tt),(e=>{const t=document.createElement("ct-web-popup-imageonly");t.session=a,t.target=e;const i=document.getElementById("wzrkImageOnlyDiv");i.innerHTML="",i.style.visibility="hidden",i.appendChild(t)})(e)}if(!1===h(e))return;const o="wizParDiv"+i.layout;if(le.dismissSpamControl&&null!=document.getElementById(o)){document.getElementById(o).remove()}if(null!=document.getElementById(o))return;le.campaignDivMap[t]=o;const n=2===i.layout,s=document.createElement("div");s.id=o;const r=window.innerHeight,l=window.innerWidth;let c=!1;if(n)s.setAttribute("style",i.iFrameStyle);else{var d=10;let e=5*l/100,t=d+5*r/100,o=30*l/100+20,n="width:30%;";(/mobile/i.test(navigator.userAgent)||/mini/i.test(navigator.userAgent))&&!1===/iPad/i.test(navigator.userAgent)?(o=85*l/100+20,e=5*l/100,t=5*r/100,n="width:80%;"):("ontouchstart"in window||/tablet/i.test(navigator.userAgent))&&(o=50*l/100+20,e=5*l/100,t=5*r/100,n="width:50%;"),null==i.proto?(c=!0,s.setAttribute("style","display:block;overflow:hidden; bottom:"+t+"px !important;width:"+o+"px !important;right:"+e+"px !important;position:fixed;z-index:2147483647;")):s.setAttribute("style",n+i.iFrameStyle)}document.body.appendChild(s);const u=document.createElement("iframe"),p=!1===i.br?"0":"8";u.frameborder="0px",u.marginheight="0px",u.marginwidth="0px",u.scrolling="no",u.id="wiz-iframe";const f=e.display.onClick;let v,b="";if(""!==f&&null!=f&&(b="cursor:pointer;"),1===e.msgContent.type)v=e.msgContent.html,v=v.replace(/##campaignId##/g,t),v=v.replace(/##campaignId_batchId##/g,e.wzrk_id);else{const i='";let n,s,r,a,l;"dark"===e.display.theme?(n="#2d2d2e",s="#eaeaea",r="#353535",a="#353535",l="#ffffff"):(n="#ffffff",s="#000000",a="#f4f4f4",r="#a5a6a6",l="#ffffff");const c=e.msgContent.title,d=e.msgContent.description;let h="";null!=e.msgContent.imageUrl&&""!==e.msgContent.imageUrl&&(h="");v=i+("
×
"+h+"
"+c+"
")+("
"+d+"
")}u.setAttribute("style","z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;"),s.appendChild(u);const m=(u.contentWindow?u.contentWindow:u.contentDocument.document?u.contentDocument.document:u.contentDocument).document,y=new Event("CT_campaign_rendered");document.dispatchEvent(y),m.open(),m.write(v),i["custom-editor"]&&k(e,m),m.close();const w=()=>{d=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv").scrollHeight,!0===i["custom-editor"]||n||(d+=25),document.getElementById("wiz-iframe").contentDocument.body.style.margin="0px",document.getElementById("wiz-iframe").style.height=d+"px"},C=navigator.userAgent.toLowerCase();if(-1!==C.indexOf("safari"))if(C.indexOf("chrome")>-1)u.onload=()=>{w();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)};else{let t=u.contentDocument||u.contentWindow;t.document&&(t=t.document),w();const i=setInterval((()=>{if("complete"===t.readyState){clearInterval(i),w();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)}}),10)}else u.onload=()=>{w();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)}},k=(e,t)=>{const i=t.createElement("script");i.innerHTML="\n const ct__camapignId = '".concat(e.wzrk_id,"';\n const ct__formatVal = (v) => {\n return v && v.trim().substring(0, 20);\n }\n const ct__parentOrigin = window.parent.origin;\n document.body.addEventListener('click', (event) => {\n const elem = event.target.closest?.('a[wzrk_c2a], button[wzrk_c2a]');\n if (elem) {\n const {innerText, id, name, value, href} = elem;\n const clickAttr = elem.getAttribute('onclick') || elem.getAttribute('click');\n const onclickURL = clickAttr?.match(/(window.open)[(](\"|')(.*)(\"|',)/)?.[3] || clickAttr?.match(/(location.href *= *)(\"|')(.*)(\"|')/)?.[3];\n const props = {innerText, id, name, value};\n let msgCTkv = Object.keys(props).reduce((acc, c) => {\n const formattedVal = ct__formatVal(props[c]);\n formattedVal && (acc['wzrk_click_' + c] = formattedVal);\n return acc;\n }, {});\n if(onclickURL) { msgCTkv['wzrk_click_' + 'url'] = onclickURL; }\n if(href) { msgCTkv['wzrk_click_' + 'c2a'] = href; }\n const notifData = { msgId: ct__camapignId, msgCTkv, pivotId: '").concat(e.wzrk_pivot,"' };\n window.parent.clevertap.renderNotificationClicked(notifData);\n }\n });\n "),t.body.appendChild(i)};let x=!1;const S=e=>{let t=e.display.onClick;if(window.clevertap.hasOwnProperty("notificationCallback")&&void 0!==window.clevertap.notificationCallback&&"function"==typeof window.clevertap.notificationCallback){const i=window.clevertap.notificationCallback;if(!x){const o={};o.msgContent=e.msgContent,o.msgId=e.wzrk_id,e.wzrk_pivot&&(o.pivotId=e.wzrk_pivot),null!=e.display.kv&&(o.kv=e.display.kv),window.clevertap.raiseNotificationClicked=()=>{if(""!==t&&null!=t){const i=e.display.jsFunc;if(t+=u(),null!=i)return Qe.fireRequest(t),void p(i,e);1===e.display.window?window.open(t,"_blank"):window.location=t}},window.clevertap.raiseNotificationViewed=()=>{f(e)},i(o),x=!0}}else if(window.clevertap.popupCurrentWzrkId=e.wzrk_id,y(e),window.clevertap.hasOwnProperty("popupCallbacks")&&void 0!==window.clevertap.popupCallbacks&&"function"==typeof window.clevertap.popupCallbacks[e.wzrk_id]){const t=window.clevertap.popupCallbacks[e.wzrk_id],n={};n.msgContent=e.msgContent,n.msgId=e.wzrk_id,e.wzrk_pivot&&(n.pivotId=e.wzrk_pivot);var i=[];for(var o in e)if(o.startsWith(M)&&o!==T){const t={[o]:e[o]};i.push(t)}i.length>0&&(n.msgCTkv=i),null!=e.display.kv&&(n.kv=e.display.kv),window.clevertap.raisePopupNotificationClicked=t=>{if(!t||!t.msgId)return;const i={type:"event"};if(i.evtName=j,i.evtData={[T]:t.msgId},e.wzrk_pivot&&(i.evtData={...i.evtData,wzrk_pivot:t.pivotId}),t.msgCTkv)for(var o of t.msgCTkv)i.evtData={...i.evtData,...o};l.processEvent(i)},t(n)}};let I;const O=(e,t)=>{let i;if(null!=e&&e.clientY>0)return;if(i=null==t?I:t,le.dismissSpamControl&&0===i.display.wtarget_type&&null!=document.getElementById("intentPreview")&&null!=document.getElementById("intentOpacityDiv")){document.getElementById("intentPreview").remove(),document.getElementById("intentOpacityDiv").remove()}if(null!=document.getElementById("intentPreview")||null!=document.getElementById("wzrkImageOnlyDiv"))return;if(null==i.display.layout&&(/mobile/i.test(navigator.userAgent)||/mini/i.test(navigator.userAgent)||/iPad/i.test(navigator.userAgent)||"ontouchstart"in window||/tablet/i.test(navigator.userAgent)))return;if(!1===h(i))return;const o=i.wzrk_id.split("_")[0];le.campaignDivMap[o]="intentPreview";let n=!1;const s=document.createElement("div");s.id="intentOpacityDiv";const r=i.display.opacity||.7,a="rgba(0,0,0,".concat(r,")");s.setAttribute("style","position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ".concat(a,";")),document.body.appendChild(s);const l=document.createElement("div");l.id="intentPreview",null==i.display.proto?(n=!0,l.setAttribute("style","display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;")):l.setAttribute("style",i.display.iFrameStyle),document.body.appendChild(l);const c=document.createElement("iframe"),d=!1===i.display.br?"0":"8";c.frameborder="0px",c.marginheight="0px",c.marginwidth="0px",c.scrolling="no",c.id="wiz-iframe-intent";const u=i.display.onClick;let p,f="";if(""!==u&&null!=u&&(f="cursor:pointer;"),1===i.msgContent.type)p=i.msgContent.html,p=p.replace(/##campaignId##/g,o),p=p.replace(/##campaignId_batchId##/g,i.wzrk_id);else{const e='";let t,n,s,r;"dark"===i.display.theme?(t="#2d2d2e",n="#eaeaea",s="#353535",r="#ffffff"):(t="#ffffff",n="#000000",s="#a5a6a6",r="#ffffff");const a=i.msgContent.title,l=i.msgContent.description;let c="";null!=i.msgContent.ctaText&&""!==i.msgContent.ctaText&&(c="");let h="";null!=i.msgContent.imageUrl&&""!==i.msgContent.imageUrl&&(h="
+a+
");p=e+("
×
"+a+"
")+("
"+l+"
"+h+c+"
")}c.setAttribute("style","z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;"),l.appendChild(c);const v=(c.contentWindow?c.contentWindow:c.contentDocument.document?c.contentDocument.document:c.contentDocument).document,b=new Event("CT_campaign_rendered");document.dispatchEvent(b),v.open(),v.write(p),i.display["custom-editor"]&&k(i,v),v.close();const m=document.getElementById("wiz-iframe-intent").contentDocument.getElementById("contentDiv");g(u,i,m,0,n)};if(!document.body)return void(d<6&&(d++,setTimeout(Qt,1e3,e,{device:r,session:a,request:l,logger:c})));const _=e=>{Object.keys(e).map((t=>{var i,o;e[t].display.divId?(i=e[t].display.divId,o=document.getElementById(i)):(i=e[t].display.divSelector,o=document.querySelector(i)),null!==o&&(2===e[t].msgContent.type?v(e[t]):m(e[t]),delete e[t])}))};if(null!=e.inapp_notifs){const t={};for(let i=0;i{window.addEventListener("load",(()=>{let t=0;if(t<20){const i=setInterval((()=>{_(e),0!==Object.keys(e).length&&20!==t||(clearInterval(i),e={}),t++}),500)}}))})(t))}const E=()=>{if(e.inbox_preview)Dt(e);else if(e.inbox_notifs){const t=[];for(let i=0;i1&&void 0!==arguments[1]&&arguments[1];const i=ae.readFromLSorCookie(q)||{};t?(le.inbox.inboxConfigForPreview=e,le.inbox.isPreview=!0,le.inbox&&le.inbox.init()):JSON.stringify(i)!==JSON.stringify(e)&&(ae.saveToLSorCookie(q,e),le.inbox&&le.inbox.init())}(e.webInboxSetting),Ut(c).then((()=>{E()})).catch((e=>{}))):E()),e.vars)return void le.variableStore.mergeVariables(e.vars);const A=(e,t)=>{const i=Xe(),o=i[t].global;if(null!=o&&t)for(const i in e)if(e.hasOwnProperty(i)&&(delete o[e[i]],ae.read(w))){const o=JSON.parse(decodeURIComponent(ae.read(w))),n=JSON.parse(decodeURIComponent(ae.read(b)));o[n]&&o[n][t]&&o[n][t][e[i]]&&(delete o[n][t][e[i]],ae.save(w,encodeURIComponent(JSON.stringify(o))))}et(i)};if(ae._isLocalStorageSupported())try{if(null!=e.evpr){const t=e.evpr.events,i=e.evpr.profile,o=e.evpr.expires_in,n=oe();ae.setMetaProp("lsTime",n),ae.setMetaProp("exTs",o),(e=>{if(null!=le.globalEventsMap||(le.globalEventsMap=ae.readFromLSorCookie(C),null!=le.globalEventsMap)){for(const t in e)if(e.hasOwnProperty(t)){const i=le.globalEventsMap[t],o=e[t];null!=le.globalEventsMap[t]?null!=o[0]&&o[0]>i[0]&&(le.globalEventsMap[t]=o):le.globalEventsMap[t]=o}}else le.globalEventsMap=e})(t),ae.saveToLSorCookie(C,le.globalEventsMap),null==le.globalProfileMap?rt(i,!0):rt(i,!1)}null!=e.arp&&(e=>{if(null!=e.skipResARP&&e.skipResARP)return console.debug("Update ARP Request rejected",e),null;const t=!0===e.isOUL;if(ae._isLocalStorageSupported())try{let i=ae.readFromLSorCookie(P);if(null==i||t){i={};for(const t in e)e.hasOwnProperty(t)&&(-1===e[t]?delete i[t]:i[t]=e[t]);ae.saveToLSorCookie(P,i)}}catch(e){console.error("Unable to parse ARP JSON: "+e)}})(e.arp),null!=e.inapp_stale&&e.inapp_stale.length>0&&A(e.inapp_stale,"wp"),null!=e.inbox_stale&&e.inbox_stale.length>0&&A(e.inbox_stale,"wi")}catch(e){c.error("Unable to persist evrp/arp: "+e)}};var Xt=t("isPersonalisationActive");class ei{constructor(e){let{isPersonalisationActive:t}=e;Object.defineProperty(this,Xt,{writable:!0,value:void 0}),i(this,Xt)[Xt]=t}getTotalVisits(){if(!i(this,Xt)[Xt]())return;let e=ae.getMetaProp("sc");return null==e&&(e=1),e}getLastVisit(){if(!i(this,Xt)[Xt]())return;const e=ae.getMetaProp("ps");return null!=e?new Date(1e3*e):void 0}}const ti=1,ii=2,oi=3,ni=4;var si=t("logLevel"),ri=t("log"),ai=t("isLegacyDebug");class li{constructor(e){Object.defineProperty(this,ai,{get:di,set:void 0}),Object.defineProperty(this,ri,{value:ci}),Object.defineProperty(this,si,{writable:!0,value:void 0}),this.wzrkError={},i(this,si)[si]=null==e?e:ii,this.wzrkError={}}get logLevel(){return i(this,si)[si]}set logLevel(e){i(this,si)[si]=e}error(e){i(this,si)[si]>=ti&&i(this,ri)[ri]("error",e)}info(e){i(this,si)[si]>=ii&&i(this,ri)[ri]("log",e)}debug(e){(i(this,si)[si]>=oi||i(this,ai)[ai])&&i(this,ri)[ri]("debug",e)}debugPE(e){i(this,si)[si]>=ni&&i(this,ri)[ri]("debug_pe",e)}reportError(e,t){this.wzrkError.c=e,this.wzrkError.d=t,this.error("".concat(Ce," ").concat(e,": ").concat(t))}}var ci=function(e,t){if(window.console)try{const i=(new Date).getTime();console[e]("CleverTap [".concat(i,"]: ").concat(t))}catch(e){}},di=function(){return"undefined"!=typeof sessionStorage&&""===sessionStorage.WZRK_D},hi=t("logger"),ui=t("sessionId"),pi=t("isPersonalisationActive");class gi{constructor(e){let{logger:t,isPersonalisationActive:o}=e;Object.defineProperty(this,hi,{writable:!0,value:void 0}),Object.defineProperty(this,ui,{writable:!0,value:void 0}),Object.defineProperty(this,pi,{writable:!0,value:void 0}),this.cookieName=void 0,this.scookieObj=void 0,this.sessionId=ae.getMetaProp("cs"),i(this,hi)[hi]=t,i(this,pi)[pi]=o}get sessionId(){return i(this,ui)[ui]}set sessionId(e){i(this,ui)[ui]=e}getSessionCookieObject(){let e=ae.readCookie(this.cookieName),t={};if(null!=e)if(e=e.replace(p,'"'),t=JSON.parse(e),J(t)){if(void 0!==t.t){const e=t.t;oe()-e>1260&&(t={})}}else t={};return this.scookieObj=t,t}setSessionCookieObject(e){const t=JSON.stringify(e);ae.createBroadCookie(this.cookieName,t,1200,We())}manageSession(e){if(void 0===this.sessionId||this.sessionId!==e){const t=ae.getMetaProp("cs");if(void 0===t)ae.setMetaProp("ps",e),ae.setMetaProp("cs",e),ae.setMetaProp("sc",1);else if(t!==e){ae.setMetaProp("ps",t),ae.setMetaProp("cs",e);let i=ae.getMetaProp("sc");void 0===i&&(i=0),ae.setMetaProp("sc",i+1)}this.sessionId=e}}getTimeElapsed(){if(!i(this,pi)[pi]())return;null!=this.scookieObj&&(this.scookieObj=this.getSessionCookieObject());const e=this.scookieObj.s;if(null!=e){const t=oe();return Math.floor(t-e)}}getPageCount(){if(i(this,pi)[pi]())return null!=this.scookieObj&&(this.scookieObj=this.getSessionCookieObject()),this.scookieObj.p}}let fi=0,vi=0;var bi=t("logger"),mi=t("account"),yi=t("device"),wi=t("session"),Ci=t("isPersonalisationActive"),ki=t("clearCookie"),xi=t("addToLocalEventMap");class Pi{constructor(e){let{logger:t,account:o,device:n,session:s,isPersonalisationActive:r}=e;Object.defineProperty(this,xi,{value:Si}),Object.defineProperty(this,bi,{writable:!0,value:void 0}),Object.defineProperty(this,mi,{writable:!0,value:void 0}),Object.defineProperty(this,yi,{writable:!0,value:void 0}),Object.defineProperty(this,wi,{writable:!0,value:void 0}),Object.defineProperty(this,Ci,{writable:!0,value:void 0}),Object.defineProperty(this,ki,{writable:!0,value:!1}),this.processingBackup=!1,i(this,bi)[bi]=t,i(this,mi)[mi]=o,i(this,yi)[yi]=n,i(this,wi)[wi]=s,i(this,Ci)[Ci]=r,Qe.logger=t,Qe.device=n,Qe.account=o}processBackupEvents(){const e=ae.readFromLSorCookie(S);if(null!=e){this.processingBackup=!0;for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];void 0===o.fired&&(i(this,bi)[bi].debug("Processing backup event : "+o.q),void 0!==o.q&&Qe.fireRequest(o.q),o.fired=!0)}ae.saveToLSorCookie(S,e),this.processingBackup=!1}}addSystemDataToObject(e,t){void 0===t&&(e=ee(e,i(this,bi)[bi])),$(i(this,bi)[bi].wzrkError)||(e.wzrk_error=i(this,bi)[bi].wzrkError,i(this,bi)[bi].wzrkError={}),e.id=i(this,mi)[mi].id,X(i(this,yi)[yi].gcookie)&&(e.g=i(this,yi)[yi].gcookie);const o=i(this,wi)[wi].getSessionCookieObject();e.s=o.s,e.pg=void 0===o.p?1:o.p;let n=document.location.protocol;return n=n.replace(":",""),e.af={lib:"web-sdk-v1.7.3",protocol:n,...le.flutterVersion},sessionStorage.hasOwnProperty("WZRK_D")&&(e.debug=!0),e}addFlags(e){if(i(this,ki)[ki]=ae.getAndClearMetaProp(g),void 0!==i(this,ki)[ki]&&i(this,ki)[ki]&&(e.rc=!0,i(this,bi)[bi].debug("reset cookie sent in request and cleared from meta for future requests.")),i(this,Ci)[Ci]()){const t=ae.getMetaProp("lsTime"),i=ae.getMetaProp("exTs");if(void 0===t||void 0===i)return void(e.dsync=!0);t+i{if(e.ok)return e.json();throw e})).then((e=>(i(this,bi)[bi].debug("Sync data successful",e),e))).catch((e=>{throw i(this,bi)[bi].debug("Error in syncing variables",e),e}))}}var Si=function(e){if(ae._isLocalStorageSupported()){void 0===le.globalEventsMap&&(le.globalEventsMap=ae.readFromLSorCookie(C),void 0===le.globalEventsMap&&(le.globalEventsMap={}));const t=oe();let i=le.globalEventsMap[e];void 0!==i?(i[2]=t,i[0]++):(i=[],i.push(1),i.push(t),i.push(t)),le.globalEventsMap[e]=i,ae.saveToLSorCookie(C,le.globalEventsMap)}},Ii=t("request"),Oi=t("account"),_i=t("oldValues"),Ei=t("logger"),Ai=t("processPrivacyArray");class Li extends Array{constructor(e,t){let{request:o,account:n,logger:s}=e;super(),Object.defineProperty(this,Ai,{value:Mi}),Object.defineProperty(this,Ii,{writable:!0,value:void 0}),Object.defineProperty(this,Oi,{writable:!0,value:void 0}),Object.defineProperty(this,_i,{writable:!0,value:void 0}),Object.defineProperty(this,Ei,{writable:!0,value:void 0}),i(this,Ei)[Ei]=s,i(this,Ii)[Ii]=o,i(this,Oi)[Oi]=n,i(this,_i)[_i]=t}push(){for(var e=arguments.length,t=new Array(e),o=0;o0?le.privacyArray:t):le.privacyArray.push(...t),0}_processOldValues(){i(this,_i)[_i]&&i(this,Ai)[Ai](i(this,_i)[_i]),i(this,_i)[_i]=null}}var Mi=function(e){if(Array.isArray(e)&&e.length>0){const o=e.reduce(((e,t)=>({...e,...t})),{});let n={};const s={};var t=!1;if(o.hasOwnProperty(O)&&"boolean"==typeof(t=o.optOut)&&(s.ct_optout=t,le.isOptInRequest=!t),o.hasOwnProperty(_)){const e=o.useIP,t="boolean"==typeof e&&e;ae.setMetaProp(_,t)}if(!$(s)){n.type="profile",n.profile=s,n=i(this,Ii)[Ii].addSystemDataToObject(n,void 0);const o=Ke(JSON.stringify(n),i(this,Ei)[Ei]);let r=i(this,Oi)[Oi].dataPostURL;r=Ve(r,"type",A),r=Ve(r,"d",o),r=Ve(r,O,t?"true":"false"),i(this,Ii)[Ii].saveAndFireRequest(r,le.blockRequest),e.splice(0,e.length)}}},Ti=t("oldValues"),Ri=t("logger"),ji=t("request"),Di=t("account"),zi=t("wizAlertJSPath"),Bi=t("fcmPublicKey"),Ni=t("setUpWebPush"),Fi=t("setUpWebPushNotifications"),Ui=t("setApplicationServerKey"),qi=t("setUpSafariNotifications"),Vi=t("setUpChromeFirefoxNotifications"),Wi=t("addWizAlertJS"),Ki=t("removeWizAlertJS"),Gi=t("handleNotificationRegistration");class Hi extends Array{constructor(e,t){let{logger:o,session:n,request:s,account:r}=e;super(),Object.defineProperty(this,Gi,{value:to}),Object.defineProperty(this,Ki,{value:eo}),Object.defineProperty(this,Wi,{value:Xi}),Object.defineProperty(this,Vi,{value:Qi}),Object.defineProperty(this,qi,{value:Yi}),Object.defineProperty(this,Ui,{value:$i}),Object.defineProperty(this,Fi,{value:Zi}),Object.defineProperty(this,Ni,{value:Ji}),Object.defineProperty(this,Ti,{writable:!0,value:void 0}),Object.defineProperty(this,Ri,{writable:!0,value:void 0}),Object.defineProperty(this,ji,{writable:!0,value:void 0}),Object.defineProperty(this,Di,{writable:!0,value:void 0}),Object.defineProperty(this,zi,{writable:!0,value:void 0}),Object.defineProperty(this,Bi,{writable:!0,value:void 0}),i(this,zi)[zi]="https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js",i(this,Bi)[Bi]=null,i(this,Ti)[Ti]=t,i(this,Ri)[Ri]=o,i(this,ji)[ji]=s,i(this,Di)[Di]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o0?i(this,Gi)[Gi](e):null==le.webPushEnabled&&e.length>0?(le.notifApi.notifEnabledFromApi=!0,le.notifApi.displayArgs=e.slice()):!1===le.webPushEnabled&&e.length>0&&i(this,Ri)[Ri].error("Make sure push notifications are fully enabled and integrated")},Zi=function(e,t,o,n){-1!==navigator.userAgent.indexOf("Chrome")||-1!==navigator.userAgent.indexOf("Firefox")?i(this,Vi)[Vi](e,t):-1!==navigator.userAgent.indexOf("Safari")&&i(this,qi)[qi](e,o,n)},$i=function(e){i(this,Bi)[Bi]=e},Yi=function(e,t,o){void 0===t&&i(this,Ri)[Ri].error("Ensure that APNS Web Push ID is supplied"),void 0===o&&i(this,Ri)[Ri].error("Ensure that APNS Web Push service path is supplied"),"safari"in window&&"pushNotification"in window.safari&&window.safari.pushNotification.requestPermission(o,t,{},(e=>{if("granted"===e.permission){const t=JSON.parse(JSON.stringify(e));t.endpoint=e.deviceToken,t.browser="Safari",ae.saveToLSorCookie(z,t),i(this,ji)[ji].registerToken(t),i(this,Ri)[Ri].info("Safari Web Push registered. Device Token: "+e.deviceToken)}else"denied"===e.permission&&i(this,Ri)[Ri].info("Error subscribing to Safari web push")}))},Qi=function(e,t){let o="";"serviceWorker"in navigator&&navigator.serviceWorker.register(t).then((e=>{if("undefined"!=typeof __wzrk_account_id)return new Promise((t=>setTimeout((()=>t(e)),5e3)));o=e.scope;return/^(\.?)(\/?)([^/]*).js$/.test(t)?navigator.serviceWorker.ready:-1!==navigator.userAgent.indexOf("Chrome")?new Promise((t=>setTimeout((()=>t(e)),5e3))):navigator.serviceWorker.getRegistrations()})).then((t=>{-1!==navigator.userAgent.indexOf("Firefox")&&Array.isArray(t)&&(t=t.filter((e=>e.scope===o))[0]);const n={userVisibleOnly:!0};null!=i(this,Bi)[Bi]&&(n.applicationServerKey=(e=>{let t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),i=window.atob(t),o=[];for(let e=0;e{i(this,Ri)[Ri].info("Service Worker registered. Endpoint: "+t.endpoint);const o=JSON.parse(JSON.stringify(t));-1!==navigator.userAgent.indexOf("Chrome")?(o.endpoint=o.endpoint.split("/").pop(),o.browser="Chrome"):-1!==navigator.userAgent.indexOf("Firefox")&&(o.endpoint=o.endpoint.split("/").pop(),o.browser="Firefox"),ae.saveToLSorCookie(z,o),i(this,ji)[ji].registerToken(o),void 0!==e&&"function"==typeof e&&e()})).catch((e=>{i(this,Ri)[Ri].error("Error subscribing: "+e),t.pushManager.getSubscription().then((e=>{null!==e&&e.unsubscribe().then((e=>{i(this,Ri)[Ri].info("Unsubscription successful")})).catch((e=>{i(this,Ri)[Ri].error("Error unsubscribing: "+e)}))}))}))})).catch((e=>{i(this,Ri)[Ri].error("error registering service worker: "+e)}))},Xi=function(){const e=document.createElement("script");return e.setAttribute("type","text/javascript"),e.setAttribute("id","wzrk-alert-js"),e.setAttribute("src",i(this,zi)[zi]),document.getElementsByTagName("body")[0].appendChild(e),e},eo=function(){const e=document.getElementById("wzrk-alert-js");e.parentNode.removeChild(e)},to=function(e){let t,o,n,s,r,a,l,c,d,h,u,p,g,f,v;if(1===e.length){if(J(e[0])){const i=e[0];t=i.titleText,o=i.bodyText,n=i.okButtonText,s=i.rejectButtonText,r=i.okButtonColor,a=i.skipDialog,l=i.askAgainTimeInSeconds,c=i.okCallback,d=i.rejectCallback,h=i.subscriptionCallback,u=i.serviceWorkerPath,p=i.httpsPopupPath,g=i.httpsIframePath,f=i.apnsWebPushId,v=i.apnsWebPushServiceUrl}}else t=e[0],o=e[1],n=e[2],s=e[3],r=e[4],a=e[5],l=e[6];if(null==a&&(a=!1),null==u&&(u="/clevertap_sw.js"),void 0===navigator.serviceWorker)return;const b=null!=p&&null!=g;if("https:"!==window.location.protocol&&"localhost"!==document.location.hostname&&!b)return void i(this,Ri)[Ri].error("Make sure you are https or localhost to register for notifications");if(-1!==navigator.userAgent.indexOf("Chrome")){const e=navigator.userAgent.match(/Chrome\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}else if(-1!==navigator.userAgent.indexOf("Firefox")){const e=navigator.userAgent.match(/Firefox\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}else{if(-1===navigator.userAgent.indexOf("Safari"))return;{const e=navigator.userAgent.match(/Safari\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}}if(!b){if(null==Notification)return;if("granted"===Notification.permission)return void i(this,Fi)[Fi](h,u,f,v);if("denied"===Notification.permission)return;if(a)return void i(this,Fi)[Fi](h,u,f,v)}if(!(t&&o&&n&&s))return void i(this,Ri)[Ri].error("Missing input parameters; please specify title, body, ok button and cancel button text");null!=r&&r.match(/^#[a-f\d]{6}$/i)||(r="#f28046");const m=(new Date).getTime()/1e3;if(null==ae.getMetaProp("notif_last_time"))ae.setMetaProp("notif_last_time",m);else{if(null==l&&(l=604800),m-ae.getMetaProp("notif_last_time"){if(null!=e.data){let a={};try{a=JSON.parse(e.data)}catch(e){return}null!=a.state&&"ct"===a.from&&"not"===a.state&&(i(this,Wi)[Wi]().onload=()=>{window.wzrkPermissionPopup.wizAlert({title:t,body:o,confirmButtonText:n,confirmButtonColor:r,rejectButtonText:s},(e=>{e?("function"==typeof c&&c(),window.open(p)):"function"==typeof d&&d(),i(this,Ki)[Ki]()}))})}}),!1)}else i(this,Wi)[Wi]().onload=()=>{window.wzrkPermissionPopup.wizAlert({title:t,body:o,confirmButtonText:n,confirmButtonColor:r,rejectButtonText:s},(e=>{e?("function"==typeof c&&c(),i(this,Fi)[Fi](h,u,f,v)):"function"==typeof d&&d(),i(this,Ki)[Ki]()}))}},io=t("variableStore");class oo{constructor(e){let{variableStore:t}=e;Object.defineProperty(this,io,{writable:!0,value:void 0}),this.name=null,this.defaultValue=null,this.value=null,this.type=null,this.hadStarted=!1,this.valueChangedCallbacks=[],i(this,io)[io]=t}getValue(){return this.value}getdefaultValue(){return this.defaultValue}static define(e,t,i){if(!e||"string"!=typeof e)return console.error("Empty or invalid name parameter provided."),null;if(e.startsWith(".")||e.endsWith("."))return console.error("Variable name starts or ends with a `.` which is not allowed: "+e),null;const o=typeof t;if("string"!==o&&"number"!==o&&"boolean"!==o)return console.error("Only primitive types (string, number, boolean) are accepted as value"),null;const n=i.getVariable(e);if(n)return n;const s=new oo({variableStore:i});try{s.name=e,s.defaultValue=t,s.value=t,s.type=o,i.registerVariable(s),s.update(t)}catch(e){console.error(e)}return s}update(e){const t=this.value;this.value=e,null===e&&null===t||null!==e&&e===t&&this.hadStarted||i(this,io)[io].hasVarsRequestCompleted()&&(this.hadStarted=!0,this.triggerValueChanged())}triggerValueChanged(){this.valueChangedCallbacks.forEach((e=>{e(this)}))}addValueChangedCallback(e){e?(this.valueChangedCallbacks.push(e),i(this,io)[io].hasVarsRequestCompleted()&&e(this)):console.log("Invalid callback parameter provided.")}removeValueChangedCallback(e){const t=this.valueChangedCallbacks.indexOf(e);-1!==t&&this.valueChangedCallbacks.splice(t,1)}clearStartFlag(){this.hadStarted=!1}}var no=t("logger"),so=t("account"),ro=t("request"),ao=t("event"),lo=t("variables"),co=t("remoteVariables"),ho=t("fetchCallback"),uo=t("variablesChangedCallbacks"),po=t("oneTimeVariablesChangedCallbacks"),go=t("hasVarsRequestCompleted"),fo=t("runVariablesChangedCallback");class vo{constructor(e){let{logger:t,request:o,account:n,event:s}=e;Object.defineProperty(this,fo,{value:bo}),Object.defineProperty(this,no,{writable:!0,value:void 0}),Object.defineProperty(this,so,{writable:!0,value:void 0}),Object.defineProperty(this,ro,{writable:!0,value:void 0}),Object.defineProperty(this,ao,{writable:!0,value:void 0}),Object.defineProperty(this,lo,{writable:!0,value:void 0}),Object.defineProperty(this,co,{writable:!0,value:void 0}),Object.defineProperty(this,ho,{writable:!0,value:void 0}),Object.defineProperty(this,uo,{writable:!0,value:void 0}),Object.defineProperty(this,po,{writable:!0,value:void 0}),Object.defineProperty(this,go,{writable:!0,value:!1}),i(this,no)[no]=t,i(this,so)[so]=n,i(this,ro)[ro]=o,i(this,ao)[ao]=s,i(this,lo)[lo]={},i(this,co)[co]={},i(this,uo)[uo]=[],i(this,po)[po]=[],le.variableStore=this}registerVariable(e){const{name:t}=e;i(this,lo)[lo][t]=e,console.log("registerVariable",i(this,lo)[lo])}getVariable(e){return i(this,lo)[lo][e]}hasVarsRequestCompleted(){return i(this,go)[go]}syncVariables(e,t){if(!i(this,so)[so].token){const e="Account token is missing.";return i(this,no)[no].error(e),Promise.reject(new Error(e))}const o={type:"varsPayload",vars:{}};for(const e in i(this,lo)[lo])o.vars[e]={defaultValue:i(this,lo)[lo][e].defaultValue,type:i(this,lo)[lo][e].type};if(0===Object.keys(o.vars).length){const e="No variables are defined.";return i(this,no)[no].error(e),Promise.reject(new Error(e))}let n={};n=i(this,ro)[ro].addSystemDataToObject(n,void 0),n.tk=i(this,so)[so].token,n.type="meta";const s=JSON.stringify([n,o]),r=i(this,so)[so].dataPostPEURL;return i(this,ro)[ro].post(r,s).then((t=>(e&&"function"==typeof e&&e(t),t))).catch((e=>{throw t&&"function"==typeof t&&t(e),400===e.status?i(this,no)[no].error("Invalid sync payload or clear the existing draft"):401===e.status?i(this,no)[no].error("This is not a test profile"):i(this,no)[no].error("Sync variable failed"),e}))}fetchVariables(e){i(this,ao)[ao].push(K,{t:4}),e&&"function"==typeof e&&(i(this,ho)[ho]=e)}mergeVariables(e){console.log("msg vars is ",e),i(this,go)[go]=!0,ae.saveToLSorCookie("WZRK_PE",e),i(this,co)[co]=e;for(const t in i(this,lo)[lo])e.hasOwnProperty(t)&&i(this,lo)[lo][t].update(e[t]);i(this,ho)[ho]&&i(this,ho)[ho](),i(this,fo)[fo]()}addVariablesChangedCallback(e){e&&"function"==typeof e?(i(this,uo)[uo].push(e),this.hasVarsRequestCompleted()&&e()):i(this,no)[no].error("callback is not a function")}addOneTimeVariablesChangedCallback(e){e&&"function"==typeof e&&(this.hasVarsRequestCompleted()?e():i(this,po)[po].push(e))}removeVariablesChangedCallback(e){const t=i(this,uo)[uo].indexOf(e);-1!==t&&i(this,uo)[uo].splice(t,1)}removeOneTimeVariablesChangedCallback(e){const t=i(this,po)[po].indexOf(e);-1!==t&&i(this,po)[po].splice(t,1)}}var bo=function(){for(var e of i(this,uo)[uo])e();for(var t of i(this,po)[po])t();i(this,po)[po].length=0},mo=t("logger"),yo=t("api"),wo=t("onloadcalled"),Co=t("device"),ko=t("session"),xo=t("account"),Po=t("request"),So=t("variableStore"),Io=t("isSpa"),Oo=t("previousUrl"),_o=t("boundCheckPageChanged"),Eo=t("dismissSpamControl"),Ao=t("processOldValues"),Lo=t("debounce"),Mo=t("checkPageChanged"),To=t("handleMessageEvent"),Ro=t("pingRequest"),jo=t("isPingContinuous"),Do=t("overrideDSyncFlag");var zo=function(){this.onUserLogin._processOldValues(),this.privacy._processOldValues(),this.event._processOldValues(),this.profile._processOldValues(),this.notifications._processOldValues()},Bo=function(e){let t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300;return function(){clearTimeout(t),t=setTimeout(e,i)}},No=function(){i(this,Lo)[Lo]((()=>{i(this,Oo)[Oo]!==location.href&&this.pageChanged()}))()},Fo=function(e){var t,i;e.data&&e.data.message&&("Dashboard"===e.data.message&&e.data.url?Jt(e.data.url,null!==(t=e.data.variant)&&void 0!==t?t:null,null!==(i=e.data.details)&&void 0!==i?i:{}):"Overlay"===e.data.message&&$t(e.data,!0))},Uo=function(){let e=i(this,xo)[xo].dataPostURL,t={};t=i(this,Po)[Po].addSystemDataToObject(t,void 0),e=Ve(e,"type","ping"),e=Ve(e,"d",Ke(JSON.stringify(t),i(this,mo)[mo])),i(this,Po)[Po].saveAndFireRequest(e,le.blockRequest)},qo=function(){return void 0!==window.wzrk_d&&"continuous"===window.wzrk_d.ping},Vo=function(e){this._isPersonalisationActive()&&(e.dsync=!0)};const Wo=new class{get spa(){return i(this,Io)[Io]}set spa(e){const t=!0===e;i(this,Io)[Io]!==t&&1===i(this,wo)[wo]&&(t?document.addEventListener("click",i(this,_o)[_o]):document.removeEventListener("click",i(this,_o)[_o])),i(this,Io)[Io]=t}get dismissSpamControl(){return i(this,Eo)[Eo]}set dismissSpamControl(e){const t=!0===e;i(this,Eo)[Eo]=t,le.dismissSpamControl=t}constructor(){var e,t,o,n,s;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.defineProperty(this,Do,{value:Vo}),Object.defineProperty(this,jo,{value:qo}),Object.defineProperty(this,Ro,{value:Uo}),Object.defineProperty(this,To,{value:Fo}),Object.defineProperty(this,Mo,{value:No}),Object.defineProperty(this,Lo,{value:Bo}),Object.defineProperty(this,Ao,{value:zo}),Object.defineProperty(this,mo,{writable:!0,value:void 0}),Object.defineProperty(this,yo,{writable:!0,value:void 0}),Object.defineProperty(this,wo,{writable:!0,value:void 0}),Object.defineProperty(this,Co,{writable:!0,value:void 0}),Object.defineProperty(this,ko,{writable:!0,value:void 0}),Object.defineProperty(this,xo,{writable:!0,value:void 0}),Object.defineProperty(this,Po,{writable:!0,value:void 0}),Object.defineProperty(this,So,{writable:!0,value:void 0}),Object.defineProperty(this,Io,{writable:!0,value:void 0}),Object.defineProperty(this,Oo,{writable:!0,value:void 0}),Object.defineProperty(this,_o,{writable:!0,value:i(this,Mo)[Mo].bind(this)}),Object.defineProperty(this,Eo,{writable:!0,value:void 0}),this.enablePersonalization=void 0,this.popupCallbacks={},this.popupCurrentWzrkId="",i(this,wo)[wo]=0,this._isPersonalisationActive=this._isPersonalisationActive.bind(this),this.raiseNotificationClicked=()=>{},i(this,mo)[mo]=new li(ii),i(this,xo)[xo]=new d(null===(e=r.account)||void 0===e?void 0:e[0],r.region||(null===(t=r.account)||void 0===t?void 0:t[1]),r.targetDomain||(null===(o=r.account)||void 0===o?void 0:o[2]),r.token||(null===(n=r.account)||void 0===n?void 0:n[3])),i(this,Co)[Co]=new ye({logger:i(this,mo)[mo]}),i(this,Eo)[Eo]=r.dismissSpamControl||!1,i(this,ko)[ko]=new gi({logger:i(this,mo)[mo],isPersonalisationActive:this._isPersonalisationActive}),i(this,Po)[Po]=new Pi({logger:i(this,mo)[mo],account:i(this,xo)[xo],device:i(this,Co)[Co],session:i(this,ko)[ko],isPersonalisationActive:this._isPersonalisationActive}),this.enablePersonalization=r.enablePersonalization||!1,this.event=new Fe({logger:i(this,mo)[mo],request:i(this,Po)[Po],isPersonalisationActive:this._isPersonalisationActive},r.event),this.profile=new gt({logger:i(this,mo)[mo],request:i(this,Po)[Po],account:i(this,xo)[xo],isPersonalisationActive:this._isPersonalisationActive},r.profile),this.onUserLogin=new It({request:i(this,Po)[Po],account:i(this,xo)[xo],session:i(this,ko)[ko],logger:i(this,mo)[mo],device:i(this,Co)[Co]},r.onUserLogin),this.privacy=new Li({request:i(this,Po)[Po],account:i(this,xo)[xo],logger:i(this,mo)[mo]},r.privacy),this.notifications=new Hi({logger:i(this,mo)[mo],request:i(this,Po)[Po],account:i(this,xo)[xo]},r.notifications),i(this,So)[So]=new vo({logger:i(this,mo)[mo],request:i(this,Po)[Po],account:i(this,xo)[xo],event:this.event}),i(this,yo)[yo]=new be({logger:i(this,mo)[mo],request:i(this,Po)[Po],device:i(this,Co)[Co],session:i(this,ko)[ko]}),this.spa=r.spa,this.dismissSpamControl=r.dismissSpamControl,this.user=new ei({isPersonalisationActive:this._isPersonalisationActive}),this.session={getTimeElapsed:()=>i(this,ko)[ko].getTimeElapsed(),getPageCount:()=>i(this,ko)[ko].getPageCount()},this.logout=()=>{i(this,mo)[mo].debug("logout called"),ae.setInstantDeleteFlagInK()},this.clear=()=>{this.onUserLogin.clear()},this.getCleverTapID=()=>i(this,Co)[Co].getGuid(),this.getAccountID=()=>i(this,xo)[xo].id,this.getSCDomain=()=>i(this,xo)[xo].finalTargetDomain,this.setLibrary=(e,t)=>{le.flutterVersion={[e]:t}},this.setSCSDKVersion=e=>{i(this,xo)[xo].scSDKVersion=e;const t={};t.af={scv:"sc-sdk-v"+i(this,xo)[xo].scSDKVersion};let o=i(this,xo)[xo].dataPostURL;o=Ve(o,"type","page"),o=Ve(o,"d",Ke(JSON.stringify(t),i(this,mo)[mo])),i(this,Po)[Po].saveAndFireRequest(o,le.blockRequest)},Kt()&&(qt(),Ut(i(this,mo)[mo])),this.getInboxMessageCount=()=>{const e=Nt();return Object.keys(e).length},this.getInboxMessageUnreadCount=()=>{if(le.inbox)return le.inbox.unviewedCounter;i(this,mo)[mo].debug("No unread messages")},this.getAllInboxMessages=()=>Nt(),this.getUnreadInboxMessages=()=>{if(le.inbox)return le.inbox.unviewedMessages;i(this,mo)[mo].debug("No unread messages")},this.getInboxMessageForId=e=>{const t=Nt();if((null!==e||""!==e)&&t.hasOwnProperty(e))return t[e];i(this,mo)[mo].error("No message available for message Id "+e)},this.deleteInboxMessage=e=>{const t=Nt();if(null===e&&""===e||!t.hasOwnProperty(e))i(this,mo)[mo].error("No message available for message Id "+e);else{const i=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);0===t[e].viewed&&(le.inbox.unviewedCounter--,delete le.inbox.unviewedMessages[e],document.getElementById("unviewedBadge").innerText=le.inbox.unviewedCounter,document.getElementById("unviewedBadge").style.display=le.inbox.unviewedCounter>0?"flex":"none"),i&&i.remove(),delete t[e],Ft(t)}},this.markReadInboxMessage=e=>{const t=le.inbox.unviewedMessages,o=Nt();if(null===e&&""===e||!t.hasOwnProperty(e))i(this,mo)[mo].error("No message available for message Id "+e);else{const t=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);if(null!==t&&(t.shadowRoot.getElementById("unreadMarker").style.display="none"),o[e].viewed=1,document.getElementById("unviewedBadge")){var n=parseInt(document.getElementById("unviewedBadge").innerText)-1;document.getElementById("unviewedBadge").innerText=n,document.getElementById("unviewedBadge").style.display=n>0?"flex":"none"}window.clevertap.renderNotificationViewed({msgId:o[e].wzrk_id,pivotId:o[e].pivotId}),le.inbox.unviewedCounter--,delete le.inbox.unviewedMessages[e],Ft(o)}},this.markReadInboxMessagesForIds=e=>{if(Array.isArray(e))for(var t=0;t{const e=le.inbox.unviewedMessages,t=Nt();if(Object.keys(e).length>0){Object.keys(e).forEach((e=>{const i=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);null!==i&&(i.shadowRoot.getElementById("unreadMarker").style.display="none"),t[e].viewed=1,window.clevertap.renderNotificationViewed({msgId:t[e].wzrk_id,pivotId:t[e].wzrk_pivot})})),document.getElementById("unviewedBadge").innerText=0,document.getElementById("unviewedBadge").style.display="none",Ft(t),le.inbox.unviewedCounter=0,le.inbox.unviewedMessages={}}else i(this,mo)[mo].debug("All messages are already read")},this.toggleInbox=e=>{var t;return null===(t=le.inbox)||void 0===t?void 0:t.toggleInbox(e)},this.renderNotificationViewed=e=>{a(R,e)},this.renderNotificationClicked=e=>{a(j,e)};const a=(e,t)=>{if(!t||!t.msgId)return;const o={type:"event"};if(o.evtName=e,o.evtData={[T]:t.msgId},t.pivotId&&(o.evtData={...o.evtData,wzrk_pivot:t.pivotId}),t.wzrk_slideNo&&(o.evtData={...o.evtData,wzrk_slideNo:t.wzrk_slideNo}),t.kv&&null!==t.kv&&void 0!==t.kv)for(const e in t.kv)e.startsWith(M)&&(o.evtData={...o.evtData,[e]:t.kv[e]});if(t.msgCTkv&&null!==t.msgCTkv&&void 0!==t.msgCTkv)for(const e in t.msgCTkv)e.startsWith(M)&&(o.evtData={...o.evtData,[e]:t.msgCTkv[e]});i(this,Po)[Po].processEvent(o)};this.setLogLevel=e=>{i(this,mo)[mo].logLevel=Number(e),3===e?sessionStorage.WZRK_D="":delete sessionStorage.WZRK_D},this.handleIncrementValue=(e,t)=>{this.profile._handleIncrementDecrementValue(e,t,B)},this.handleDecrementValue=(e,t)=>{this.profile._handleIncrementDecrementValue(e,t,"$decr")},this.setMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueSet(e,t,"$set"):console.error("setMultiValuesForKey should be called with a value of type array")},this.addMultiValueForKey=(e,t)=>{"string"==typeof t||"number"==typeof t?this.profile._handleMultiValueAdd(e,t,N):console.error("addMultiValueForKey should be called with a value of type string or number.")},this.addMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueAdd(e,t,N):console.error("addMultiValuesForKey should be called with a value of type array.")},this.removeMultiValueForKey=(e,t)=>{"string"==typeof t||"number"==typeof t?this.profile._handleMultiValueRemove(e,t,F):console.error("removeMultiValueForKey should be called with a value of type string or number.")},this.removeMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueRemove(e,t,F):console.error("removeMultiValuesForKey should be called with a value of type array.")},this.removeValueForKey=e=>{this.profile._handleMultiValueDelete(e,U)};const l=(e,t,o)=>{((e,t,i,o,n)=>{const s=qe(location.href),r=s.e,a=s.p,l=s.page_type;if(void 0!==r){const s={};s.id=o.id,s.unsubGroups=le.unsubGroups,le.updatedCategoryLong&&(s.cUsY=le.updatedCategoryLong);let c=o.emailURL;i&&(c=Ve(c,"fetchGroups",i)),t&&(c=Ve(c,"encoded",t)),c=Ve(c,"e",r),c=Ve(c,"d",Ke(JSON.stringify(s),n)),a&&(c=Ve(c,"p",a)),"-1"!==e&&(c=Ve(c,"sub",e)),l&&(le.globalUnsubscribe=l===I,c=Ve(c,"page_type",l)),Qe.fireRequest(c)}})(e,t,o,i(this,xo)[xo],i(this,mo)[mo])};function c(e){var t=e.coords.latitude,i=e.coords.longitude;le.location={Latitude:t,Longitude:i},this.sendLocationData({Latitude:t,Longitude:i})}function h(e){switch(e.code){case e.PERMISSION_DENIED:console.log("User denied the request for Geolocation.");break;case e.POSITION_UNAVAILABLE:console.log("Location information is unavailable.");break;case e.TIMEOUT:console.log("The request to get user location timed out.");break;case e.UNKNOWN_ERROR:console.log("An unknown error occurred.")}}this.getLocation=function(e,t){if(e&&"number"!=typeof e||t&&"number"!=typeof t)console.log("Latitude and Longitude must be of number type");else if(e&&t){if(e<=-90||e>90)return void console.log("A vaid latitude must range between -90 and 90");if(t<=-180||t>180)return void console.log("A valid longitude must range between -180 and 180");le.location={Latitude:e,Longitude:t},this.sendLocationData({Latitude:e,Longitude:t})}else navigator.geolocation?navigator.geolocation.getCurrentPosition(c.bind(this),h):console.log("Geolocation is not supported by this browser.")};const u=i(this,yo)[yo];u.logout=this.logout,u.clear=this.clear,u.closeIframe=(e,t)=>{at(e,0,i(this,ko)[ko].sessionId)},u.enableWebPush=(e,t)=>{this.notifications._enableWebPush(e,t)},u.tr=e=>{Qt(e,{device:i(this,Co)[Co],session:i(this,ko)[ko],request:i(this,Po)[Po],logger:i(this,mo)[mo]})},u.setEnum=e=>{((e,t)=>{if(H(e)||Q(e))return"$E_"+e;t.error(Ae)})(e,i(this,mo)[mo])},u.is_onloadcalled=()=>1===i(this,wo)[wo],u.subEmail=e=>{l("1",e)},u.getEmail=(e,t)=>{l("-1",e,t)},u.unSubEmail=e=>{l("0",e)},u.unsubEmailGroups=e=>{le.unsubGroups=[];const t=document.getElementsByClassName("ct-unsub-group-input-item");for(let e=0;e{le.unsubGroups=e},u.getSubscriptionGroups=()=>le.unsubGroups,u.changeSubscriptionGroups=(e,t)=>{u.setSubscriptionGroups(t),l("2",e)},u.isGlobalUnsubscribe=()=>le.globalUnsubscribe,u.setIsGlobalUnsubscribe=e=>{le.globalUnsubscribe=e},u.setUpdatedCategoryLong=e=>{e.cUsY&&(le.updatedCategoryLong=e.cUsY)},window.$CLTP_WR=window.$WZRK_WR=u,(null===(s=r.account)||void 0===s?void 0:s[0].id)&&this.init()}init(e,t,o,n){if(1===i(this,wo)[wo])return;if(ae.removeCookie("WZRK_P",window.location.hostname),!i(this,xo)[xo].id){if(!e)return void i(this,mo)[mo].error(ke);i(this,xo)[xo].id=e}i(this,ko)[ko].cookieName="WZRK_S_"+i(this,xo)[xo].id,t&&(i(this,xo)[xo].region=t),o&&(i(this,xo)[xo].targetDomain=o),n&&(i(this,xo)[xo].token=n);const s=location.href,r=qe(s.toLowerCase());if(void 0!==r.e&&"0"==r.wzrk_ex)return;le.isPrivacyArrPushed=!0,le.privacyArray.length>0&&this.privacy.push(le.privacyArray),i(this,Ao)[Ao](),this.pageChanged();const a=setInterval((()=>{i(this,Co)[Co].gcookie&&(clearInterval(a),i(this,Po)[Po].processBackupEvents())}),3e3);i(this,Io)[Io]?document.addEventListener("click",i(this,_o)[_o]):document.removeEventListener("click",i(this,_o)[_o]),i(this,wo)[wo]=1}pageChanged(){const e=window.location.search,t=window.opener;if("?ctBuilder"===e)return console.log("open in visual builder mode"),window.addEventListener("message",i(this,To)[To],!1),void(t&&t.postMessage("builder","*"));if("?ctBuilderPreview"===e)return window.addEventListener("message",i(this,To)[To],!1),void(t&&t.postMessage("preview","*"));const o=window.location.href,n=qe(o.toLowerCase()),s=i(this,ko)[ko].getSessionCookieObject();let r=void 0===s.p?0:s.p;s.p=++r,i(this,ko)[ko].setSessionCookieObject(s);let a={},l=(e=>{if(""===e)return"";var t=document.createElement("a");return t.href=e,t.hostname})(document.referrer);if(window.location.hostname!==l){const e=120;""!==l&&(l=l.length>e?l.substring(0,e):l,a.referrer=l);let t=n.utm_source||n.wzrk_source;void 0!==t&&(t=t.length>e?t.substring(0,e):t,a.us=t);let i=n.utm_medium||n.wzrk_medium;void 0!==i&&(i=i.length>e?i.substring(0,e):i,a.um=i);let o=n.utm_campaign||n.wzrk_campaign;if(void 0!==o&&(o=o.length>e?o.substring(0,e):o,a.uc=o),void 0!==n.wzrk_medium){const e=n.wzrk_medium;e.match(/^email$|^social$|^search$/)&&(a.wm=e)}}a=i(this,Po)[Po].addSystemDataToObject(a,void 0),a.cpg=o,a.WZRK_CAMP=it();let c=i(this,xo)[xo].dataPostURL;i(this,Po)[Po].addFlags(a),1===parseInt(a.pg)&&i(this,Do)[Do](a),c=Ve(c,"type","page"),c=Ve(c,"d",Ke(JSON.stringify(a),i(this,mo)[mo])),i(this,Po)[Po].saveAndFireRequest(c,le.blockRequest),1===parseInt(a.pg)&&this.event.push(K,{t:4}),i(this,Oo)[Oo]=o,setTimeout((()=>{r<=3&&i(this,Ro)[Ro](),i(this,jo)[jo]()&&setInterval((()=>{i(this,Ro)[Ro]()}),3e5)}),12e4)}_isPersonalisationActive(){return ae._isLocalStorageSupported()&&this.enablePersonalization}set popupCallback(e){this.popupCallbacks[this.popupCurrentWzrkId]=e}sendLocationData(e){let t={af:{}};const o={};if(t.type="profile",null==o.tz&&(o.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),t.profile=o,e){Object.keys(e).forEach((i=>{t.af[i]=e[i]}))}le.location&&(t.af={...t.af,...le.location}),t=i(this,Po)[Po].addSystemDataToObject(t,!0),i(this,Po)[Po].addFlags(t);const n=Ke(JSON.stringify(t),i(this,mo)[mo]);let s=i(this,xo)[xo].dataPostURL;s=Ve(s,"type",A),s=Ve(s,"d",n),i(this,Po)[Po].saveAndFireRequest(s,le.blockRequest)}setOffline(e){"boolean"==typeof e?(le.offline=e,e||i(this,Po)[Po].processBackupEvents()):console.error("setOffline should be called with a value of type boolean")}defineVariable(e,t){return oo.define(e,t,i(this,So)[So])}syncVariables(e,t){if(4===i(this,mo)[mo].logLevel)return i(this,So)[So].syncVariables(e,t);{const e="App log level is not set to 4";return i(this,mo)[mo].error(e),Promise.reject(new Error(e))}}fetchVariables(e){i(this,So)[So].fetchVariables(e)}addVariablesChangedCallback(e){i(this,So)[So].addVariablesChangedCallback(e)}addOneTimeVariablesChangedCallback(e){i(this,So)[So].addOneTimeVariablesChangedCallback(e)}}(window.clevertap);return window.clevertap=window.wizrocket=Wo,Wo})); diff --git a/src/clevertap.js b/src/clevertap.js index fcf603e3..9582f46f 100644 --- a/src/clevertap.js +++ b/src/clevertap.js @@ -666,7 +666,7 @@ export default class CleverTap { #handleMessageEvent (event) { if (event.data && event.data.message) { if (event.data.message === 'Dashboard' && event.data.url) { - initialiseCTBuilder(event.data.url, event.data.variant ?? null) + initialiseCTBuilder(event.data.url, event.data.variant ?? null, event.data.details ?? {}) } else if (event.data.message === 'Overlay') { renderVisualBuilder(event.data, true) } diff --git a/src/modules/visualBuilder/pageBuilder.js b/src/modules/visualBuilder/pageBuilder.js index 766cc9be..9a5270a9 100644 --- a/src/modules/visualBuilder/pageBuilder.js +++ b/src/modules/visualBuilder/pageBuilder.js @@ -1,10 +1,10 @@ -export const initialiseCTBuilder = (url, variant) => { - document.addEventListener('DOMContentLoaded', () => onContentLoad(url, variant)) +export const initialiseCTBuilder = (url, variant, details) => { + document.addEventListener('DOMContentLoaded', () => onContentLoad(url, variant, details)) } let container -function onContentLoad (url, variant) { +function onContentLoad (url, variant, details) { document.body.innerHTML = '' container = document.createElement('div') container.id = 'overlayDiv' @@ -12,7 +12,7 @@ function onContentLoad (url, variant) { container.style.display = 'flex' document.body.appendChild(container) const overlayPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js' - loadOverlayScript(overlayPath, url, variant) + loadOverlayScript(overlayPath, url, variant, details) .then(() => { console.log('Overlay script loaded successfully.') }) @@ -31,14 +31,14 @@ function loadCSS () { document.head.appendChild(link) } -function loadOverlayScript (overlayPath, url, variant) { +function loadOverlayScript (overlayPath, url, variant, details) { return new Promise((resolve, reject) => { var script = document.createElement('script') script.type = 'module' script.src = overlayPath script.onload = function () { if (typeof window.Overlay === 'function') { - window.Overlay('#overlayDiv', url, variant) + window.Overlay('#overlayDiv', url, variant, details) resolve() } else { reject(new Error('ContentLayout not found in overlay.js')) @@ -87,11 +87,11 @@ function loadTypeKit () { } export const renderVisualBuilder = (targetingMsgJson, isPreview) => { - const details = isPreview ? targetingMsgJson[0] : targetingMsgJson.display.details[0] + const details = isPreview ? targetingMsgJson.details[0] : targetingMsgJson.display.details[0] const siteUrl = Object.keys(details)[0] const selectors = details[siteUrl] - if (siteUrl === window.location.href) { + if (siteUrl === window.location.href.split('?')[0]) { for (const selector in selectors) { const element = document.querySelector(selector) if (element) { @@ -99,6 +99,7 @@ export const renderVisualBuilder = (targetingMsgJson, isPreview) => { element.outerHTML = selectors[selector].html } else { // Update json data + dispatchJsonData(targetingMsgJson, selectors[selector]) } if (!isPreview) { window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot }) @@ -112,6 +113,7 @@ export const renderVisualBuilder = (targetingMsgJson, isPreview) => { retryElement.outerHTML = selectors[selector].html } else { // Update json data + dispatchJsonData(targetingMsgJson, selectors[selector]) } if (!isPreview) { window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot }) @@ -129,11 +131,16 @@ export const renderVisualBuilder = (targetingMsgJson, isPreview) => { } } } -// function addOverlayScript (overlayPath) { -// const scriptTag = document.createElement('script') -// scriptTag.setAttribute('type', 'text/javascript') -// scriptTag.setAttribute('id', 'wzrk-alert-js') -// scriptTag.setAttribute('src', overlayPath) -// document.getElementsByTagName('body')[0].appendChild(scriptTag) -// return scriptTag -// } + +function dispatchJsonData (targetingMsgJson, selector) { + const inaObj = {} + inaObj.msgId = targetingMsgJson.wzrk_id + if (targetingMsgJson.wzrk_pivot) { + inaObj.pivotId = targetingMsgJson.wzrk_pivot + } + if (selector.json != null) { + inaObj.json = selector.json + } + const kvPairsEvent = new CustomEvent('CT_web_native_display_buider', { detail: inaObj }) + document.dispatchEvent(kvPairsEvent) +} From 6939d1bde9573782cbec088834ce6cfdfc1f9667 Mon Sep 17 00:00:00 2001 From: KambleSonam Date: Tue, 14 May 2024 15:12:16 +0530 Subject: [PATCH 08/19] Removed commented code --- clevertap.js | 49 +----------------------------------------------- clevertap.js.map | 2 +- src/clevertap.js | 1 - src/util/tr.js | 47 ---------------------------------------------- 4 files changed, 2 insertions(+), 97 deletions(-) diff --git a/clevertap.js b/clevertap.js index 0a9f1804..dd9a5ac4 100644 --- a/clevertap.js +++ b/clevertap.js @@ -4661,54 +4661,7 @@ const _session = session; const _request = request; const _logger = logger; - let _wizCounter = 0; // msg = { - // arp: { - // j_n: 'Zw==', - // i_n: 'Y2NmewICAw==', - // d_ts: 0, - // dh: 0, - // v: 1, - // j_s: '{ }', - // id: 'WWW-WWW-WWRZ', - // e_ts: 0, - // r_ts: 1649748826, - // rc_w: 60, - // rc_n: 5 - // }, - // inapp_notifs: [ - // { - // msgContent: { - // templateType: 'point-and-click', - // type: 4 - // }, - // display: { - // divId: 'hero-banner', - // details: [{ - // 'http://localhost:3000/': { - // '.heroDi1v': { - // html: 'Hello Sonam' - // }, - // '#selector_2': { - // html: '

Hello Sonam

' - // }, - // '.heroDiv2': { - // json: { - // name: 'Sonam', - // identity: 1234 - // } - // } - // } - // }], - // wtarget_type: 2, - // wmc: 1, - // ff: 'Desktop' - // }, - // wzrk_id: '1655316906_20220620', - // wzrk_pivot: 'wzrk_default' - // } - // ] - // } - // Campaign House keeping + let _wizCounter = 0; // Campaign House keeping const doCampHouseKeeping = targetingMsgJson => { const campaignId = targetingMsgJson.wzrk_id.split('_')[0]; diff --git a/clevertap.js.map b/clevertap.js.map index f3ba26cb..c6ab4552 100644 --- a/clevertap.js.map +++ b/clevertap.js.map @@ -1 +1 @@ -{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/modules/visualBuilder/pageBuilder.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/notification.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {}\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n // Initialize array\n var array = []\n\n // Check if globalProfileMap is null, initialize if needed\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n // Check if the value to be set is either string or number\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = $ct.globalProfileMap[propKey]\n array.push(typeof propVal === 'number' ? propVal : propVal.toLowerCase())\n } else {\n $ct.globalProfileMap[propKey] = propVal\n }\n } else {\n // Check if propVal is an array\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = Array.isArray($ct.globalProfileMap[propKey]) ? $ct.globalProfileMap[propKey] : [$ct.globalProfileMap[propKey]]\n }\n\n // Check for case-sensitive inputs and filter the same ones\n for (var i = 0; i < propVal.length; i++) {\n if (typeof propVal[i] === 'number' && !array.includes(propVal[i])) {\n array.push(propVal[i])\n } else if (typeof propVal[i] === 'string' && !array.includes(propVal[i].toLowerCase())) {\n array.push(propVal[i].toLowerCase())\n } else if ((typeof propVal[i] === 'number' && array.includes(propVal[i])) || (typeof propVal[i] === 'string' && array.includes(propVal[i].toLowerCase()))) {\n console.error('Values already included')\n } else {\n console.error('Array supports only string or number type values')\n }\n }\n\n // Update globalProfileMap with the array\n $ct.globalProfileMap[propKey] = array\n }\n\n // Save to local storage or cookie\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Call the sendMultiValueData function\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n var index = $ct.globalProfileMap[propKey].indexOf(propVal)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n } else {\n for (var k = 0; k < propVal.length; k++) {\n var idx = $ct.globalProfileMap[propKey].indexOf(propVal[k])\n if (idx !== -1) {\n $ct.globalProfileMap[propKey].splice(idx, 1)\n }\n }\n }\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n // console.log('Raise notification clicked event for ', item)\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","export const initialiseCTBuilder = (url, variant, details) => {\n document.addEventListener('DOMContentLoaded', () => onContentLoad(url, variant, details))\n}\n\nlet container\n\nfunction onContentLoad (url, variant, details) {\n document.body.innerHTML = ''\n container = document.createElement('div')\n container.id = 'overlayDiv'\n container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form\n container.style.display = 'flex'\n document.body.appendChild(container)\n const overlayPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js'\n loadOverlayScript(overlayPath, url, variant, details)\n .then(() => {\n console.log('Overlay script loaded successfully.')\n })\n .catch((error) => {\n console.error('Error loading overlay script:', error)\n })\n loadCSS()\n loadTypeKit()\n}\n\nfunction loadCSS () {\n var link = document.createElement('link')\n link.rel = 'stylesheet'\n link.type = 'text/css'\n link.href = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css'\n document.head.appendChild(link)\n}\n\nfunction loadOverlayScript (overlayPath, url, variant, details) {\n return new Promise((resolve, reject) => {\n var script = document.createElement('script')\n script.type = 'module'\n script.src = overlayPath\n script.onload = function () {\n if (typeof window.Overlay === 'function') {\n window.Overlay('#overlayDiv', url, variant, details)\n resolve()\n } else {\n reject(new Error('ContentLayout not found in overlay.js'))\n }\n }\n script.onerror = function (error) {\n reject(error)\n }\n document.head.appendChild(script)\n })\n}\n\nfunction loadTypeKit () {\n var config = {\n kitId: 'eqj6nom',\n scriptTimeout: 3000,\n async: true\n }\n\n var d = document\n var h = d.documentElement\n var t = setTimeout(function () {\n h.className = h.className.replace(/\\bwf-loading\\b/g, '') + ' wf-inactive'\n // $(document).trigger(\"TypeKitReady\");\n }, config.scriptTimeout)\n var tk = d.createElement('script')\n var f = false\n var s = d.getElementsByTagName('script')[0]\n var a\n\n h.className += ' wf-loading'\n tk.src = 'https://use.typekit.net/' + config.kitId + '.js'\n tk.async = true\n tk.onload = tk.onreadystatechange = function () {\n a = this.readyState\n if (f || (a && a !== 'complete' && a !== 'loaded')) return\n f = true\n clearTimeout(t)\n try {\n // eslint-disable-next-line no-undef\n Typekit.load(config)\n } catch (e) {}\n }\n\n s.parentNode.insertBefore(tk, s)\n}\n\nexport const renderVisualBuilder = (targetingMsgJson, isPreview) => {\n const details = isPreview ? targetingMsgJson.details[0] : targetingMsgJson.display.details[0]\n const siteUrl = Object.keys(details)[0]\n const selectors = details[siteUrl]\n\n if (siteUrl === window.location.href.split('?')[0]) {\n for (const selector in selectors) {\n const element = document.querySelector(selector)\n if (element) {\n if (selectors[selector].html) {\n element.outerHTML = selectors[selector].html\n } else {\n // Update json data\n dispatchJsonData(targetingMsgJson, selectors[selector])\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n } else {\n let count = 0\n const intervalId = setInterval(() => {\n const retryElement = document.querySelector(selector)\n if (retryElement) {\n if (selectors[selector].html) {\n retryElement.outerHTML = selectors[selector].html\n } else {\n // Update json data\n dispatchJsonData(targetingMsgJson, selectors[selector])\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n clearInterval(intervalId)\n } else {\n count++\n if (count >= 20) {\n console.log(`No element present on DOM with selector '${selector}'.`)\n clearInterval(intervalId)\n }\n }\n }, 500)\n }\n }\n }\n}\n\nfunction dispatchJsonData (targetingMsgJson, selector) {\n const inaObj = {}\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (selector.json != null) {\n inaObj.json = selector.json\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display_buider', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n}\n","import {\n addToLocalProfileMap,\n arp,\n getCampaignObject,\n saveCampaignObject,\n closeIframe\n} from './clevertap'\n\nimport {\n CAMP_COOKIE_NAME,\n DISPLAY,\n GLOBAL,\n EV_COOKIE,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n WZRK_PREFIX,\n WZRK_ID,\n CAMP_COOKIE_G,\n GCOOKIE_NAME\n} from './constants'\n\nimport {\n getNow,\n getToday\n} from './datetime'\n\nimport {\n compressToBase64\n} from './encoder'\n\nimport { StorageManager, $ct } from './storage'\nimport RequestDispatcher from './requestDispatcher'\nimport { CTWebPersonalisationBanner } from './web-personalisation/banner'\nimport { CTWebPersonalisationCarousel } from './web-personalisation/carousel'\nimport { CTWebPopupImageOnly } from './web-popupImageonly/popupImageonly'\nimport { checkAndRegisterWebInboxElements, initializeWebInbox, processWebInboxSettings, hasWebInboxSettingsInLS, processInboxNotifs } from '../modules/web-inbox/helper'\nimport { renderVisualBuilder } from '../modules/visualBuilder/pageBuilder'\n\nconst _tr = (msg, {\n device,\n session,\n request,\n logger\n}) => {\n const _device = device\n const _session = session\n const _request = request\n const _logger = logger\n let _wizCounter = 0\n\n // msg = {\n // arp: {\n // j_n: 'Zw==',\n // i_n: 'Y2NmewICAw==',\n // d_ts: 0,\n // dh: 0,\n // v: 1,\n // j_s: '{ }',\n // id: 'WWW-WWW-WWRZ',\n // e_ts: 0,\n // r_ts: 1649748826,\n // rc_w: 60,\n // rc_n: 5\n // },\n // inapp_notifs: [\n // {\n // msgContent: {\n // templateType: 'point-and-click',\n // type: 4\n // },\n // display: {\n // divId: 'hero-banner',\n // details: [{\n // 'http://localhost:3000/': {\n // '.heroDi1v': {\n // html: 'Hello Sonam'\n // },\n // '#selector_2': {\n // html: '

Hello Sonam

'\n // },\n // '.heroDiv2': {\n // json: {\n // name: 'Sonam',\n // identity: 1234\n // }\n // }\n // }\n // }],\n // wtarget_type: 2,\n // wmc: 1,\n // ff: 'Desktop'\n // },\n // wzrk_id: '1655316906_20220620',\n // wzrk_pivot: 'wzrk_default'\n // }\n // ]\n // }\n // Campaign House keeping\n const doCampHouseKeeping = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const today = getToday()\n\n const incrCount = (obj, campaignId, excludeFromFreqCaps) => {\n let currentCount = 0\n let totalCount = 0\n if (obj[campaignId] != null) {\n currentCount = obj[campaignId]\n }\n currentCount++\n if (obj.tc != null) {\n totalCount = obj.tc\n }\n // if exclude from caps then dont add to total counts\n if (excludeFromFreqCaps < 0) {\n totalCount++\n }\n\n obj.tc = totalCount\n obj[campaignId] = currentCount\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n delete sessionStorage[CAMP_COOKIE_NAME]\n var campTypeObj = {}\n const campObj = getCampaignObject()\n if (targetingMsgJson.display.wtarget_type === 3 && campObj.hasOwnProperty('wi')) {\n campTypeObj = campObj.wi\n } else if ((targetingMsgJson.display.wtarget_type === 0 || targetingMsgJson.display.wtarget_type === 1) && campObj.hasOwnProperty('wp')) {\n campTypeObj = campObj.wp\n } else {\n campTypeObj = {}\n }\n if (campObj.hasOwnProperty('global')) {\n campTypeObj.wp = campObj\n }\n // global session limit. default is 1\n if (targetingMsgJson[DISPLAY].wmc == null) {\n targetingMsgJson[DISPLAY].wmc = 1\n }\n\n // global session limit for web inbox. default is 1\n if (targetingMsgJson[DISPLAY].wimc == null) {\n targetingMsgJson[DISPLAY].wimc = 1\n }\n\n var excludeFromFreqCaps = -1 // efc - Exclude from frequency caps\n let campaignSessionLimit = -1 // mdc - Once per session\n let campaignDailyLimit = -1 // tdc - Once per day\n let campaignTotalLimit = -1 // tlc - Once per user for the duration of campaign\n let totalDailyLimit = -1\n let totalSessionLimit = -1 // wmc - Web Popup Global Session Limit\n let totalInboxSessionLimit = -1 // wimc - Web Inbox Global Session Limit\n\n if (targetingMsgJson[DISPLAY].efc != null) { // exclude from frequency cap\n excludeFromFreqCaps = parseInt(targetingMsgJson[DISPLAY].efc, 10)\n }\n if (targetingMsgJson[DISPLAY].mdc != null) { // Campaign Session Limit\n campaignSessionLimit = parseInt(targetingMsgJson[DISPLAY].mdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tdc != null) { // No of web popups in a day per campaign\n campaignDailyLimit = parseInt(targetingMsgJson[DISPLAY].tdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tlc != null) { // Total lifetime count\n campaignTotalLimit = parseInt(targetingMsgJson[DISPLAY].tlc, 10)\n }\n if (targetingMsgJson[DISPLAY].wmp != null) { // No of campaigns per day\n totalDailyLimit = parseInt(targetingMsgJson[DISPLAY].wmp, 10)\n }\n if (targetingMsgJson[DISPLAY].wmc != null) { // No of campaigns per session\n totalSessionLimit = parseInt(targetingMsgJson[DISPLAY].wmc, 10)\n }\n\n if (targetingMsgJson[DISPLAY].wimc != null) { // No of inbox campaigns per session\n totalInboxSessionLimit = parseInt(targetingMsgJson[DISPLAY].wimc, 10)\n }\n // session level capping\n var sessionObj = campTypeObj[_session.sessionId]\n if (sessionObj) {\n const campaignSessionCount = sessionObj[campaignId]\n const totalSessionCount = sessionObj.tc\n // dnd\n if (campaignSessionCount === 'dnd' && !$ct.dismissSpamControl) {\n return false\n }\n\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n // Inbox session\n if (totalInboxSessionLimit > 0 && totalSessionCount >= totalInboxSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n } else {\n // session\n if (totalSessionLimit > 0 && totalSessionCount >= totalSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n }\n\n // campaign session\n if (campaignSessionLimit > 0 && campaignSessionCount >= campaignSessionLimit) {\n return false\n }\n } else {\n sessionObj = {}\n campTypeObj[_session.sessionId] = sessionObj\n }\n\n // daily level capping\n var dailyObj = campTypeObj[today]\n if (dailyObj != null) {\n const campaignDailyCount = dailyObj[campaignId]\n const totalDailyCount = dailyObj.tc\n // daily\n if (totalDailyLimit > 0 && totalDailyCount >= totalDailyLimit && excludeFromFreqCaps < 0) {\n return false\n }\n // campaign daily\n if (campaignDailyLimit > 0 && campaignDailyCount >= campaignDailyLimit) {\n return false\n }\n } else {\n dailyObj = {}\n campTypeObj[today] = dailyObj\n }\n\n var globalObj = campTypeObj[GLOBAL]\n if (globalObj != null) {\n const campaignTotalCount = globalObj[campaignId]\n // campaign total\n if (campaignTotalLimit > 0 && campaignTotalCount >= campaignTotalLimit) {\n return false\n }\n } else {\n globalObj = {}\n campTypeObj[GLOBAL] = globalObj\n }\n }\n // delay\n if (targetingMsgJson[DISPLAY].delay != null && targetingMsgJson[DISPLAY].delay > 0) {\n const delay = targetingMsgJson[DISPLAY].delay\n targetingMsgJson[DISPLAY].delay = 0\n setTimeout(_tr, delay * 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n return false\n }\n\n incrCount(sessionObj, campaignId, excludeFromFreqCaps)\n incrCount(dailyObj, campaignId, excludeFromFreqCaps)\n incrCount(globalObj, campaignId, excludeFromFreqCaps)\n\n let campKey = 'wp'\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n campKey = 'wi'\n }\n // get ride of stale sessions and day entries\n const newCampObj = {}\n newCampObj[_session.sessionId] = sessionObj\n newCampObj[today] = dailyObj\n newCampObj[GLOBAL] = globalObj\n saveCampaignObject({ [campKey]: newCampObj })\n }\n\n const getCookieParams = () => {\n const gcookie = _device.getGuid()\n const scookieObj = _session.getSessionCookieObject()\n return '&t=wc&d=' + encodeURIComponent(compressToBase64(gcookie + '|' + scookieObj.p + '|' + scookieObj.s))\n }\n\n const setupClickEvent = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n if (onClick !== '' && onClick != null) {\n let ctaElement\n let jsCTAElements\n if (isLegacy) {\n ctaElement = contentDiv\n } else if (contentDiv !== null) {\n jsCTAElements = contentDiv.getElementsByClassName('jsCT_CTA')\n if (jsCTAElements != null && jsCTAElements.length === 1) {\n ctaElement = jsCTAElements[0]\n }\n }\n const jsFunc = targetingMsgJson.display.jsFunc\n const isPreview = targetingMsgJson.display.preview\n if (isPreview == null) {\n onClick += getCookieParams()\n }\n\n if (ctaElement != null) {\n ctaElement.onclick = () => {\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n if (isPreview == null) {\n RequestDispatcher.fireRequest(onClick)\n }\n invokeExternalJs(jsFunc, targetingMsgJson)\n // close iframe. using -1 for no campaignId\n closeIframe('-1', divId, _session.sessionId)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n }\n }\n\n const invokeExternalJs = (jsFunc, targetingMsgJson) => {\n const func = window.parent[jsFunc]\n if (typeof func === 'function') {\n if (targetingMsgJson.display.kv != null) {\n func(targetingMsgJson.display.kv)\n } else {\n func()\n }\n }\n }\n\n const setupClickUrl = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n incrementImpression(targetingMsgJson)\n setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy)\n }\n\n const incrementImpression = (targetingMsgJson) => {\n const data = {}\n data.type = 'event'\n data.evtName = NOTIFICATION_VIEWED\n data.evtData = { [WZRK_ID]: targetingMsgJson.wzrk_id }\n if (targetingMsgJson.wzrk_pivot) {\n data.evtData = { ...data.evtData, wzrk_pivot: targetingMsgJson.wzrk_pivot }\n }\n _request.processEvent(data)\n }\n\n const renderPersonalisationBanner = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const bannerEl = document.createElement('ct-web-personalisation-banner')\n bannerEl.msgId = targetingMsgJson.wzrk_id\n bannerEl.pivotId = targetingMsgJson.wzrk_pivot\n bannerEl.divHeight = targetingMsgJson.display.divHeight\n bannerEl.details = targetingMsgJson.display.details[0]\n const containerEl = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n containerEl.innerHTML = ''\n containerEl.appendChild(bannerEl)\n }\n\n const renderPersonalisationCarousel = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-carousel') === undefined) {\n customElements.define('ct-web-personalisation-carousel', CTWebPersonalisationCarousel)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const carousel = document.createElement('ct-web-personalisation-carousel')\n carousel.target = targetingMsgJson\n const container = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n container.innerHTML = ''\n container.appendChild(carousel)\n }\n\n const renderPopUpImageOnly = (targetingMsgJson) => {\n const divId = 'wzrkImageOnlyDiv'\n const popupImageOnly = document.createElement('ct-web-popup-imageonly')\n popupImageOnly.session = _session\n popupImageOnly.target = targetingMsgJson\n const containerEl = document.getElementById(divId)\n containerEl.innerHTML = ''\n containerEl.style.visibility = 'hidden'\n containerEl.appendChild(popupImageOnly)\n }\n\n const renderFooterNotification = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const displayObj = targetingMsgJson.display\n\n if (displayObj.wtarget_type === 2) { // Handling Web Native display\n // Logic for kv pair data\n if (targetingMsgJson.msgContent.type === 1) {\n const inaObj = {}\n\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.msgContent.kv != null) {\n inaObj.kv = targetingMsgJson.msgContent.kv\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n return\n }\n }\n if (displayObj.layout === 1) { // Handling Web Exit Intent\n return showExitIntent(undefined, targetingMsgJson)\n }\n if (displayObj.layout === 3) { // Handling Web Popup Image Only\n const divId = 'wzrkImageOnlyDiv'\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById(divId) != null || document.getElementById('intentPreview') != null) {\n return\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n document.body.appendChild(msgDiv)\n if (customElements.get('ct-web-popup-imageonly') === undefined) {\n customElements.define('ct-web-popup-imageonly', CTWebPopupImageOnly)\n }\n return renderPopUpImageOnly(targetingMsgJson)\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const divId = 'wizParDiv' + displayObj.layout\n\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n if (document.getElementById(divId) != null) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = divId\n const isBanner = displayObj.layout === 2\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n const viewHeight = window.innerHeight\n const viewWidth = window.innerWidth\n let legacy = false\n\n if (!isBanner) {\n const marginBottom = viewHeight * 5 / 100\n var contentHeight = 10\n let right = viewWidth * 5 / 100\n let bottomPosition = contentHeight + marginBottom\n let width = viewWidth * 30 / 100 + 20\n let widthPerct = 'width:30%;'\n // for small devices - mobile phones\n if ((/mobile/i.test(navigator.userAgent) || (/mini/i.test(navigator.userAgent))) && /iPad/i.test(navigator.userAgent) === false) {\n width = viewWidth * 85 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:80%;'\n // medium devices - tablets\n } else if ('ontouchstart' in window || (/tablet/i.test(navigator.userAgent))) {\n width = viewWidth * 50 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:50%;'\n }\n // legacy footer notif\n if (displayObj.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden; bottom:' + bottomPosition + 'px !important;width:' + width + 'px !important;right:' + right + 'px !important;position:fixed;z-index:2147483647;')\n } else {\n msgDiv.setAttribute('style', widthPerct + displayObj.iFrameStyle)\n }\n } else {\n msgDiv.setAttribute('style', displayObj.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n\n const borderRadius = displayObj.br === false ? '0' : '8'\n\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, leftTd, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n leftTd = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n leftTd = '#f4f4f4'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"\"\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'\" + divId + \"');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"\" +\n // \"\"+\n '' + imageTd + \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
'\n html = css + title + body\n }\n\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n const ifrm = (iframe.contentWindow) ? iframe.contentWindow : (iframe.contentDocument.document) ? iframe.contentDocument.document : iframe.contentDocument\n const doc = ifrm.document\n\n // Dispatch event for popup box/banner close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n doc.open()\n doc.write(html)\n\n if (displayObj['custom-editor']) {\n appendScriptForCustomEvent(targetingMsgJson, doc)\n }\n doc.close()\n\n const adjustIFrameHeight = () => {\n // adjust iframe and body height of html inside correctly\n contentHeight = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv').scrollHeight\n if (displayObj['custom-editor'] !== true && !isBanner) {\n contentHeight += 25\n }\n document.getElementById('wiz-iframe').contentDocument.body.style.margin = '0px'\n document.getElementById('wiz-iframe').style.height = contentHeight + 'px'\n }\n\n const ua = navigator.userAgent.toLowerCase()\n if (ua.indexOf('safari') !== -1) {\n if (ua.indexOf('chrome') > -1) {\n iframe.onload = () => {\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n } else {\n let inDoc = iframe.contentDocument || iframe.contentWindow\n if (inDoc.document) inDoc = inDoc.document\n // safari iphone 7+ needs this.\n adjustIFrameHeight()\n const _timer = setInterval(() => {\n if (inDoc.readyState === 'complete') {\n clearInterval(_timer)\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }, 10)\n }\n } else {\n iframe.onload = () => {\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }\n }\n\n const appendScriptForCustomEvent = (targetingMsgJson, doc) => {\n const script = doc.createElement('script')\n script.innerHTML = `\n const ct__camapignId = '${targetingMsgJson.wzrk_id}';\n const ct__formatVal = (v) => {\n return v && v.trim().substring(0, 20);\n }\n const ct__parentOrigin = window.parent.origin;\n document.body.addEventListener('click', (event) => {\n const elem = event.target.closest?.('a[wzrk_c2a], button[wzrk_c2a]');\n if (elem) {\n const {innerText, id, name, value, href} = elem;\n const clickAttr = elem.getAttribute('onclick') || elem.getAttribute('click');\n const onclickURL = clickAttr?.match(/(window.open)[(\\](\\\"|')(.*)(\\\"|',)/)?.[3] || clickAttr?.match(/(location.href *= *)(\\\"|')(.*)(\\\"|')/)?.[3];\n const props = {innerText, id, name, value};\n let msgCTkv = Object.keys(props).reduce((acc, c) => {\n const formattedVal = ct__formatVal(props[c]);\n formattedVal && (acc['wzrk_click_' + c] = formattedVal);\n return acc;\n }, {});\n if(onclickURL) { msgCTkv['wzrk_click_' + 'url'] = onclickURL; }\n if(href) { msgCTkv['wzrk_click_' + 'c2a'] = href; }\n const notifData = { msgId: ct__camapignId, msgCTkv, pivotId: '${targetingMsgJson.wzrk_pivot}' };\n window.parent.clevertap.renderNotificationClicked(notifData);\n }\n });\n `\n doc.body.appendChild(script)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe-intent'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n const ifrm = (iframe.contentWindow) ? iframe.contentWindow : (iframe.contentDocument.document) ? iframe.contentDocument.document : iframe.contentDocument\n const doc = ifrm.document\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n doc.open()\n doc.write(html)\n if (targetingMsgJson.display['custom-editor']) {\n appendScriptForCustomEvent(targetingMsgJson, doc)\n }\n doc.close()\n\n const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n this.#logger.error('Error subscribing: ' + error)\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\n// import { initialiseCTBuilder } from './modules/visualBuilder/pageBuilder'\nimport { initialiseCTBuilder, renderVisualBuilder } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token) {\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n #handleMessageEvent (event) {\n if (event.data && event.data.message) {\n if (event.data.message === 'Dashboard' && event.data.url) {\n initialiseCTBuilder(event.data.url, event.data.variant ?? null, event.data.details ?? {})\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n }\n }\n\n pageChanged () {\n const search = window.location.search\n const parentWindow = window.opener\n\n if (search === '?ctBuilder') {\n // open in visual builder mode\n console.log('open in visual builder mode')\n window.addEventListener('message', this.#handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('builder', '*')\n }\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', this.#handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('preview', '*')\n }\n return\n }\n\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","constructor","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","dataPostPEURL","dataPostURL","recorderURL","emailURL","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","save","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","read","data","getItem","parse","e","remove","removeItem","removeCookie","name","domain","cookieStr","document","cookie","createCookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","readCookie","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","saveToLSorCookie","property","location","hostname","$ct","globalCache","readFromLSorCookie","trim","err","createBroadCookie","broadDomain","domainParts","testBroadDomain","testCookieName","tempCookie","getMetaProp","metaObj","setMetaProp","wzrkMetaObj","getAndClearMetaProp","setInstantDeleteFlagInK","k","flag","backupEvent","reqNo","backupArr","q","debug","removeBackup","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","get","item","saveCacheToLS","set","allKeys","objToArray","index","temp","getKey","getSecondLastKey","keysArr","getLastKey","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","s","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","sessionObj","getSessionCookieObject","kIdFromLS","guidFromLRUCache","lastK","lastGUID","unregisterTokenForGuid","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","_processOldValues","getDetails","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","fireRequest","skipARP","sendOULFlag","getDelayFrequency","account","randomDelay","random","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","ProfileHandler","profilesArr","getAttribute","propName","_handleIncrementDecrementValue","command","tz","profile","addSystemDataToObject","addFlags","compressedData","saveAndFireRequest","_handleMultiValueSet","arrayVal","array","toLowerCase","sendMultiValueData","_handleMultiValueAdd","propKey","propVal","_handleMultiValueRemove","_handleMultiValueDelete","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","clear","addToK","ids","g","kId","anonymousUser","foundInCache","gFromCache","Identity","cookieName","loginArr","pop","processProfile","CTWebPersonalisationBanner","HTMLElement","_details","shadow","attachShadow","mode","details","renderBanner","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","target","renderCarousel","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","button","setInterval","sliderTime","goTo","prev","cur","CTWebPopupImageOnly","_session","popup","container","resizeObserver","renderImageOnlyPopup","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","Message","config","message","wrapper","snackBar","renderMessage","createEl","part","_el","msg","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","raiseClickedEvent","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","contains","setBadgeStyle","msgCount","incomingMessages","msgs","updateInboxMessages","incomingMessagesForPreview","previewMsgs","now","buildUIForMessages","updateUnviewedBadgeCounter","connectedCallback","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","addMsgsToInboxFromLS","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","deleteMsgsFromUI","getInboxMessages","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","top","right","getBoundingClientRect","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","inbox_notifs","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","initialiseCTBuilder","variant","onContentLoad","position","overlayPath","loadOverlayScript","then","catch","loadCSS","loadTypeKit","link","rel","head","script","src","onload","Overlay","Error","onerror","kitId","scriptTimeout","h","documentElement","className","tk","onreadystatechange","Typekit","load","renderVisualBuilder","targetingMsgJson","siteUrl","selectors","selector","element","querySelector","outerHTML","dispatchJsonData","intervalId","retryElement","inaObj","json","kvPairsEvent","CustomEvent","dispatchEvent","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","onclick","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","pointerCss","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","ifrm","contentWindow","contentDocument","doc","closeCampaign","Event","write","appendScriptForCustomEvent","close","adjustIFrameHeight","scrollHeight","margin","ua","inDoc","_timer","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","getTotalVisits","visitCount","getLastVisit","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","info","debugPE","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","getTimeElapsed","sessionStart","getPageCount","seqNo","requestTime","RequestManager","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","post","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","_enableWebPush","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","skipDialog","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","getValue","getdefaultValue","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","addValueChangedCallback","removeValueChangedCallback","clearStartFlag","VariableStore","syncVariables","onSyncSuccess","onSyncFailure","meta","r","status","fetchVariables","onFetchCallback","addVariablesChangedCallback","callback","addOneTimeVariablesChangedCallback","removeVariablesChangedCallback","removeOneTimeVariablesChangedCallback","callBack","CleverTap","spa","isSpa","bind","enablePersonalization","_isPersonalisationActive","ReqestManager","onUserLogin","privacy","notifications","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","handleDecrementValue","setMultiValuesForKey","addMultiValueForKey","addMultiValuesForKey","removeMultiValueForKey","removeMultiValuesForKey","removeValueForKey","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","sendLocationData","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","elements","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","parentWindow","opener","postMessage","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","setOffline","arg","defineVariable","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;EAAO,MAAMA,aAAa,GAAG,oBAAtB;EACA,MAAMC,eAAe,GAAG,QAAxB;EACA,MAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;ECAQ,MAAMC,OAAN,CAAc;EAO3BC,EAAAA,WAAW,GAAsE;EAAA,QAApE;EAAEC,MAAAA;EAAF,KAAoE,uEAA3D,EAA2D;EAAA,QAAvDC,MAAuD,uEAA9C,EAA8C;EAAA,QAA1CC,YAA0C,uEAA3BP,aAA2B;EAAA,QAAZQ,KAAY,uEAAJ,EAAI;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,aALvE;EAKuE;EAAA;EAAA;EAAA,aAJjER;EAIiE;EAAA;EAAA;EAAA,aAHjE;EAGiE;EAAA;EAAA;EAAA,aAFxE;EAEwE;EAC/E,SAAKK,EAAL,GAAUA,EAAV;;EACA,QAAIC,MAAJ,EAAY;EACV,WAAKA,MAAL,GAAcA,MAAd;EACD;;EACD,QAAIC,YAAJ,EAAkB;EAChB,WAAKA,YAAL,GAAoBA,YAApB;EACD;;EACD,QAAIC,KAAJ,EAAW;EACT,WAAKA,KAAL,GAAaA,KAAb;EACD;EACF;;EAED,MAAIH,EAAJ,GAAU;EACR,uCAAO,IAAP;EACD;;EAED,MAAIA,EAAJ,CAAQI,SAAR,EAAmB;EACjB,gEAAkBA,SAAlB;EACD;;EAED,MAAIH,MAAJ,GAAc;EACZ,uCAAO,IAAP;EACD;;EAED,MAAIA,MAAJ,CAAYA,MAAZ,EAAoB;EAClB,0DAAeA,MAAf;EACD;;EAED,MAAII,YAAJ,GAAoB;EAClB,uCAAO,IAAP;EACD;;EAED,MAAIA,YAAJ,CAAkBA,YAAlB,EAAgC;EAC9B,s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AK,CAAC3c,IAAN,CAAW6Z,OAAxD,qEAAmE,EAAnE,CAAnB;EACD,KAFD,MAEO,IAAI8C,KAAK,CAAC3c,IAAN,CAAW8f,OAAX,KAAuB,SAA3B,EAAsC;EAC3CqR,MAAAA,mBAAmB,CAACxU,KAAK,CAAC3c,IAAP,EAAa,IAAb,CAAnB;EACD;EACF;EACF;;+CAuGe;EACd,MAAIqP,WAAW,GAAG,0DAAcpX,WAAhC;;EACA,MAAI+H,IAAI,GAAG,EAAX;EACAA,EAAAA,IAAI,GAAG,0DAAcqX,qBAAd,CAAoCrX,IAApC,EAA0C7C,SAA1C,CAAP;EACAkS,EAAAA,WAAW,GAAGzD,QAAQ,CAACyD,WAAD,EAAc,MAAd,EAAsBpV,QAAtB,CAAtB;EACAoV,EAAAA,WAAW,GAAGzD,QAAQ,CAACyD,WAAD,EAAc,GAAd,EAAmB3C,YAAY,CAAC7M,IAAI,CAACC,SAAL,CAAeE,IAAf,CAAD,8BAAuB,IAAvB,wBAA/B,CAAtB;;EAEA,4DAAcwX,kBAAd,CAAiCnI,WAAjC,EAA8CpN,GAAG,CAACgC,YAAlD;EACD;;yDAEoB;EACnB,SAAQ,OAAOrC,MAAM,CAACwqC,MAAd,KAAyB,WAAzB,IAAwCxqC,MAAM,CAACwqC,MAAP,CAAcC,IAAd,KAAuB,YAAvE;EACD;;yDAMmBrsC,MAAM;EACxB,MAAI,KAAKslC,wBAAL,EAAJ,EAAqC;EACnCtlC,IAAAA,IAAI,CAACi+B,KAAL,GAAa,IAAb;EACD;EACF;;QC5xBGvuB,SAAS,GAAG,IAAI48B,SAAJ,CAAc1qC,MAAM,CAAC8N,SAArB;EAElB9N,MAAM,CAAC8N,SAAP,GAAmB9N,MAAM,CAAC+N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/modules/visualBuilder/pageBuilder.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/notification.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {}\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n // Initialize array\n var array = []\n\n // Check if globalProfileMap is null, initialize if needed\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n // Check if the value to be set is either string or number\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = $ct.globalProfileMap[propKey]\n array.push(typeof propVal === 'number' ? propVal : propVal.toLowerCase())\n } else {\n $ct.globalProfileMap[propKey] = propVal\n }\n } else {\n // Check if propVal is an array\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = Array.isArray($ct.globalProfileMap[propKey]) ? $ct.globalProfileMap[propKey] : [$ct.globalProfileMap[propKey]]\n }\n\n // Check for case-sensitive inputs and filter the same ones\n for (var i = 0; i < propVal.length; i++) {\n if (typeof propVal[i] === 'number' && !array.includes(propVal[i])) {\n array.push(propVal[i])\n } else if (typeof propVal[i] === 'string' && !array.includes(propVal[i].toLowerCase())) {\n array.push(propVal[i].toLowerCase())\n } else if ((typeof propVal[i] === 'number' && array.includes(propVal[i])) || (typeof propVal[i] === 'string' && array.includes(propVal[i].toLowerCase()))) {\n console.error('Values already included')\n } else {\n console.error('Array supports only string or number type values')\n }\n }\n\n // Update globalProfileMap with the array\n $ct.globalProfileMap[propKey] = array\n }\n\n // Save to local storage or cookie\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Call the sendMultiValueData function\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n var index = $ct.globalProfileMap[propKey].indexOf(propVal)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n } else {\n for (var k = 0; k < propVal.length; k++) {\n var idx = $ct.globalProfileMap[propKey].indexOf(propVal[k])\n if (idx !== -1) {\n $ct.globalProfileMap[propKey].splice(idx, 1)\n }\n }\n }\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n // console.log('Raise notification clicked event for ', item)\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","export const initialiseCTBuilder = (url, variant, details) => {\n document.addEventListener('DOMContentLoaded', () => onContentLoad(url, variant, details))\n}\n\nlet container\n\nfunction onContentLoad (url, variant, details) {\n document.body.innerHTML = ''\n container = document.createElement('div')\n container.id = 'overlayDiv'\n container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form\n container.style.display = 'flex'\n document.body.appendChild(container)\n const overlayPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js'\n loadOverlayScript(overlayPath, url, variant, details)\n .then(() => {\n console.log('Overlay script loaded successfully.')\n })\n .catch((error) => {\n console.error('Error loading overlay script:', error)\n })\n loadCSS()\n loadTypeKit()\n}\n\nfunction loadCSS () {\n var link = document.createElement('link')\n link.rel = 'stylesheet'\n link.type = 'text/css'\n link.href = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css'\n document.head.appendChild(link)\n}\n\nfunction loadOverlayScript (overlayPath, url, variant, details) {\n return new Promise((resolve, reject) => {\n var script = document.createElement('script')\n script.type = 'module'\n script.src = overlayPath\n script.onload = function () {\n if (typeof window.Overlay === 'function') {\n window.Overlay('#overlayDiv', url, variant, details)\n resolve()\n } else {\n reject(new Error('ContentLayout not found in overlay.js'))\n }\n }\n script.onerror = function (error) {\n reject(error)\n }\n document.head.appendChild(script)\n })\n}\n\nfunction loadTypeKit () {\n var config = {\n kitId: 'eqj6nom',\n scriptTimeout: 3000,\n async: true\n }\n\n var d = document\n var h = d.documentElement\n var t = setTimeout(function () {\n h.className = h.className.replace(/\\bwf-loading\\b/g, '') + ' wf-inactive'\n // $(document).trigger(\"TypeKitReady\");\n }, config.scriptTimeout)\n var tk = d.createElement('script')\n var f = false\n var s = d.getElementsByTagName('script')[0]\n var a\n\n h.className += ' wf-loading'\n tk.src = 'https://use.typekit.net/' + config.kitId + '.js'\n tk.async = true\n tk.onload = tk.onreadystatechange = function () {\n a = this.readyState\n if (f || (a && a !== 'complete' && a !== 'loaded')) return\n f = true\n clearTimeout(t)\n try {\n // eslint-disable-next-line no-undef\n Typekit.load(config)\n } catch (e) {}\n }\n\n s.parentNode.insertBefore(tk, s)\n}\n\nexport const renderVisualBuilder = (targetingMsgJson, isPreview) => {\n const details = isPreview ? targetingMsgJson.details[0] : targetingMsgJson.display.details[0]\n const siteUrl = Object.keys(details)[0]\n const selectors = details[siteUrl]\n\n if (siteUrl === window.location.href.split('?')[0]) {\n for (const selector in selectors) {\n const element = document.querySelector(selector)\n if (element) {\n if (selectors[selector].html) {\n element.outerHTML = selectors[selector].html\n } else {\n // Update json data\n dispatchJsonData(targetingMsgJson, selectors[selector])\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n } else {\n let count = 0\n const intervalId = setInterval(() => {\n const retryElement = document.querySelector(selector)\n if (retryElement) {\n if (selectors[selector].html) {\n retryElement.outerHTML = selectors[selector].html\n } else {\n // Update json data\n dispatchJsonData(targetingMsgJson, selectors[selector])\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n clearInterval(intervalId)\n } else {\n count++\n if (count >= 20) {\n console.log(`No element present on DOM with selector '${selector}'.`)\n clearInterval(intervalId)\n }\n }\n }, 500)\n }\n }\n }\n}\n\nfunction dispatchJsonData (targetingMsgJson, selector) {\n const inaObj = {}\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (selector.json != null) {\n inaObj.json = selector.json\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display_buider', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n}\n","import {\n addToLocalProfileMap,\n arp,\n getCampaignObject,\n saveCampaignObject,\n closeIframe\n} from './clevertap'\n\nimport {\n CAMP_COOKIE_NAME,\n DISPLAY,\n GLOBAL,\n EV_COOKIE,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n WZRK_PREFIX,\n WZRK_ID,\n CAMP_COOKIE_G,\n GCOOKIE_NAME\n} from './constants'\n\nimport {\n getNow,\n getToday\n} from './datetime'\n\nimport {\n compressToBase64\n} from './encoder'\n\nimport { StorageManager, $ct } from './storage'\nimport RequestDispatcher from './requestDispatcher'\nimport { CTWebPersonalisationBanner } from './web-personalisation/banner'\nimport { CTWebPersonalisationCarousel } from './web-personalisation/carousel'\nimport { CTWebPopupImageOnly } from './web-popupImageonly/popupImageonly'\nimport { checkAndRegisterWebInboxElements, initializeWebInbox, processWebInboxSettings, hasWebInboxSettingsInLS, processInboxNotifs } from '../modules/web-inbox/helper'\nimport { renderVisualBuilder } from '../modules/visualBuilder/pageBuilder'\n\nconst _tr = (msg, {\n device,\n session,\n request,\n logger\n}) => {\n const _device = device\n const _session = session\n const _request = request\n const _logger = logger\n let _wizCounter = 0\n\n // Campaign House keeping\n const doCampHouseKeeping = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const today = getToday()\n\n const incrCount = (obj, campaignId, excludeFromFreqCaps) => {\n let currentCount = 0\n let totalCount = 0\n if (obj[campaignId] != null) {\n currentCount = obj[campaignId]\n }\n currentCount++\n if (obj.tc != null) {\n totalCount = obj.tc\n }\n // if exclude from caps then dont add to total counts\n if (excludeFromFreqCaps < 0) {\n totalCount++\n }\n\n obj.tc = totalCount\n obj[campaignId] = currentCount\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n delete sessionStorage[CAMP_COOKIE_NAME]\n var campTypeObj = {}\n const campObj = getCampaignObject()\n if (targetingMsgJson.display.wtarget_type === 3 && campObj.hasOwnProperty('wi')) {\n campTypeObj = campObj.wi\n } else if ((targetingMsgJson.display.wtarget_type === 0 || targetingMsgJson.display.wtarget_type === 1) && campObj.hasOwnProperty('wp')) {\n campTypeObj = campObj.wp\n } else {\n campTypeObj = {}\n }\n if (campObj.hasOwnProperty('global')) {\n campTypeObj.wp = campObj\n }\n // global session limit. default is 1\n if (targetingMsgJson[DISPLAY].wmc == null) {\n targetingMsgJson[DISPLAY].wmc = 1\n }\n\n // global session limit for web inbox. default is 1\n if (targetingMsgJson[DISPLAY].wimc == null) {\n targetingMsgJson[DISPLAY].wimc = 1\n }\n\n var excludeFromFreqCaps = -1 // efc - Exclude from frequency caps\n let campaignSessionLimit = -1 // mdc - Once per session\n let campaignDailyLimit = -1 // tdc - Once per day\n let campaignTotalLimit = -1 // tlc - Once per user for the duration of campaign\n let totalDailyLimit = -1\n let totalSessionLimit = -1 // wmc - Web Popup Global Session Limit\n let totalInboxSessionLimit = -1 // wimc - Web Inbox Global Session Limit\n\n if (targetingMsgJson[DISPLAY].efc != null) { // exclude from frequency cap\n excludeFromFreqCaps = parseInt(targetingMsgJson[DISPLAY].efc, 10)\n }\n if (targetingMsgJson[DISPLAY].mdc != null) { // Campaign Session Limit\n campaignSessionLimit = parseInt(targetingMsgJson[DISPLAY].mdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tdc != null) { // No of web popups in a day per campaign\n campaignDailyLimit = parseInt(targetingMsgJson[DISPLAY].tdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tlc != null) { // Total lifetime count\n campaignTotalLimit = parseInt(targetingMsgJson[DISPLAY].tlc, 10)\n }\n if (targetingMsgJson[DISPLAY].wmp != null) { // No of campaigns per day\n totalDailyLimit = parseInt(targetingMsgJson[DISPLAY].wmp, 10)\n }\n if (targetingMsgJson[DISPLAY].wmc != null) { // No of campaigns per session\n totalSessionLimit = parseInt(targetingMsgJson[DISPLAY].wmc, 10)\n }\n\n if (targetingMsgJson[DISPLAY].wimc != null) { // No of inbox campaigns per session\n totalInboxSessionLimit = parseInt(targetingMsgJson[DISPLAY].wimc, 10)\n }\n // session level capping\n var sessionObj = campTypeObj[_session.sessionId]\n if (sessionObj) {\n const campaignSessionCount = sessionObj[campaignId]\n const totalSessionCount = sessionObj.tc\n // dnd\n if (campaignSessionCount === 'dnd' && !$ct.dismissSpamControl) {\n return false\n }\n\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n // Inbox session\n if (totalInboxSessionLimit > 0 && totalSessionCount >= totalInboxSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n } else {\n // session\n if (totalSessionLimit > 0 && totalSessionCount >= totalSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n }\n\n // campaign session\n if (campaignSessionLimit > 0 && campaignSessionCount >= campaignSessionLimit) {\n return false\n }\n } else {\n sessionObj = {}\n campTypeObj[_session.sessionId] = sessionObj\n }\n\n // daily level capping\n var dailyObj = campTypeObj[today]\n if (dailyObj != null) {\n const campaignDailyCount = dailyObj[campaignId]\n const totalDailyCount = dailyObj.tc\n // daily\n if (totalDailyLimit > 0 && totalDailyCount >= totalDailyLimit && excludeFromFreqCaps < 0) {\n return false\n }\n // campaign daily\n if (campaignDailyLimit > 0 && campaignDailyCount >= campaignDailyLimit) {\n return false\n }\n } else {\n dailyObj = {}\n campTypeObj[today] = dailyObj\n }\n\n var globalObj = campTypeObj[GLOBAL]\n if (globalObj != null) {\n const campaignTotalCount = globalObj[campaignId]\n // campaign total\n if (campaignTotalLimit > 0 && campaignTotalCount >= campaignTotalLimit) {\n return false\n }\n } else {\n globalObj = {}\n campTypeObj[GLOBAL] = globalObj\n }\n }\n // delay\n if (targetingMsgJson[DISPLAY].delay != null && targetingMsgJson[DISPLAY].delay > 0) {\n const delay = targetingMsgJson[DISPLAY].delay\n targetingMsgJson[DISPLAY].delay = 0\n setTimeout(_tr, delay * 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n return false\n }\n\n incrCount(sessionObj, campaignId, excludeFromFreqCaps)\n incrCount(dailyObj, campaignId, excludeFromFreqCaps)\n incrCount(globalObj, campaignId, excludeFromFreqCaps)\n\n let campKey = 'wp'\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n campKey = 'wi'\n }\n // get ride of stale sessions and day entries\n const newCampObj = {}\n newCampObj[_session.sessionId] = sessionObj\n newCampObj[today] = dailyObj\n newCampObj[GLOBAL] = globalObj\n saveCampaignObject({ [campKey]: newCampObj })\n }\n\n const getCookieParams = () => {\n const gcookie = _device.getGuid()\n const scookieObj = _session.getSessionCookieObject()\n return '&t=wc&d=' + encodeURIComponent(compressToBase64(gcookie + '|' + scookieObj.p + '|' + scookieObj.s))\n }\n\n const setupClickEvent = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n if (onClick !== '' && onClick != null) {\n let ctaElement\n let jsCTAElements\n if (isLegacy) {\n ctaElement = contentDiv\n } else if (contentDiv !== null) {\n jsCTAElements = contentDiv.getElementsByClassName('jsCT_CTA')\n if (jsCTAElements != null && jsCTAElements.length === 1) {\n ctaElement = jsCTAElements[0]\n }\n }\n const jsFunc = targetingMsgJson.display.jsFunc\n const isPreview = targetingMsgJson.display.preview\n if (isPreview == null) {\n onClick += getCookieParams()\n }\n\n if (ctaElement != null) {\n ctaElement.onclick = () => {\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n if (isPreview == null) {\n RequestDispatcher.fireRequest(onClick)\n }\n invokeExternalJs(jsFunc, targetingMsgJson)\n // close iframe. using -1 for no campaignId\n closeIframe('-1', divId, _session.sessionId)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n }\n }\n\n const invokeExternalJs = (jsFunc, targetingMsgJson) => {\n const func = window.parent[jsFunc]\n if (typeof func === 'function') {\n if (targetingMsgJson.display.kv != null) {\n func(targetingMsgJson.display.kv)\n } else {\n func()\n }\n }\n }\n\n const setupClickUrl = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n incrementImpression(targetingMsgJson)\n setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy)\n }\n\n const incrementImpression = (targetingMsgJson) => {\n const data = {}\n data.type = 'event'\n data.evtName = NOTIFICATION_VIEWED\n data.evtData = { [WZRK_ID]: targetingMsgJson.wzrk_id }\n if (targetingMsgJson.wzrk_pivot) {\n data.evtData = { ...data.evtData, wzrk_pivot: targetingMsgJson.wzrk_pivot }\n }\n _request.processEvent(data)\n }\n\n const renderPersonalisationBanner = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const bannerEl = document.createElement('ct-web-personalisation-banner')\n bannerEl.msgId = targetingMsgJson.wzrk_id\n bannerEl.pivotId = targetingMsgJson.wzrk_pivot\n bannerEl.divHeight = targetingMsgJson.display.divHeight\n bannerEl.details = targetingMsgJson.display.details[0]\n const containerEl = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n containerEl.innerHTML = ''\n containerEl.appendChild(bannerEl)\n }\n\n const renderPersonalisationCarousel = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-carousel') === undefined) {\n customElements.define('ct-web-personalisation-carousel', CTWebPersonalisationCarousel)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const carousel = document.createElement('ct-web-personalisation-carousel')\n carousel.target = targetingMsgJson\n const container = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n container.innerHTML = ''\n container.appendChild(carousel)\n }\n\n const renderPopUpImageOnly = (targetingMsgJson) => {\n const divId = 'wzrkImageOnlyDiv'\n const popupImageOnly = document.createElement('ct-web-popup-imageonly')\n popupImageOnly.session = _session\n popupImageOnly.target = targetingMsgJson\n const containerEl = document.getElementById(divId)\n containerEl.innerHTML = ''\n containerEl.style.visibility = 'hidden'\n containerEl.appendChild(popupImageOnly)\n }\n\n const renderFooterNotification = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const displayObj = targetingMsgJson.display\n\n if (displayObj.wtarget_type === 2) { // Handling Web Native display\n // Logic for kv pair data\n if (targetingMsgJson.msgContent.type === 1) {\n const inaObj = {}\n\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.msgContent.kv != null) {\n inaObj.kv = targetingMsgJson.msgContent.kv\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n return\n }\n }\n if (displayObj.layout === 1) { // Handling Web Exit Intent\n return showExitIntent(undefined, targetingMsgJson)\n }\n if (displayObj.layout === 3) { // Handling Web Popup Image Only\n const divId = 'wzrkImageOnlyDiv'\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById(divId) != null || document.getElementById('intentPreview') != null) {\n return\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n document.body.appendChild(msgDiv)\n if (customElements.get('ct-web-popup-imageonly') === undefined) {\n customElements.define('ct-web-popup-imageonly', CTWebPopupImageOnly)\n }\n return renderPopUpImageOnly(targetingMsgJson)\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const divId = 'wizParDiv' + displayObj.layout\n\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n if (document.getElementById(divId) != null) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = divId\n const isBanner = displayObj.layout === 2\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n const viewHeight = window.innerHeight\n const viewWidth = window.innerWidth\n let legacy = false\n\n if (!isBanner) {\n const marginBottom = viewHeight * 5 / 100\n var contentHeight = 10\n let right = viewWidth * 5 / 100\n let bottomPosition = contentHeight + marginBottom\n let width = viewWidth * 30 / 100 + 20\n let widthPerct = 'width:30%;'\n // for small devices - mobile phones\n if ((/mobile/i.test(navigator.userAgent) || (/mini/i.test(navigator.userAgent))) && /iPad/i.test(navigator.userAgent) === false) {\n width = viewWidth * 85 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:80%;'\n // medium devices - tablets\n } else if ('ontouchstart' in window || (/tablet/i.test(navigator.userAgent))) {\n width = viewWidth * 50 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:50%;'\n }\n // legacy footer notif\n if (displayObj.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden; bottom:' + bottomPosition + 'px !important;width:' + width + 'px !important;right:' + right + 'px !important;position:fixed;z-index:2147483647;')\n } else {\n msgDiv.setAttribute('style', widthPerct + displayObj.iFrameStyle)\n }\n } else {\n msgDiv.setAttribute('style', displayObj.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n\n const borderRadius = displayObj.br === false ? '0' : '8'\n\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, leftTd, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n leftTd = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n leftTd = '#f4f4f4'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"\"\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'\" + divId + \"');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"\" +\n // \"\"+\n '' + imageTd + \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
'\n html = css + title + body\n }\n\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n const ifrm = (iframe.contentWindow) ? iframe.contentWindow : (iframe.contentDocument.document) ? iframe.contentDocument.document : iframe.contentDocument\n const doc = ifrm.document\n\n // Dispatch event for popup box/banner close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n doc.open()\n doc.write(html)\n\n if (displayObj['custom-editor']) {\n appendScriptForCustomEvent(targetingMsgJson, doc)\n }\n doc.close()\n\n const adjustIFrameHeight = () => {\n // adjust iframe and body height of html inside correctly\n contentHeight = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv').scrollHeight\n if (displayObj['custom-editor'] !== true && !isBanner) {\n contentHeight += 25\n }\n document.getElementById('wiz-iframe').contentDocument.body.style.margin = '0px'\n document.getElementById('wiz-iframe').style.height = contentHeight + 'px'\n }\n\n const ua = navigator.userAgent.toLowerCase()\n if (ua.indexOf('safari') !== -1) {\n if (ua.indexOf('chrome') > -1) {\n iframe.onload = () => {\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n } else {\n let inDoc = iframe.contentDocument || iframe.contentWindow\n if (inDoc.document) inDoc = inDoc.document\n // safari iphone 7+ needs this.\n adjustIFrameHeight()\n const _timer = setInterval(() => {\n if (inDoc.readyState === 'complete') {\n clearInterval(_timer)\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }, 10)\n }\n } else {\n iframe.onload = () => {\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }\n }\n\n const appendScriptForCustomEvent = (targetingMsgJson, doc) => {\n const script = doc.createElement('script')\n script.innerHTML = `\n const ct__camapignId = '${targetingMsgJson.wzrk_id}';\n const ct__formatVal = (v) => {\n return v && v.trim().substring(0, 20);\n }\n const ct__parentOrigin = window.parent.origin;\n document.body.addEventListener('click', (event) => {\n const elem = event.target.closest?.('a[wzrk_c2a], button[wzrk_c2a]');\n if (elem) {\n const {innerText, id, name, value, href} = elem;\n const clickAttr = elem.getAttribute('onclick') || elem.getAttribute('click');\n const onclickURL = clickAttr?.match(/(window.open)[(\\](\\\"|')(.*)(\\\"|',)/)?.[3] || clickAttr?.match(/(location.href *= *)(\\\"|')(.*)(\\\"|')/)?.[3];\n const props = {innerText, id, name, value};\n let msgCTkv = Object.keys(props).reduce((acc, c) => {\n const formattedVal = ct__formatVal(props[c]);\n formattedVal && (acc['wzrk_click_' + c] = formattedVal);\n return acc;\n }, {});\n if(onclickURL) { msgCTkv['wzrk_click_' + 'url'] = onclickURL; }\n if(href) { msgCTkv['wzrk_click_' + 'c2a'] = href; }\n const notifData = { msgId: ct__camapignId, msgCTkv, pivotId: '${targetingMsgJson.wzrk_pivot}' };\n window.parent.clevertap.renderNotificationClicked(notifData);\n }\n });\n `\n doc.body.appendChild(script)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe-intent'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n const ifrm = (iframe.contentWindow) ? iframe.contentWindow : (iframe.contentDocument.document) ? iframe.contentDocument.document : iframe.contentDocument\n const doc = ifrm.document\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n doc.open()\n doc.write(html)\n if (targetingMsgJson.display['custom-editor']) {\n appendScriptForCustomEvent(targetingMsgJson, doc)\n }\n doc.close()\n\n const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n this.#logger.error('Error subscribing: ' + error)\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { initialiseCTBuilder, renderVisualBuilder } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token) {\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n #handleMessageEvent (event) {\n if (event.data && event.data.message) {\n if (event.data.message === 'Dashboard' && event.data.url) {\n initialiseCTBuilder(event.data.url, event.data.variant ?? null, event.data.details ?? {})\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n }\n }\n\n pageChanged () {\n const search = window.location.search\n const parentWindow = window.opener\n\n if (search === '?ctBuilder') {\n // open in visual builder mode\n console.log('open in visual builder mode')\n window.addEventListener('message', this.#handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('builder', '*')\n }\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', this.#handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('preview', '*')\n }\n return\n }\n\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","constructor","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","dataPostPEURL","dataPostURL","recorderURL","emailURL","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","save","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","read","data","getItem","parse","e","remove","removeItem","removeCookie","name","domain","cookieStr","document","cookie","createCookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","readCookie","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","saveToLSorCookie","property","location","hostname","$ct","globalCache","readFromLSorCookie","trim","err","createBroadCookie","broadDomain","domainParts","testBroadDomain","testCookieName","tempCookie","getMetaProp","metaObj","setMetaProp","wzrkMetaObj","getAndClearMetaProp","setInstantDeleteFlagInK","k","flag","backupEvent","reqNo","backupArr","q","debug","removeBackup","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","get","item","saveCacheToLS","set","allKeys","objToArray","index","temp","getKey","getSecondLastKey","keysArr","getLastKey","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","s","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","sessionObj","getSessionCookieObject","kIdFromLS","guidFromLRUCache","lastK","lastGUID","unregisterTokenForGuid","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","_processOldValues","getDetails","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","fireRequest","skipARP","sendOULFlag","getDelayFrequency","account","randomDelay","random","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","ProfileHandler","profilesArr","getAttribute","propName","_handleIncrementDecrementValue","command","tz","profile","addSystemDataToObject","addFlags","compressedData","saveAndFireRequest","_handleMultiValueSet","arrayVal","array","toLowerCase","sendMultiValueData","_handleMultiValueAdd","propKey","propVal","_handleMultiValueRemove","_handleMultiValueDelete","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","clear","addToK","ids","g","kId","anonymousUser","foundInCache","gFromCache","Identity","cookieName","loginArr","pop","processProfile","CTWebPersonalisationBanner","HTMLElement","_details","shadow","attachShadow","mode","details","renderBanner","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","target","renderCarousel","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","button","setInterval","sliderTime","goTo","prev","cur","CTWebPopupImageOnly","_session","popup","container","resizeObserver","renderImageOnlyPopup","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","Message","config","message","wrapper","snackBar","renderMessage","createEl","part","_el","msg","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","raiseClickedEvent","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","contains","setBadgeStyle","msgCount","incomingMessages","msgs","updateInboxMessages","incomingMessagesForPreview","previewMsgs","now","buildUIForMessages","updateUnviewedBadgeCounter","connectedCallback","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","addMsgsToInboxFromLS","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","deleteMsgsFromUI","getInboxMessages","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","top","right","getBoundingClientRect","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","inbox_notifs","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","initialiseCTBuilder","variant","onContentLoad","position","overlayPath","loadOverlayScript","then","catch","loadCSS","loadTypeKit","link","rel","head","script","src","onload","Overlay","Error","onerror","kitId","scriptTimeout","h","documentElement","className","tk","onreadystatechange","Typekit","load","renderVisualBuilder","targetingMsgJson","siteUrl","selectors","selector","element","querySelector","outerHTML","dispatchJsonData","intervalId","retryElement","inaObj","json","kvPairsEvent","CustomEvent","dispatchEvent","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","onclick","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","pointerCss","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","ifrm","contentWindow","contentDocument","doc","closeCampaign","Event","write","appendScriptForCustomEvent","close","adjustIFrameHeight","scrollHeight","margin","ua","inDoc","_timer","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","getTotalVisits","visitCount","getLastVisit","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","info","debugPE","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","getTimeElapsed","sessionStart","getPageCount","seqNo","requestTime","RequestManager","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","post","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","_enableWebPush","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","skipDialog","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","getValue","getdefaultValue","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","addValueChangedCallback","removeValueChangedCallback","clearStartFlag","VariableStore","syncVariables","onSyncSuccess","onSyncFailure","meta","r","status","fetchVariables","onFetchCallback","addVariablesChangedCallback","callback","addOneTimeVariablesChangedCallback","removeVariablesChangedCallback","removeOneTimeVariablesChangedCallback","callBack","CleverTap","spa","isSpa","bind","enablePersonalization","_isPersonalisationActive","ReqestManager","onUserLogin","privacy","notifications","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","handleDecrementValue","setMultiValuesForKey","addMultiValueForKey","addMultiValuesForKey","removeMultiValueForKey","removeMultiValuesForKey","removeValueForKey","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","sendLocationData","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","elements","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","parentWindow","opener","postMessage","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","setOffline","arg","defineVariable","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;EAAO,MAAMA,aAAa,GAAG,oBAAtB;EACA,MAAMC,eAAe,GAAG,QAAxB;EACA,MAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;ECAQ,MAAMC,OAAN,CAAc;EAO3BC,EAAAA,WAAW,GAAsE;EAAA,QAApE;EAAEC,MAAAA;EAAF,KAAoE,uEAA3D,EAA2D;EAAA,QAAvDC,MAAuD,uEAA9C,EAA8C;EAAA,QAA1CC,YAA0C,uEAA3BP,aAA2B;EAAA,QAAZQ,KAAY,uEAAJ,EAAI;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,aALvE;EAKuE;EAAA;EAAA;EAAA,aAJjER;EAIiE;EAAA;EAAA;EAAA,aAHjE;EAGiE;EAAA;EAAA;EAAA,aAFxE;EAEwE;EAC/E,SAAKK,EAAL,GAAUA,EAAV;;EACA,QAAIC,MAAJ,EAAY;EACV,WAAKA,MAAL,GAAcA,MAAd;EACD;;EACD,QAAIC,YAAJ,EAAkB;EAChB,WAAKA,YAAL,GAAoB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WAAD,EAAc,MAAd,EAAsBpV,QAAtB,CAAtB;EACAoV,EAAAA,WAAW,GAAGzD,QAAQ,CAACyD,WAAD,EAAc,GAAd,EAAmB3C,YAAY,CAAC7M,IAAI,CAACC,SAAL,CAAeE,IAAf,CAAD,8BAAuB,IAAvB,wBAA/B,CAAtB;;EAEA,4DAAcwX,kBAAd,CAAiCnI,WAAjC,EAA8CpN,GAAG,CAACgC,YAAlD;EACD;;yDAEoB;EACnB,SAAQ,OAAOrC,MAAM,CAACwqC,MAAd,KAAyB,WAAzB,IAAwCxqC,MAAM,CAACwqC,MAAP,CAAcC,IAAd,KAAuB,YAAvE;EACD;;yDAMmBrsC,MAAM;EACxB,MAAI,KAAKslC,wBAAL,EAAJ,EAAqC;EACnCtlC,IAAAA,IAAI,CAACi+B,KAAL,GAAa,IAAb;EACD;EACF;;QC3xBGvuB,SAAS,GAAG,IAAI48B,SAAJ,CAAc1qC,MAAM,CAAC8N,SAArB;EAElB9N,MAAM,CAAC8N,SAAP,GAAmB9N,MAAM,CAAC+N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file diff --git a/src/clevertap.js b/src/clevertap.js index 9582f46f..f76addf5 100644 --- a/src/clevertap.js +++ b/src/clevertap.js @@ -40,7 +40,6 @@ import NotificationHandler from './modules/notification' import { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper' import { Variable } from './modules/variables/variable' import VariableStore from './modules/variables/variableStore' -// import { initialiseCTBuilder } from './modules/visualBuilder/pageBuilder' import { initialiseCTBuilder, renderVisualBuilder } from './modules/visualBuilder/pageBuilder' export default class CleverTap { diff --git a/src/util/tr.js b/src/util/tr.js index 78acbf41..dfdd537d 100644 --- a/src/util/tr.js +++ b/src/util/tr.js @@ -48,53 +48,6 @@ const _tr = (msg, { const _logger = logger let _wizCounter = 0 - // msg = { - // arp: { - // j_n: 'Zw==', - // i_n: 'Y2NmewICAw==', - // d_ts: 0, - // dh: 0, - // v: 1, - // j_s: '{ }', - // id: 'WWW-WWW-WWRZ', - // e_ts: 0, - // r_ts: 1649748826, - // rc_w: 60, - // rc_n: 5 - // }, - // inapp_notifs: [ - // { - // msgContent: { - // templateType: 'point-and-click', - // type: 4 - // }, - // display: { - // divId: 'hero-banner', - // details: [{ - // 'http://localhost:3000/': { - // '.heroDi1v': { - // html: 'Hello Sonam' - // }, - // '#selector_2': { - // html: '

Hello Sonam

' - // }, - // '.heroDiv2': { - // json: { - // name: 'Sonam', - // identity: 1234 - // } - // } - // } - // }], - // wtarget_type: 2, - // wmc: 1, - // ff: 'Desktop' - // }, - // wzrk_id: '1655316906_20220620', - // wzrk_pivot: 'wzrk_default' - // } - // ] - // } // Campaign House keeping const doCampHouseKeeping = (targetingMsgJson) => { const campaignId = targetingMsgJson.wzrk_id.split('_')[0] From dc4d4b0ce663921e1dad888d57ba2eda112f5c52 Mon Sep 17 00:00:00 2001 From: KambleSonam Date: Tue, 14 May 2024 19:39:10 +0530 Subject: [PATCH 09/19] code commenting and optimisation --- clevertap.js | 82 ++++++++++++++----- clevertap.js.map | 2 +- clevertap.min.js | 2 +- .../visualBuilder/builder_constants.js | 2 + src/modules/visualBuilder/pageBuilder.js | 76 ++++++++++++----- 5 files changed, 119 insertions(+), 45 deletions(-) create mode 100644 src/modules/visualBuilder/builder_constants.js diff --git a/clevertap.js b/clevertap.js index 37229f77..6eecfe15 100644 --- a/clevertap.js +++ b/clevertap.js @@ -4498,10 +4498,23 @@ const arrowSvg = "\n\n\n"; const greenTickSvg = "\n\n\n"; + const OVERLAY_PATH = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js'; + const CSS_PATH = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css'; + + /** + * Initializes the Clevertap builder. + * @param {string} url - The URL to initialize the builder. + * @param {string} variant - The variant of the builder. + * @param {Object} details - The details object. + */ + const initialiseCTBuilder = (url, variant, details) => { document.addEventListener('DOMContentLoaded', () => onContentLoad(url, variant, details)); }; let container; + /** + * Handles content load for Clevertap builder. + */ function onContentLoad(url, variant, details) { document.body.innerHTML = ''; @@ -4511,7 +4524,7 @@ container.style.display = 'flex'; document.body.appendChild(container); - const overlayPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js'; + const overlayPath = OVERLAY_PATH; loadOverlayScript(overlayPath, url, variant, details).then(() => { console.log('Overlay script loaded successfully.'); }).catch(error => { @@ -4520,14 +4533,27 @@ loadCSS(); loadTypeKit(); } + /** + * Loads CSS file. + */ + function loadCSS() { var link = document.createElement('link'); link.rel = 'stylesheet'; link.type = 'text/css'; - link.href = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css'; + link.href = CSS_PATH; document.head.appendChild(link); } + /** + * Loads the overlay script. + * @param {string} overlayPath - The path to overlay script. + * @param {string} url - The URL. + * @param {string} variant - The variant. + * @param {Object} details - The details object. + * @returns {Promise} A promise. + */ + function loadOverlayScript(overlayPath, url, variant, details) { return new Promise((resolve, reject) => { @@ -4551,31 +4577,34 @@ document.head.appendChild(script); }); } + /** + * Loads TypeKit script. + */ + function loadTypeKit() { - var config = { + const config = { kitId: 'eqj6nom', scriptTimeout: 3000, async: true }; - var d = document; - var h = d.documentElement; - var t = setTimeout(function () { - h.className = h.className.replace(/\bwf-loading\b/g, '') + ' wf-inactive'; // $(document).trigger("TypeKitReady"); + const docElement = document.documentElement; + const timeoutId = setTimeout(function () { + docElement.className = docElement.className.replace(/\bwf-loading\b/g, '') + ' wf-inactive'; }, config.scriptTimeout); - var tk = d.createElement('script'); - var f = false; - var s = d.getElementsByTagName('script')[0]; - var a; - h.className += ' wf-loading'; - tk.src = 'https://use.typekit.net/' + config.kitId + '.js'; - tk.async = true; - - tk.onload = tk.onreadystatechange = function () { - a = this.readyState; - if (f || a && a !== 'complete' && a !== 'loaded') return; - f = true; - clearTimeout(t); + const typeKitScript = document.createElement('script'); + let scriptLoaded = false; + const firstScript = document.getElementsByTagName('script')[0]; + let scriptReadyState; + docElement.className += ' wf-loading'; + typeKitScript.src = 'https://use.typekit.net/' + config.kitId + '.js'; + typeKitScript.async = true; + + typeKitScript.onload = typeKitScript.onreadystatechange = function () { + scriptReadyState = this.readyState; + if (scriptLoaded || scriptReadyState && scriptReadyState !== 'complete' && scriptReadyState !== 'loaded') return; + scriptLoaded = true; + clearTimeout(timeoutId); try { // eslint-disable-next-line no-undef @@ -4583,8 +4612,14 @@ } catch (e) {} }; - s.parentNode.insertBefore(tk, s); + firstScript.parentNode.insertBefore(typeKitScript, firstScript); } + /** + * Renders the visual builder. + * @param {Object} targetingMsgJson - The point and click campaign JSON object. + * @param {boolean} isPreview - Indicates if it's a preview. + */ + const renderVisualBuilder = (targetingMsgJson, isPreview) => { const details = isPreview ? targetingMsgJson.details[0] : targetingMsgJson.display.details[0]; @@ -4643,6 +4678,11 @@ } } }; + /** + * Dispatches JSON data. + * @param {Object} targetingMsgJson - The point and click campaign JSON object. + * @param {Object} selector - The selector object. + */ function dispatchJsonData(targetingMsgJson, selector) { const inaObj = {}; diff --git a/clevertap.js.map b/clevertap.js.map index bc9aeade..2abc35f8 100644 --- a/clevertap.js.map +++ b/clevertap.js.map @@ -1 +1 @@ -{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/modules/visualBuilder/pageBuilder.js","src/util/clevertap-handler.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/notification.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\nexport const WIZ_IFRAME = 'wiz-iframe'\nexport const WIZ_IFRAME_INTENT = 'wiz-iframe-intent'\nexport const ADJUST_IFRAME_HEIGHT = 'adjustIFrameHeight'\nexport const UPDATE_HEIGHT = 'update height'\nexport const GET_NOTIFICATION = 'getnotif'\nexport const EVENT = 'Event'\nexport const PROFILE = 'Profile'\nexport const OUL = 'OUL'\nexport const CLOSE_BOX_POPUP = 'closeBoxPopUp'\nexport const CLOSE_BANNER_POPUP = 'closeBannerPopUp'\nexport const GET_NOTIFICATION_DATA = 'getnotifData'\nexport const CLOSE_INTERSTITIAL_POPUP = 'closeInterstitialPopUp'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {}\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n // Initialize array\n var array = []\n\n // Check if globalProfileMap is null, initialize if needed\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n // Check if the value to be set is either string or number\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = $ct.globalProfileMap[propKey]\n array.push(typeof propVal === 'number' ? propVal : propVal.toLowerCase())\n } else {\n $ct.globalProfileMap[propKey] = propVal\n }\n } else {\n // Check if propVal is an array\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = Array.isArray($ct.globalProfileMap[propKey]) ? $ct.globalProfileMap[propKey] : [$ct.globalProfileMap[propKey]]\n }\n\n // Check for case-sensitive inputs and filter the same ones\n for (var i = 0; i < propVal.length; i++) {\n if (typeof propVal[i] === 'number' && !array.includes(propVal[i])) {\n array.push(propVal[i])\n } else if (typeof propVal[i] === 'string' && !array.includes(propVal[i].toLowerCase())) {\n array.push(propVal[i].toLowerCase())\n } else if ((typeof propVal[i] === 'number' && array.includes(propVal[i])) || (typeof propVal[i] === 'string' && array.includes(propVal[i].toLowerCase()))) {\n console.error('Values already included')\n } else {\n console.error('Array supports only string or number type values')\n }\n }\n\n // Update globalProfileMap with the array\n $ct.globalProfileMap[propKey] = array\n }\n\n // Save to local storage or cookie\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Call the sendMultiValueData function\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n var index = $ct.globalProfileMap[propKey].indexOf(propVal)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n } else {\n for (var k = 0; k < propVal.length; k++) {\n var idx = $ct.globalProfileMap[propKey].indexOf(propVal[k])\n if (idx !== -1) {\n $ct.globalProfileMap[propKey].splice(idx, 1)\n }\n }\n }\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n // console.log('Raise notification clicked event for ', item)\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","export const initialiseCTBuilder = (url, variant, details) => {\n document.addEventListener('DOMContentLoaded', () => onContentLoad(url, variant, details))\n}\n\nlet container\n\nfunction onContentLoad (url, variant, details) {\n document.body.innerHTML = ''\n container = document.createElement('div')\n container.id = 'overlayDiv'\n container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form\n container.style.display = 'flex'\n document.body.appendChild(container)\n const overlayPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js'\n loadOverlayScript(overlayPath, url, variant, details)\n .then(() => {\n console.log('Overlay script loaded successfully.')\n })\n .catch((error) => {\n console.error('Error loading overlay script:', error)\n })\n loadCSS()\n loadTypeKit()\n}\n\nfunction loadCSS () {\n var link = document.createElement('link')\n link.rel = 'stylesheet'\n link.type = 'text/css'\n link.href = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css'\n document.head.appendChild(link)\n}\n\nfunction loadOverlayScript (overlayPath, url, variant, details) {\n return new Promise((resolve, reject) => {\n var script = document.createElement('script')\n script.type = 'module'\n script.src = overlayPath\n script.onload = function () {\n if (typeof window.Overlay === 'function') {\n window.Overlay('#overlayDiv', url, variant, details)\n resolve()\n } else {\n reject(new Error('ContentLayout not found in overlay.js'))\n }\n }\n script.onerror = function (error) {\n reject(error)\n }\n document.head.appendChild(script)\n })\n}\n\nfunction loadTypeKit () {\n var config = {\n kitId: 'eqj6nom',\n scriptTimeout: 3000,\n async: true\n }\n\n var d = document\n var h = d.documentElement\n var t = setTimeout(function () {\n h.className = h.className.replace(/\\bwf-loading\\b/g, '') + ' wf-inactive'\n // $(document).trigger(\"TypeKitReady\");\n }, config.scriptTimeout)\n var tk = d.createElement('script')\n var f = false\n var s = d.getElementsByTagName('script')[0]\n var a\n\n h.className += ' wf-loading'\n tk.src = 'https://use.typekit.net/' + config.kitId + '.js'\n tk.async = true\n tk.onload = tk.onreadystatechange = function () {\n a = this.readyState\n if (f || (a && a !== 'complete' && a !== 'loaded')) return\n f = true\n clearTimeout(t)\n try {\n // eslint-disable-next-line no-undef\n Typekit.load(config)\n } catch (e) {}\n }\n\n s.parentNode.insertBefore(tk, s)\n}\n\nexport const renderVisualBuilder = (targetingMsgJson, isPreview) => {\n const details = isPreview ? targetingMsgJson.details[0] : targetingMsgJson.display.details[0]\n const siteUrl = Object.keys(details)[0]\n const selectors = details[siteUrl]\n\n if (siteUrl === window.location.href.split('?')[0]) {\n for (const selector in selectors) {\n const element = document.querySelector(selector)\n if (element) {\n if (selectors[selector].html) {\n element.outerHTML = selectors[selector].html\n } else {\n // Update json data\n dispatchJsonData(targetingMsgJson, selectors[selector])\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n } else {\n let count = 0\n const intervalId = setInterval(() => {\n const retryElement = document.querySelector(selector)\n if (retryElement) {\n if (selectors[selector].html) {\n retryElement.outerHTML = selectors[selector].html\n } else {\n // Update json data\n dispatchJsonData(targetingMsgJson, selectors[selector])\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n clearInterval(intervalId)\n } else {\n count++\n if (count >= 20) {\n console.log(`No element present on DOM with selector '${selector}'.`)\n clearInterval(intervalId)\n }\n }\n }, 500)\n }\n }\n }\n}\n\nfunction dispatchJsonData (targetingMsgJson, selector) {\n const inaObj = {}\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (selector.json != null) {\n inaObj.json = selector.json\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display_buider', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n}\n","// clevertap-handler.js\n\nconst ctEventhandler = (html) => {\n const ctScript = `\n var clevertap = {\n event: {\n push: (eventName) => {\n window.parent.postMessage({\n action: 'Event',\n value: eventName\n },'*');\n }\n },\n profile: {\n push: (eventName) => {\n window.parent.postMessage({\n action: 'Profile',\n value: eventName\n },'*');\n }\n },\n onUserLogin: {\n push: (eventName) => {\n window.parent.postMessage({\n action: 'OUL',\n value: eventName\n },'*');\n }\n },\n closeBoxPopUp: () => {\n window.parent.postMessage({\n action: 'closeBoxPopUp',\n value: 'closeBoxPopUp'\n },'*');\n },\n closeBannerPopUp: () => {\n window.parent.postMessage({\n action: 'closeBannerPopUp',\n value: 'closeBannerPopUp'\n },'*');\n },\n closeInterstitialPopUp: () => {\n window.parent.postMessage({\n action: 'closeInterstitialPopUp',\n value: 'closeInterstitialPopUp'\n },'*');\n }\n }\n `\n const insertPosition = html.indexOf('\n `\n return html.replace(/(<\\s*\\/\\s*body)/, `${script}\\n$1`)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n const displayObj = targetingMsgJson.display\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = WIZ_IFRAME_INTENT\n let html = targetingMsgJson.msgContent.html\n if (displayObj['custom-editor'] && !displayObj['bee-editor'] && displayObj['custom-html-sandbox']) { // sandbox the iframe only for custom html\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox allow-forms' // allow popup to open url in new page\n html = ctEventhandler(html)\n }\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (targetingMsgJson.display['custom-editor'] && !targetingMsgJson.display['bee-editor'] && targetingMsgJson.display['custom-html-sandbox']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n let contentDiv\n iframe.onload = () => {\n if (targetingMsgJson.display['custom-editor'] && !targetingMsgJson.display['bee-editor'] && targetingMsgJson.display['custom-html-sandbox']) {\n window.addEventListener('message', event => {\n switch (event?.data?.action) {\n case GET_NOTIFICATION_DATA:\n window.clevertap.renderNotificationClicked(event.data.value)\n break\n case EVENT:\n window.clevertap.event.push(event.data.value)\n break\n case PROFILE:\n window.clevertap.profile.push(event.data.value)\n break\n case OUL:\n window.clevertap.onUserLogin.push(event.data.value)\n break\n case CLOSE_INTERSTITIAL_POPUP:\n setTimeout(() => {\n const interstitialWrapper = window.document.getElementById('intentPreview')\n const interstitialOverlay = window.document.getElementById('intentOpacityDiv')\n interstitialOverlay && interstitialOverlay.remove()\n interstitialWrapper && interstitialWrapper.remove()\n }, 0)\n break\n default:\n // Handle unknown action\n break\n }\n })\n contentDiv = ''\n } else {\n contentDiv = document.getElementById(WIZ_IFRAME_INTENT).contentDocument.getElementById('contentDiv')\n }\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n this.#logger.error('Error subscribing: ' + error)\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { initialiseCTBuilder, renderVisualBuilder } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token) {\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n #handleMessageEvent (event) {\n if (event.data && event.data.message) {\n if (event.data.message === 'Dashboard' && event.data.url) {\n initialiseCTBuilder(event.data.url, event.data.variant ?? null, event.data.details ?? {})\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n }\n }\n\n pageChanged () {\n const search = window.location.search\n const parentWindow = window.opener\n\n if (search === '?ctBuilder') {\n // open in visual builder mode\n console.log('open in visual builder mode')\n window.addEventListener('message', this.#handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('builder', '*')\n }\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', this.#handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('preview', '*')\n }\n return\n }\n\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","constructor","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","dataPostPEURL","dataPostURL","recorderURL","emailURL","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","WIZ_IFRAME","WIZ_IFRAME_INTENT","ADJUST_IFRAME_HEIGHT","UPDATE_HEIGHT","GET_NOTIFICATION","EVENT","PROFILE","OUL","CLOSE_BOX_POPUP","CLOSE_BANNER_POPUP","GET_NOTIFICATION_DATA","CLOSE_INTERSTITIAL_POPUP","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","save","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","read","data","getItem","parse","e","remove","removeItem","removeCookie","name","domain","cookieStr","document","cookie","createCookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","readCookie","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","saveToLSorCookie","property","location","hostname","$ct","globalCache","readFromLSorCookie","trim","err","createBroadCookie","broadDomain","domainParts","testBroadDomain","testCookieName","tempCookie","getMetaProp","metaObj","setMetaProp","wzrkMetaObj","getAndClearMetaProp","setInstantDeleteFlagInK","k","flag","backupEvent","reqNo","backupArr","q","debug","removeBackup","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","get","item","saveCacheToLS","set","allKeys","objToArray","index","temp","getKey","getSecondLastKey","keysArr","getLastKey","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","s","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","sessionObj","getSessionCookieObject","kIdFromLS","guidFromLRUCache","lastK","lastGUID","unregisterTokenForGuid","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","_processOldValues","getDetails","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","fireRequest","skipARP","sendOULFlag","getDelayFrequency","account","randomDelay","random","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","ProfileHandler","profilesArr","getAttribute","propName","_handleIncrementDecrementValue","command","tz","profile","addSystemDataToObject","addFlags","compressedData","saveAndFireRequest","_handleMultiValueSet","arrayVal","array","toLowerCase","sendMultiValueData","_handleMultiValueAdd","propKey","propVal","_handleMultiValueRemove","_handleMultiValueDelete","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","clear","addToK","ids","g","kId","anonymousUser","foundInCache","gFromCache","Identity","cookieName","loginArr","pop","processProfile","CTWebPersonalisationBanner","HTMLElement","_details","shadow","attachShadow","mode","details","renderBanner","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","target","renderCarousel","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","button","setInterval","sliderTime","goTo","prev","cur","CTWebPopupImageOnly","_session","popup","container","resizeObserver","renderImageOnlyPopup","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","Message","config","message","wrapper","snackBar","renderMessage","createEl","part","_el","msg","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","raiseClickedEvent","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","contains","setBadgeStyle","msgCount","incomingMessages","msgs","updateInboxMessages","incomingMessagesForPreview","previewMsgs","now","buildUIForMessages","updateUnviewedBadgeCounter","connectedCallback","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","addMsgsToInboxFromLS","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","deleteMsgsFromUI","getInboxMessages","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","top","right","getBoundingClientRect","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","inbox_notifs","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","initialiseCTBuilder","variant","onContentLoad","position","overlayPath","loadOverlayScript","then","catch","loadCSS","loadTypeKit","link","rel","head","script","src","onload","Overlay","Error","onerror","kitId","scriptTimeout","h","documentElement","className","tk","onreadystatechange","Typekit","load","renderVisualBuilder","targetingMsgJson","siteUrl","selectors","selector","element","querySelector","outerHTML","dispatchJsonData","intervalId","retryElement","inaObj","json","kvPairsEvent","CustomEvent","dispatchEvent","ctEventhandler","ctScript","insertPosition","join","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","onclick","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","sandbox","pointerCss","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","closeCampaign","Event","appendScriptForCustomEvent","srcdoc","handleMessage","heightAdjust","boxWrapper","bannerWrapper","margin","onUserLogin","handleIframeLoad","contentWindow","postMessage","contentDocument","scrollHeight","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","interstitialWrapper","interstitialOverlay","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","getTotalVisits","visitCount","getLastVisit","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","info","debugPE","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","getTimeElapsed","sessionStart","getPageCount","seqNo","requestTime","RequestManager","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","post","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","_enableWebPush","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","skipDialog","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","getValue","getdefaultValue","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","addValueChangedCallback","removeValueChangedCallback","clearStartFlag","VariableStore","syncVariables","onSyncSuccess","onSyncFailure","meta","r","status","fetchVariables","onFetchCallback","addVariablesChangedCallback","callback","addOneTimeVariablesChangedCallback","removeVariablesChangedCallback","removeOneTimeVariablesChangedCallback","callBack","CleverTap","spa","isSpa","bind","enablePersonalization","_isPersonalisationActive","ReqestManager","privacy","notifications","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","handleDecrementValue","setMultiValuesForKey","addMultiValueForKey","addMultiValuesForKey","removeMultiValueForKey","removeMultiValuesForKey","removeValueForKey","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","sendLocationData","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","elements","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","parentWindow","opener","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","setOffline","arg","defineVariable","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;EAAO,MAAMA,aAAa,GAAG,oBAAtB;EACA,MAAMC,eAAe,GAAG,QAAxB;EACA,MAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;ECAQ,MAAMC,OAAN,CAAc;EAO3BC,EAAAA,WAAW,GAAsE;EAAA,QAApE;EAAEC,MAAAA;EAAF,KAAoE,uEAA3D,EAA2D;EAAA,QAAvDC,MAAuD,uEAA9C,EAA8C;EAAA,QAA1CC,YAA0C,uEAA3BP,aAA2B;EAAA,QAAZQ,KAAY,uEAAJ,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,YAAlD;EACD;;yDAEoB;EACnB,SAAQ,OAAOrC,MAAM,CAAC6qC,MAAd,KAAyB,WAAzB,IAAwC7qC,MAAM,CAAC6qC,MAAP,CAAcC,IAAd,KAAuB,YAAvE;EACD;;yDAMmB1sC,MAAM;EACxB,MAAI,KAAK6lC,wBAAL,EAAJ,EAAqC;EACnC7lC,IAAAA,IAAI,CAACw+B,KAAL,GAAa,IAAb;EACD;EACF;;QC3xBG9uB,SAAS,GAAG,IAAIi9B,SAAJ,CAAc/qC,MAAM,CAAC8N,SAArB;EAElB9N,MAAM,CAAC8N,SAAP,GAAmB9N,MAAM,CAAC+N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/modules/visualBuilder/builder_constants.js","src/modules/visualBuilder/pageBuilder.js","src/util/clevertap-handler.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/notification.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\nexport const WIZ_IFRAME = 'wiz-iframe'\nexport const WIZ_IFRAME_INTENT = 'wiz-iframe-intent'\nexport const ADJUST_IFRAME_HEIGHT = 'adjustIFrameHeight'\nexport const UPDATE_HEIGHT = 'update height'\nexport const GET_NOTIFICATION = 'getnotif'\nexport const EVENT = 'Event'\nexport const PROFILE = 'Profile'\nexport const OUL = 'OUL'\nexport const CLOSE_BOX_POPUP = 'closeBoxPopUp'\nexport const CLOSE_BANNER_POPUP = 'closeBannerPopUp'\nexport const GET_NOTIFICATION_DATA = 'getnotifData'\nexport const CLOSE_INTERSTITIAL_POPUP = 'closeInterstitialPopUp'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {}\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n // Initialize array\n var array = []\n\n // Check if globalProfileMap is null, initialize if needed\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n // Check if the value to be set is either string or number\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = $ct.globalProfileMap[propKey]\n array.push(typeof propVal === 'number' ? propVal : propVal.toLowerCase())\n } else {\n $ct.globalProfileMap[propKey] = propVal\n }\n } else {\n // Check if propVal is an array\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = Array.isArray($ct.globalProfileMap[propKey]) ? $ct.globalProfileMap[propKey] : [$ct.globalProfileMap[propKey]]\n }\n\n // Check for case-sensitive inputs and filter the same ones\n for (var i = 0; i < propVal.length; i++) {\n if (typeof propVal[i] === 'number' && !array.includes(propVal[i])) {\n array.push(propVal[i])\n } else if (typeof propVal[i] === 'string' && !array.includes(propVal[i].toLowerCase())) {\n array.push(propVal[i].toLowerCase())\n } else if ((typeof propVal[i] === 'number' && array.includes(propVal[i])) || (typeof propVal[i] === 'string' && array.includes(propVal[i].toLowerCase()))) {\n console.error('Values already included')\n } else {\n console.error('Array supports only string or number type values')\n }\n }\n\n // Update globalProfileMap with the array\n $ct.globalProfileMap[propKey] = array\n }\n\n // Save to local storage or cookie\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Call the sendMultiValueData function\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n var index = $ct.globalProfileMap[propKey].indexOf(propVal)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n } else {\n for (var k = 0; k < propVal.length; k++) {\n var idx = $ct.globalProfileMap[propKey].indexOf(propVal[k])\n if (idx !== -1) {\n $ct.globalProfileMap[propKey].splice(idx, 1)\n }\n }\n }\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n // console.log('Raise notification clicked event for ', item)\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","export const OVERLAY_PATH = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js'\nexport const CSS_PATH = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css'\n","import { CSS_PATH, OVERLAY_PATH } from './builder_constants'\n\n/**\n * Initializes the Clevertap builder.\n * @param {string} url - The URL to initialize the builder.\n * @param {string} variant - The variant of the builder.\n * @param {Object} details - The details object.\n */\nexport const initialiseCTBuilder = (url, variant, details) => {\n document.addEventListener('DOMContentLoaded', () => onContentLoad(url, variant, details))\n}\n\nlet container\n/**\n * Handles content load for Clevertap builder.\n */\nfunction onContentLoad (url, variant, details) {\n document.body.innerHTML = ''\n container = document.createElement('div')\n container.id = 'overlayDiv'\n container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form\n container.style.display = 'flex'\n document.body.appendChild(container)\n const overlayPath = OVERLAY_PATH\n loadOverlayScript(overlayPath, url, variant, details)\n .then(() => {\n console.log('Overlay script loaded successfully.')\n })\n .catch((error) => {\n console.error('Error loading overlay script:', error)\n })\n loadCSS()\n loadTypeKit()\n}\n\n/**\n * Loads CSS file.\n */\nfunction loadCSS () {\n var link = document.createElement('link')\n link.rel = 'stylesheet'\n link.type = 'text/css'\n link.href = CSS_PATH\n document.head.appendChild(link)\n}\n\n/**\n * Loads the overlay script.\n * @param {string} overlayPath - The path to overlay script.\n * @param {string} url - The URL.\n * @param {string} variant - The variant.\n * @param {Object} details - The details object.\n * @returns {Promise} A promise.\n */\nfunction loadOverlayScript (overlayPath, url, variant, details) {\n return new Promise((resolve, reject) => {\n var script = document.createElement('script')\n script.type = 'module'\n script.src = overlayPath\n script.onload = function () {\n if (typeof window.Overlay === 'function') {\n window.Overlay('#overlayDiv', url, variant, details)\n resolve()\n } else {\n reject(new Error('ContentLayout not found in overlay.js'))\n }\n }\n script.onerror = function (error) {\n reject(error)\n }\n document.head.appendChild(script)\n })\n}\n\n/**\n * Loads TypeKit script.\n */\nfunction loadTypeKit () {\n const config = {\n kitId: 'eqj6nom',\n scriptTimeout: 3000,\n async: true\n }\n\n const docElement = document.documentElement\n const timeoutId = setTimeout(function () {\n docElement.className = docElement.className.replace(/\\bwf-loading\\b/g, '') + ' wf-inactive'\n }, config.scriptTimeout)\n const typeKitScript = document.createElement('script')\n let scriptLoaded = false\n const firstScript = document.getElementsByTagName('script')[0]\n let scriptReadyState\n\n docElement.className += ' wf-loading'\n typeKitScript.src = 'https://use.typekit.net/' + config.kitId + '.js'\n typeKitScript.async = true\n typeKitScript.onload = typeKitScript.onreadystatechange = function () {\n scriptReadyState = this.readyState\n if (scriptLoaded || (scriptReadyState && scriptReadyState !== 'complete' && scriptReadyState !== 'loaded')) return\n scriptLoaded = true\n clearTimeout(timeoutId)\n try {\n // eslint-disable-next-line no-undef\n Typekit.load(config)\n } catch (e) {}\n }\n\n firstScript.parentNode.insertBefore(typeKitScript, firstScript)\n}\n\n/**\n * Renders the visual builder.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {boolean} isPreview - Indicates if it's a preview.\n */\nexport const renderVisualBuilder = (targetingMsgJson, isPreview) => {\n const details = isPreview ? targetingMsgJson.details[0] : targetingMsgJson.display.details[0]\n const siteUrl = Object.keys(details)[0]\n const selectors = details[siteUrl]\n\n if (siteUrl === window.location.href.split('?')[0]) {\n for (const selector in selectors) {\n const element = document.querySelector(selector)\n if (element) {\n if (selectors[selector].html) {\n element.outerHTML = selectors[selector].html\n } else {\n // Update json data\n dispatchJsonData(targetingMsgJson, selectors[selector])\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n } else {\n let count = 0\n const intervalId = setInterval(() => {\n const retryElement = document.querySelector(selector)\n if (retryElement) {\n if (selectors[selector].html) {\n retryElement.outerHTML = selectors[selector].html\n } else {\n // Update json data\n dispatchJsonData(targetingMsgJson, selectors[selector])\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n clearInterval(intervalId)\n } else {\n count++\n if (count >= 20) {\n console.log(`No element present on DOM with selector '${selector}'.`)\n clearInterval(intervalId)\n }\n }\n }, 500)\n }\n }\n }\n}\n\n/**\n * Dispatches JSON data.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {Object} selector - The selector object.\n */\nfunction dispatchJsonData (targetingMsgJson, selector) {\n const inaObj = {}\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (selector.json != null) {\n inaObj.json = selector.json\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display_buider', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n}\n","// clevertap-handler.js\n\nconst ctEventhandler = (html) => {\n const ctScript = `\n var clevertap = {\n event: {\n push: (eventName) => {\n window.parent.postMessage({\n action: 'Event',\n value: eventName\n },'*');\n }\n },\n profile: {\n push: (eventName) => {\n window.parent.postMessage({\n action: 'Profile',\n value: eventName\n },'*');\n }\n },\n onUserLogin: {\n push: (eventName) => {\n window.parent.postMessage({\n action: 'OUL',\n value: eventName\n },'*');\n }\n },\n closeBoxPopUp: () => {\n window.parent.postMessage({\n action: 'closeBoxPopUp',\n value: 'closeBoxPopUp'\n },'*');\n },\n closeBannerPopUp: () => {\n window.parent.postMessage({\n action: 'closeBannerPopUp',\n value: 'closeBannerPopUp'\n },'*');\n },\n closeInterstitialPopUp: () => {\n window.parent.postMessage({\n action: 'closeInterstitialPopUp',\n value: 'closeInterstitialPopUp'\n },'*');\n }\n }\n `\n const insertPosition = html.indexOf('\n `\n return html.replace(/(<\\s*\\/\\s*body)/, `${script}\\n$1`)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n const displayObj = targetingMsgJson.display\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = WIZ_IFRAME_INTENT\n let html = targetingMsgJson.msgContent.html\n if (displayObj['custom-editor'] && !displayObj['bee-editor'] && displayObj['custom-html-sandbox']) { // sandbox the iframe only for custom html\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox allow-forms' // allow popup to open url in new page\n html = ctEventhandler(html)\n }\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (targetingMsgJson.display['custom-editor'] && !targetingMsgJson.display['bee-editor'] && targetingMsgJson.display['custom-html-sandbox']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n let contentDiv\n iframe.onload = () => {\n if (targetingMsgJson.display['custom-editor'] && !targetingMsgJson.display['bee-editor'] && targetingMsgJson.display['custom-html-sandbox']) {\n window.addEventListener('message', event => {\n switch (event?.data?.action) {\n case GET_NOTIFICATION_DATA:\n window.clevertap.renderNotificationClicked(event.data.value)\n break\n case EVENT:\n window.clevertap.event.push(event.data.value)\n break\n case PROFILE:\n window.clevertap.profile.push(event.data.value)\n break\n case OUL:\n window.clevertap.onUserLogin.push(event.data.value)\n break\n case CLOSE_INTERSTITIAL_POPUP:\n setTimeout(() => {\n const interstitialWrapper = window.document.getElementById('intentPreview')\n const interstitialOverlay = window.document.getElementById('intentOpacityDiv')\n interstitialOverlay && interstitialOverlay.remove()\n interstitialWrapper && interstitialWrapper.remove()\n }, 0)\n break\n default:\n // Handle unknown action\n break\n }\n })\n contentDiv = ''\n } else {\n contentDiv = document.getElementById(WIZ_IFRAME_INTENT).contentDocument.getElementById('contentDiv')\n }\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n this.#logger.error('Error subscribing: ' + error)\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { initialiseCTBuilder, renderVisualBuilder } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token) {\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n #handleMessageEvent (event) {\n if (event.data && event.data.message) {\n if (event.data.message === 'Dashboard' && event.data.url) {\n initialiseCTBuilder(event.data.url, event.data.variant ?? null, event.data.details ?? {})\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n }\n }\n\n pageChanged () {\n const search = window.location.search\n const parentWindow = window.opener\n\n if (search === '?ctBuilder') {\n // open in visual builder mode\n console.log('open in visual builder mode')\n window.addEventListener('message', this.#handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('builder', '*')\n }\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', this.#handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('preview', '*')\n }\n return\n }\n\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","constructor","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","dataPostPEURL","dataPostURL","recorderURL","emailURL","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","WIZ_IFRAME","WIZ_IFRAME_INTENT","ADJUST_IFRAME_HEIGHT","UPDATE_HEIGHT","GET_NOTIFICATION","EVENT","PROFILE","OUL","CLOSE_BOX_POPUP","CLOSE_BANNER_POPUP","GET_NOTIFICATION_DATA","CLOSE_INTERSTITIAL_POPUP","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","save","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","read","data","getItem","parse","e","remove","removeItem","removeCookie","name","domain","cookieStr","document","cookie","createCookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","readCookie","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","saveToLSorCookie","property","location","hostname","$ct","globalCache","readFromLSorCookie","trim","err","createBroadCookie","broadDomain","domainParts","testBroadDomain","testCookieName","tempCookie","getMetaProp","metaObj","setMetaProp","wzrkMetaObj","getAndClearMetaProp","setInstantDeleteFlagInK","k","flag","backupEvent","reqNo","backupArr","q","debug","removeBackup","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","get","item","saveCacheToLS","set","allKeys","objToArray","index","temp","getKey","getSecondLastKey","keysArr","getLastKey","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","s","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","sessionObj","getSessionCookieObject","kIdFromLS","guidFromLRUCache","lastK","lastGUID","unregisterTokenForGuid","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","_processOldValues","getDetails","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","fireRequest","skipARP","sendOULFlag","getDelayFrequency","account","randomDelay","random","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","ProfileHandler","profilesArr","getAttribute","propName","_handleIncrementDecrementValue","command","tz","profile","addSystemDataToObject","addFlags","compressedData","saveAndFireRequest","_handleMultiValueSet","arrayVal","array","toLowerCase","sendMultiValueData","_handleMultiValueAdd","propKey","propVal","_handleMultiValueRemove","_handleMultiValueDelete","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","clear","addToK","ids","g","kId","anonymousUser","foundInCache","gFromCache","Identity","cookieName","loginArr","pop","processProfile","CTWebPersonalisationBanner","HTMLElement","_details","shadow","attachShadow","mode","details","renderBanner","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","target","renderCarousel","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","button","setInterval","sliderTime","goTo","prev","cur","CTWebPopupImageOnly","_session","popup","container","resizeObserver","renderImageOnlyPopup","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","Message","config","message","wrapper","snackBar","renderMessage","createEl","part","_el","msg","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","raiseClickedEvent","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","contains","setBadgeStyle","msgCount","incomingMessages","msgs","updateInboxMessages","incomingMessagesForPreview","previewMsgs","now","buildUIForMessages","updateUnviewedBadgeCounter","connectedCallback","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","addMsgsToInboxFromLS","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","deleteMsgsFromUI","getInboxMessages","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","top","right","getBoundingClientRect","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","inbox_notifs","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","OVERLAY_PATH","CSS_PATH","initialiseCTBuilder","variant","onContentLoad","position","overlayPath","loadOverlayScript","then","catch","loadCSS","loadTypeKit","link","rel","head","script","src","onload","Overlay","Error","onerror","kitId","scriptTimeout","docElement","documentElement","timeoutId","className","typeKitScript","scriptLoaded","firstScript","scriptReadyState","onreadystatechange","Typekit","load","renderVisualBuilder","targetingMsgJson","siteUrl","selectors","selector","element","querySelector","outerHTML","dispatchJsonData","intervalId","retryElement","inaObj","json","kvPairsEvent","CustomEvent","dispatchEvent","ctEventhandler","ctScript","insertPosition","join","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","onclick","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","sandbox","pointerCss","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","closeCampaign","Event","appendScriptForCustomEvent","srcdoc","handleMessage","heightAdjust","boxWrapper","bannerWrapper","margin","onUserLogin","handleIframeLoad","contentWindow","postMessage","contentDocument","scrollHeight","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","interstitialWrapper","interstitialOverlay","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","getTotalVisits","visitCount","getLastVisit","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","info","debugPE","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","getTimeElapsed","sessionStart","getPageCount","seqNo","requestTime","RequestManager","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","post","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","_enableWebPush","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","skipDialog","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","getValue","getdefaultValue","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","addValueChangedCallback","removeValueChangedCallback","clearStartFlag","VariableStore","syncVariables","onSyncSuccess","onSyncFailure","meta","tk","r","status","fetchVariables","onFetchCallback","addVariablesChangedCallback","callback","addOneTimeVariablesChangedCallback","removeVariablesChangedCallback","removeOneTimeVariablesChangedCallback","callBack","CleverTap","spa","isSpa","bind","enablePersonalization","_isPersonalisationActive","ReqestManager","privacy","notifications","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","handleDecrementValue","setMultiValuesForKey","addMultiValueForKey","addMultiValuesForKey","removeMultiValueForKey","removeMultiValuesForKey","removeValueForKey","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","sendLocationData","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","elements","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","parentWindow","opener","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","setOffline","arg","defineVariable","tim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AFD,MAEO,IAAI8C,KAAK,CAAC3c,IAAN,CAAW8f,OAAX,KAAuB,SAA3B,EAAsC;EAC3C2R,MAAAA,mBAAmB,CAAC9U,KAAK,CAAC3c,IAAP,EAAa,IAAb,CAAnB;EACD;EACF;EACF;;+CAuGe;EACd,MAAIqP,WAAW,GAAG,0DAAchY,WAAhC;;EACA,MAAI2I,IAAI,GAAG,EAAX;EACAA,EAAAA,IAAI,GAAG,0DAAcqX,qBAAd,CAAoCrX,IAApC,EAA0C7C,SAA1C,CAAP;EACAkS,EAAAA,WAAW,GAAGzD,QAAQ,CAACyD,WAAD,EAAc,MAAd,EAAsBhW,QAAtB,CAAtB;EACAgW,EAAAA,WAAW,GAAGzD,QAAQ,CAACyD,WAAD,EAAc,GAAd,EAAmB3C,YAAY,CAAC7M,IAAI,CAACC,SAAL,CAAeE,IAAf,CAAD,8BAAuB,IAAvB,wBAA/B,CAAtB;;EAEA,4DAAcwX,kBAAd,CAAiCnI,WAAjC,EAA8CpN,GAAG,CAACgC,YAAlD;EACD;;yDAEoB;EACnB,SAAQ,OAAOrC,MAAM,CAACorC,MAAd,KAAyB,WAAzB,IAAwCprC,MAAM,CAACorC,MAAP,CAAcC,IAAd,KAAuB,YAAvE;EACD;;yDAMmBjtC,MAAM;EACxB,MAAI,KAAKomC,wBAAL,EAAJ,EAAqC;EACnCpmC,IAAAA,IAAI,CAAC8+B,KAAL,GAAa,IAAb;EACD;EACF;;QC3xBGpvB,SAAS,GAAG,IAAIw9B,SAAJ,CAActrC,MAAM,CAAC8N,SAArB;EAElB9N,MAAM,CAAC8N,SAAP,GAAmB9N,MAAM,CAAC+N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file diff --git a/clevertap.min.js b/clevertap.min.js index cb563c64..7ed91725 100644 --- a/clevertap.min.js +++ b/clevertap.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).clevertap=t()}(this,(function(){"use strict";var e=0;function t(t){return"__private_"+e+++"_"+t}function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}const o="clevertap-prod.com",n="https:";var s=t("accountId"),r=t("region"),a=t("targetDomain"),l=t("dcSdkversion"),d=t("token");class c{constructor(){let{id:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";Object.defineProperty(this,s,{writable:!0,value:void 0}),Object.defineProperty(this,r,{writable:!0,value:""}),Object.defineProperty(this,a,{writable:!0,value:o}),Object.defineProperty(this,l,{writable:!0,value:""}),Object.defineProperty(this,d,{writable:!0,value:""}),this.id=e,t&&(this.region=t),i&&(this.targetDomain=i),n&&(this.token=n)}get id(){return i(this,s)[s]}set id(e){i(this,s)[s]=e}get region(){return i(this,r)[r]}set region(e){i(this,r)[r]=e}get dcSDKVersion(){return i(this,l)[l]}set dcSDKVersion(e){i(this,l)[l]=e}get targetDomain(){return i(this,a)[a]}set targetDomain(e){i(this,a)[a]=e}get token(){return i(this,d)[d]}set token(e){i(this,d)[d]=e}get finalTargetDomain(){return this.region?"".concat(this.region,".").concat(this.targetDomain):this.targetDomain===o?"".concat("eu1",".").concat(this.targetDomain):this.targetDomain}get dataPostPEURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/defineVars")}get dataPostURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/a?t=96")}get recorderURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/r?r=1")}get emailURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/e?r=1")}}const h=new RegExp("^\\s+|\\.|:|\\$|'|\"|\\\\|\\s+$","g"),u=new RegExp("^\\s+|'|\"|\\\\|\\s+$","g"),p=new RegExp("'","g"),g="clear",v="Charged ID",f="WZRK_CHARGED_ID",b="WZRK_G",m="WZRK_K",y="WZRK_CAMP",w="WZRK_CAMP_G",C="WZRK_EV",k="WZRK_META",x="WZRK_PR",P="WZRK_ARP",I="WZRK_L",S="global",O="optOut",_="useIP",E="WZRK_X",A="push",M=31536e3,L="wzrk_",T="wzrk_id",R="Notification Viewed",j="Notification Clicked",D="WZRK_FPU",B="WZRK_PSD",N="$incr",z="$add",U="$remove",F="$delete",q="WZRK_INBOX_CONFIG",V="WZRK_INBOX",W=1e3,K="wzrk_fetch",H="wiz-iframe",G="wiz-iframe-intent",J="Event",Z="Profile",$=["Stayed","UTM Visited","App Launched","Notification Sent",R,j],Y=e=>"string"==typeof e||e instanceof String,Q=e=>"[object Object]"===Object.prototype.toString.call(e),X=e=>"object"==typeof e&&e instanceof Date,ee=e=>{for(const t in e)if(e.hasOwnProperty(t))return!1;return!0},te=e=>!isNaN(parseFloat(e))&&isFinite(e),ie=e=>/^-?[\d.]+(?:e-?\d+)?$/.test(e)&&"number"==typeof e,oe=e=>null!=e&&"undefined"!==e,ne=(e,t)=>{if("object"!=typeof e){let i;return Y(e)?(i=se(e,u),i.length>1024&&(i=i.substring(0,1024),t.reportError(521,i+"... length exceeded 1024 chars. Trimmed."))):i=e,i}for(const i in e)if(e.hasOwnProperty(i)){const o=ne(e[i],t);let n;n=se(i,h),n.length>1024&&(n=n.substring(0,1024),t.reportError(520,n+"... length exceeded 1024 chars. Trimmed.")),delete e[i],e[n]=o}return e},se=(e,t)=>e.replace(t,""),re=()=>{const e=new Date;return e.getFullYear()+""+e.getMonth()+e.getDay()},ae=()=>Math.floor((new Date).getTime()/1e3),le=e=>"$D_"+Math.round(e.getTime()/1e3),de=e=>{if(ce(e))return"$D_"+e},ce=e=>{const t=/^(\d{4})(\d{2})(\d{2})$/.exec(e);if(null==t)return!1;const i=t[3],o=t[2]-1,n=t[1],s=new Date(n,o,i);return s.getDate()==i&&s.getMonth()==o&&s.getFullYear()==n};class he{static save(e,t){return!(!e||!t)&&(this._isLocalStorageSupported()?(localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),!0):void 0)}static read(e){if(!e)return!1;let t=null;if(this._isLocalStorageSupported()&&(t=localStorage.getItem(e)),null!=t)try{t=JSON.parse(t)}catch(e){}return t}static remove(e){return!!e&&(this._isLocalStorageSupported()?(localStorage.removeItem(e),!0):void 0)}static removeCookie(e,t){let i=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";t&&(i=i+" domain="+t+"; path=/"),document.cookie=i}static createCookie(e,t,i,o){let n="",s="";if(i){const e=new Date;e.setTime(e.getTime()+1e3*i),n="; expires="+e.toGMTString()}o&&(s="; domain="+o),t=encodeURIComponent(t),document.cookie=e+"="+t+n+s+"; path=/"}static readCookie(e){const t=e+"=",i=document.cookie.split(";");for(let e=0;e=0;o--){if(a=0===o?r[o]+a:"."+r[o]+a,this.readCookie(e)){var n="test_"+e+o;if(this.createCookie(n,t,10,a),!this.readCookie(n))continue;this.removeCookie(n,a)}this.createCookie(e,t,i,a);if(this.readCookie(e)==t){s=a,ue.broadDomain=s;break}}}else this.createCookie(e,t,i,s)}else this.createCookie(e,t,i,o)}static getMetaProp(e){const t=this.readFromLSorCookie(k);if(null!=t)return t[e]}static setMetaProp(e,t){if(this._isLocalStorageSupported()){let i=this.readFromLSorCookie(k);null==i&&(i={}),void 0===t?delete i[e]:i[e]=t,this.saveToLSorCookie(k,i)}}static getAndClearMetaProp(e){const t=this.getMetaProp(e);return this.setMetaProp(e,void 0),t}static setInstantDeleteFlagInK(){let e=this.readFromLSorCookie(m);null==e&&(e={}),e.flag=!0,this.saveToLSorCookie(m,e)}static backupEvent(e,t,i){let o=this.readFromLSorCookie(I);void 0===o&&(o={}),o[t]={q:e},this.saveToLSorCookie(I,o),i.debug("stored in ".concat(I," reqNo : ").concat(t," -> ").concat(e))}static removeBackup(e,t){const i=this.readFromLSorCookie(I);null!=i&&void 0!==i[e]&&(t.debug("del event: ".concat(e," data-> ").concat(i[e].q)),delete i[e],this.saveToLSorCookie(I,i))}}const ue={globalCache:{gcookie:null,REQ_N:0,RESP_N:0},LRU_CACHE:null,globalProfileMap:void 0,globalEventsMap:void 0,blockRequest:!1,isOptInRequest:!1,broadDomain:null,webPushEnabled:null,campaignDivMap:{},currentSessionId:null,wiz_counter:0,notifApi:{notifEnabledFromApi:!1},unsubGroups:[],updatedCategoryLong:null,inbox:null,isPrivacyArrPushed:!1,privacyArray:[],offline:!1,location:null,dismissSpamControl:!1,globalUnsubscribe:!0,flutterVersion:null,variableStore:{}};var pe=t("keyOrder"),ge=t("deleteFromObject");class ve{constructor(e){Object.defineProperty(this,ge,{value:fe}),Object.defineProperty(this,pe,{writable:!0,value:void 0}),this.max=e;let t=he.readFromLSorCookie(E);if(t){const e={};i(this,pe)[pe]=[],t=t.cache;for(const o in t)t.hasOwnProperty(o)&&(e[t[o][0]]=t[o][1],i(this,pe)[pe].push(t[o][0]));this.cache=e}else this.cache={},i(this,pe)[pe]=[]}get(e){const t=this.cache[e];return t&&(this.cache=i(this,ge)[ge](e,this.cache),this.cache[e]=t,i(this,pe)[pe].push(e)),this.saveCacheToLS(this.cache),t}set(e,t){const o=this.cache[e],n=i(this,pe)[pe];null!=o?this.cache=i(this,ge)[ge](e,this.cache):n.length===this.max&&(this.cache=i(this,ge)[ge](n[0],this.cache)),this.cache[e]=t,i(this,pe)[pe][i(this,pe)[pe]-1]!==e&&i(this,pe)[pe].push(e),this.saveCacheToLS(this.cache)}saveCacheToLS(e){const t=[],o=i(this,pe)[pe];for(const i in o)if(o.hasOwnProperty(i)){const n=[];n.push(o[i]),n.push(e[o[i]]),t.push(n)}he.saveToLSorCookie(E,{cache:t})}getKey(e){if(null===e)return null;const t=i(this,pe)[pe];for(const i in t)if(t.hasOwnProperty(i)&&this.cache[t[i]]===e)return t[i];return null}getSecondLastKey(){const e=i(this,pe)[pe];return null!=e&&e.length>1?e[e.length-2]:-1}getLastKey(){const e=i(this,pe)[pe].length;if(e)return i(this,pe)[pe][e-1]}}var fe=function(e,t){const o=JSON.parse(JSON.stringify(i(this,pe)[pe])),n={};let s;for(const i in o)o.hasOwnProperty(i)&&(o[i]!==e?n[o[i]]=t[o[i]]:s=i);return o.splice(s,1),i(this,pe)[pe]=JSON.parse(JSON.stringify(o)),n},be=t("logger"),me=t("request"),ye=t("device"),we=t("session");class Ce{constructor(e){let{logger:t,request:o,device:n,session:s}=e;Object.defineProperty(this,be,{writable:!0,value:void 0}),Object.defineProperty(this,me,{writable:!0,value:void 0}),Object.defineProperty(this,ye,{writable:!0,value:void 0}),Object.defineProperty(this,we,{writable:!0,value:void 0}),i(this,be)[be]=t,i(this,me)[me]=o,i(this,ye)[ye]=n,i(this,we)[we]=s}s(e,t,o,n,s){let r=!1,a=!1;if(window.isOULInProgress&&(o||"undefined"!==n&&n===window.oulReqN)&&(window.isOULInProgress=!1,r=!0),void 0===n&&(n=0),he.removeBackup(n,i(this,be)[be]),n>ue.globalCache.REQ_N)return;if(oe(i(this,ye)[ye].gcookie)||e&&(a=!0),!oe(i(this,ye)[ye].gcookie)||o||"boolean"==typeof s){const n=i(this,we)[we].getSessionCookieObject();if(window.isOULInProgress||n.s&&t{if(Q(e)){for(var t in e)if(e.hasOwnProperty(t)){if(Q(e[t])||Array.isArray(e[t]))return!1;X(e[t])&&(e[t]=le(e[t]))}return!0}return!1},Ne=(e,t)=>{if(Q(e)){for(var i in e)if(e.hasOwnProperty(i))if("Items"===i){if(!Array.isArray(e[i]))return!1;for(var o in e[i].length>50&&t.reportError(522,"Charged Items exceed 50 limit. Actual count: "+e[i].length),e[i])if(e[i].hasOwnProperty(o)&&(!Q(e[i][o])||!Be(e[i][o])))return!1}else{if(Q(e[i])||Array.isArray(e[i]))return!1;X(e[i])&&(e[i]=le(e[i]))}if(Y(e[v])||ie(e[v])){const i=e[v]+"";if(void 0===De&&(De=he.readFromLSorCookie(f)),void 0!==De&&De.trim()===i.trim())return t.error("Duplicate charged Id - Dropped"+e),!1;De=i,he.saveToLSorCookie(f,i)}return!0}return!1};var ze=t("logger"),Ue=t("oldValues"),Fe=t("request"),qe=t("isPersonalisationActive"),Ve=t("processEventArray");class We extends Array{constructor(e,t){let{logger:o,request:n,isPersonalisationActive:s}=e;super(),Object.defineProperty(this,Ve,{value:Ke}),Object.defineProperty(this,ze,{writable:!0,value:void 0}),Object.defineProperty(this,Ue,{writable:!0,value:void 0}),Object.defineProperty(this,Fe,{writable:!0,value:void 0}),Object.defineProperty(this,qe,{writable:!0,value:void 0}),i(this,ze)[ze]=o,i(this,Ue)[Ue]=t,i(this,Fe)[Fe]=n,i(this,qe)[qe]=s}push(){for(var e=arguments.length,t=new Array(e),o=0;o0;){var t=e.shift();if(!Y(t)){i(this,ze)[ze].error(Oe);continue}if(t.length>1024&&(t=t.substring(0,1024),i(this,ze)[ze].reportError(510,t+"... length exceeded 1024 chars. Trimmed.")),$.includes(t)){i(this,ze)[ze].reportError(513,t+" is a restricted system event. It cannot be used as an event name.");continue}const o={type:"event"};if(o.evtName=se(t,h),0!==e.length){const n=e.shift();if(Q(n)){if("Charged"===t){if(!Ne(n,i(this,ze)[ze])){i(this,ze)[ze].reportError(511,"Charged event structure invalid. Not sent.");continue}}else if(!Be(n)){i(this,ze)[ze].reportError(512,t+" event structure invalid. Not sent.");continue}o.evtData=n}else e.unshift(n)}i(this,Fe)[Fe].processEvent(o)}};const He=e=>{const t={},i=e.indexOf("?");if(i>1){const o=e.substring(i+1);let n;const s=/\+/g,r=/([^&=]+)=?([^&]*)/g,a=function(e){let t=e.replace(s," ");try{t=decodeURIComponent(t)}catch(e){}return t};for(n=r.exec(o);n;)t[a(n[1])]=a(n[2]),n=r.exec(o)}return t},Ge=(e,t,i)=>e+"&"+t+"="+encodeURIComponent(i),Je=()=>window.location.hostname,Ze=(e,t)=>(t&&"function"==typeof t.debug&&t.debug("dobj:"+e),Ye(e)),$e=(()=>{let e="",t=0;for(t=0;t<=25;t++)e+=String.fromCharCode(t+65);for(t=0;t<=25;t++)e+=String.fromCharCode(t+97);for(t=0;t<10;t++)e+=t;return e+"+/="})(),Ye=e=>{if(null==e)return"";var t,i,o,n,s,r,a,l="",d=0;for(e=(e=>{if(null==e)return"";let t,i,o,n={},s={},r="",a="",l="",d=2,c=3,h=2,u="",p=0,g=0,v=String.fromCharCode;for(o=0;o>=1}else{for(i=1,t=0;t>=1}d--,0==d&&(d=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;d--,0==d&&(d=Math.pow(2,h),h++),n[a]=c++,l=String(r)}if(""!==l){if(Object.prototype.hasOwnProperty.call(s,l)){if(l.charCodeAt(0)<256){for(t=0;t>=1}else{for(i=1,t=0;t>=1}d--,0==d&&(d=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;d--,0==d&&(d=Math.pow(2,h),h++)}for(i=2,t=0;t>=1;for(;;){if(p<<=1,15==g){u+=v(p);break}g++}return u})(e);d<2*e.length;)d%2==0?(t=e.charCodeAt(d/2)>>8,i=255&e.charCodeAt(d/2),o=d/2+1>8:NaN):(t=255&e.charCodeAt((d-1)/2),(d+1)/2>8,o=255&e.charCodeAt((d+1)/2)):i=o=NaN),d+=3,n=t>>2,s=(3&t)<<4|i>>4,r=(15&i)<<2|o>>6,a=63&o,isNaN(i)?r=a=64:isNaN(o)&&(a=64),l=l+$e.charAt(n)+$e.charAt(s)+$e.charAt(r)+$e.charAt(a);return l};var Qe=t("fireRequest"),Xe=t("dropRequestDueToOptOut"),et=t("addUseIPToRequest"),tt=t("addARPToRequest");class it{constructor(){this.networkRetryCount=0,this.minDelayFrequency=0}static fireRequest(e,t,o,n){i(this,Qe)[Qe](e,1,t,o,n)}getDelayFrequency(){if(this.logger.debug("Network retry #"+this.networkRetryCount),this.networkRetryCount<10)return this.logger.debug(this.account.id,"Failure count is "+this.networkRetryCount+". Setting delay frequency to 1s"),this.minDelayFrequency=W,this.minDelayFrequency;if(null==this.account.region)return this.logger.debug(this.account.id,"Setting delay frequency to 1s"),W;{const e=1e3*(Math.floor(10*Math.random())+1);return this.minDelayFrequency+=e,this.minDelayFrequency<6e5?(this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency):(this.minDelayFrequency=W,this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency)}}}it.logger=void 0,it.device=void 0,it.account=void 0,Object.defineProperty(it,Qe,{value:function(e,t,o,n,s){var r,a;if(i(this,Xe)[Xe]())return void this.logger.debug("req dropped due to optout cookie: "+this.device.gcookie);if(oe(this.device.gcookie)||(ue.blockRequest=!0),s&&s===K)!oe(this.device.gcookie)&&ue.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(this.networkRetryCount)),i(this,Qe)[Qe](e,void 0,o,n)}),this.getDelayFrequency());else if(!oe(this.device.gcookie)&&ue.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(t)),i(this,Qe)[Qe](e,t+1,o,n)}),50);if(n?window.isOULInProgress=!0:(oe(this.device.gcookie)&&(e=Ge(e,"gc",this.device.gcookie)),e=i(this,tt)[tt](e,o)),e=Ge(e,"tries",t),e=i(this,et)[et](e),e=Ge(e,"r",(new Date).getTime()),(null===(r=window.clevertap)||void 0===r?void 0:r.hasOwnProperty("plugin"))||(null===(a=window.wizrocket)||void 0===a?void 0:a.hasOwnProperty("plugin"))){const t=window.clevertap.plugin||window.wizrocket.plugin;e=Ge(e,"ct_pl",t)}-1!==e.indexOf("chrome-extension:")&&(e=e.replace("chrome-extension:","https:"));for(var l=document.getElementsByClassName("ct-jp-cb");l[0]&&l[0].parentNode;)l[0].parentNode.removeChild(l[0]);const d=document.createElement("script");d.setAttribute("type","text/javascript"),d.setAttribute("src",e),d.setAttribute("class","ct-jp-cb"),d.setAttribute("rel","nofollow"),d.async=!0,document.getElementsByTagName("head")[0].appendChild(d),this.logger.debug("req snt -> url: "+e)}}),Object.defineProperty(it,Xe,{value:function(){return!ue.isOptInRequest&&oe(this.device.gcookie)&&Y(this.device.gcookie)?":OO"===this.device.gcookie.slice(-3):(ue.isOptInRequest=!1,!1)}}),Object.defineProperty(it,et,{value:function(e){var t=he.getMetaProp(_);return"boolean"!=typeof t&&(t=!1),Ge(e,_,t?"true":"false")}}),Object.defineProperty(it,tt,{value:function(e,t){if(!0===t){const t={skipResARP:!0};return Ge(e,"arp",Ze(JSON.stringify(t),this.logger))}return he._isLocalStorageSupported()&&void 0!==localStorage.getItem(P)&&null!==localStorage.getItem(P)?Ge(e,"arp",Ze(JSON.stringify(he.readFromLSorCookie(P)),this.logger)):e}});const ot=()=>{let e={};if(he._isLocalStorageSupported()){let t=he.read(y);null!=t?(t=JSON.parse(decodeURIComponent(t).replace(p,'"')),t.hasOwnProperty("global")?e.wp=t:e=t):e={}}return e},nt=e=>{if(he._isLocalStorageSupported()){const t={...ot(),...e},i=JSON.stringify(t);he.save(y,encodeURIComponent(i)),st()}},st=()=>{if(he._isLocalStorageSupported()){let i=he.read(b);if(oe(i))try{i=JSON.parse(decodeURIComponent(he.read(b)));const o=he.read(w)?JSON.parse(decodeURIComponent(he.read(w))):{};if(i&&he._isLocalStorageSupported()){var e={},t=ot();Object.keys(t).forEach((n=>{const s=i in o&&Object.keys(o[i]).length&&o[i][n]?o[i][n]:{},r=t[n].global,a=re(),l=t[n][a];if(void 0!==r){const e=Object.keys(r);for(const t in e){let i=[];if(e.hasOwnProperty(t)){let o=0,n=0;const a=e[t];if("tc"===a)continue;void 0!==l&&void 0!==l[a]&&(o=l[a]),void 0!==r&&void 0!==r[a]&&(n=r[a]),i=[a,o,n],s[a]=i}}}e={...e,[n]:s}})),o[i]=e,he.save(w,encodeURIComponent(JSON.stringify(o)))}}catch(e){console.error("Invalid clevertap Id "+e)}}},rt=()=>{const e=JSON.parse(decodeURIComponent(he.read(b)));let t={};if(he._isLocalStorageSupported()){let i={};t=ot();const o=he.read(w),n=o?decodeURIComponent(o):null,s=n?JSON.parse(n):null,r=e&&null!=o&&s&&s[e]&&s[e].wp?Object.values(s[e].wp):[],a=e&&null!=o&&s&&s[e]&&s[e].wi?Object.values(s[e].wi):[],l=re();let d=0,c=0;return t.wp&&t.wp[l]&&"undefined"!==t.wp[l].tc&&(d=t.wp[l].tc),t.wi&&t.wi[l]&&"undefined"!==t.wi[l].tc&&(c=t.wi[l].tc),i={wmp:d,wimp:c,tlc:r,witlc:a},i}},at=(e,t)=>{let{logger:i}=t,o=!1;if(Q(e))for(const t in e)if(e.hasOwnProperty(t)){o=!0;let n=e[t];if(null==n){delete e[t];continue}"Gender"!==t||n.match(/^M$|^F$/)||(o=!1,i.error(_e)),"Employed"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Ee)),"Married"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Ae)),"Education"!==t||n.match(/^School$|^College$|^Graduate$/)||(o=!1,i.error(Me)),"Age"===t&&null!=n&&(te(n)?e.Age=+n:(o=!1,i.error(Le))),"DOB"===t?(/^\$D_/.test(n)&&11===(n+"").length||X(n)||(o=!1,i.error(Te)),X(n)&&(e[t]=le(n))):X(n)&&(e[t]=le(n)),"Phone"!==t||ee(n)||(n.length>8&&"+"===n.charAt(0)?(n=n.substring(1,n.length),te(n)?e.Phone=+n:(o=!1,i.error(je+". Removed."))):(o=!1,i.error(je+". Removed."))),o||delete e[t]}return o},lt=e=>{const t={};t.Name=e.name,null!=e.id&&(t.FBID=e.id+""),"male"===e.gender?t.Gender="M":"female"===e.gender?t.Gender="F":t.Gender="O";null!=e.relationship_status&&(t.Married="N","Married"===e.relationship_status&&(t.Married="Y"));const i=function(e){if(null!=e){let t="",i="";for(let o=0;o0?"Y":"N",null!=e.email&&(t.Email=e.email),null!=e.birthday){const i=e.birthday.split("/");t.DOB=de(i[2]+i[0]+i[1])}return t},dt=(e,t)=>{let{logger:i}=t;const o={};if(null!=e.displayName&&(o.Name=e.displayName),null!=e.id&&(o.GPID=e.id+""),null!=e.gender&&("male"===e.gender?o.Gender="M":"female"===e.gender?o.Gender="F":"other"===e.gender&&(o.Gender="O")),null!=e.image&&!1===e.image.isDefault&&(o.Photo=e.image.url.split("?sz")[0]),null!=e.emails)for(let t=0;t{if(he._isLocalStorageSupported()){if(null==ue.globalProfileMap&&(ue.globalProfileMap=he.readFromLSorCookie(x),null==ue.globalProfileMap&&(ue.globalProfileMap={})),null!=e._custom){const t=e._custom;for(const i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);delete e._custom}for(const i in e)if(e.hasOwnProperty(i)){if(ue.globalProfileMap.hasOwnProperty(i)&&!t)continue;ue.globalProfileMap[i]=e[i]}null!=ue.globalProfileMap._custom&&delete ue.globalProfileMap._custom,he.saveToLSorCookie(x,ue.globalProfileMap)}},ht=(e,t,i)=>{if(null!=e&&"-1"!==e&&he._isLocalStorageSupported()){const t=ot();let o=t.wp[i];null==o&&(o={},t[i]=o),o[e]="dnd",nt(t)}if(null!=ue.campaignDivMap){const t=ue.campaignDivMap[e];null!=t&&(document.getElementById(t).style.display="none","intentPreview"===t&&null!=document.getElementById("intentOpacityDiv")&&(document.getElementById("intentOpacityDiv").style.display="none"))}};var ut=t("logger"),pt=t("request"),gt=t("account"),vt=t("oldValues"),ft=t("isPersonalisationActive"),bt=t("processProfileArray");class mt extends Array{constructor(e,t){let{logger:o,request:n,account:s,isPersonalisationActive:r}=e;super(),Object.defineProperty(this,bt,{value:yt}),Object.defineProperty(this,ut,{writable:!0,value:void 0}),Object.defineProperty(this,pt,{writable:!0,value:void 0}),Object.defineProperty(this,gt,{writable:!0,value:void 0}),Object.defineProperty(this,vt,{writable:!0,value:void 0}),Object.defineProperty(this,ft,{writable:!0,value:void 0}),i(this,ut)[ut]=o,i(this,pt)[pt]=n,i(this,gt)[gt]=s,i(this,vt)[vt]=t,i(this,ft)[ft]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o0)for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];let n,s={};if(null!=o.Site){if(n=o.Site,ee(n)||!at(n,{logger:i(this,ut)[ut]}))return}else if(null!=o.Facebook){const e=o.Facebook;ee(e)||e.error||(n=lt(e))}else if(null!=o["Google Plus"]){const e=o["Google Plus"];ee(e)||e.error||(n=dt(e,{logger:i(this,ut)[ut]}))}if(null!=n&&!ee(n)){s.type="profile",null==n.tz&&(n.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),s.profile=n,ct(n,!0),s=i(this,pt)[pt].addSystemDataToObject(s,void 0),i(this,pt)[pt].addFlags(s);const e=Ze(JSON.stringify(s),i(this,ut)[ut]);let t=i(this,gt)[gt].dataPostURL;t=Ge(t,"type",A),t=Ge(t,"d",e),i(this,pt)[pt].saveAndFireRequest(t,ue.blockRequest)}}},wt=t("request"),Ct=t("logger"),kt=t("account"),xt=t("session"),Pt=t("oldValues"),It=t("device"),St=t("processOUL"),Ot=t("handleCookieFromCache"),_t=t("deleteUser"),Et=t("processLoginArray");class At extends Array{constructor(e,t){let{request:o,account:n,session:s,logger:r,device:a}=e;super(),Object.defineProperty(this,Et,{value:Rt}),Object.defineProperty(this,_t,{value:Tt}),Object.defineProperty(this,Ot,{value:Lt}),Object.defineProperty(this,St,{value:Mt}),Object.defineProperty(this,wt,{writable:!0,value:void 0}),Object.defineProperty(this,Ct,{writable:!0,value:void 0}),Object.defineProperty(this,kt,{writable:!0,value:void 0}),Object.defineProperty(this,xt,{writable:!0,value:void 0}),Object.defineProperty(this,Pt,{writable:!0,value:void 0}),Object.defineProperty(this,It,{writable:!0,value:void 0}),i(this,wt)[wt]=o,i(this,kt)[kt]=n,i(this,xt)[xt]=s,i(this,Ct)[Ct]=r,i(this,Pt)[Pt]=t,i(this,It)[It]=a}clear(){i(this,Ct)[Ct].debug("clear called. Reset flag has been set."),i(this,_t)[_t](),he.setMetaProp(g,!0)}push(){for(var e=arguments.length,t=new Array(e),o=0;o{let o=he.readFromLSorCookie(m);const n=he.readFromLSorCookie(b);let s;if(null==o)o={},s=e;else{s=o.id;let r=!1,a=!1;if(null==s&&(s=e[0],r=!0),null==ue.LRU_CACHE&&he._isLocalStorageSupported()&&(ue.LRU_CACHE=new ve(100)),r)null!=n&&(ue.LRU_CACHE.set(s,n),ue.blockRequest=!1);else for(const t in e)if(e.hasOwnProperty(t)){const i=e[t];if(ue.LRU_CACHE.cache[i]){s=i,a=!0;break}}if(a){s!==ue.LRU_CACHE.getLastKey()?i(this,Ot)[Ot]():(t=!1,he.saveToLSorCookie(D,t));const e=ue.LRU_CACHE.get(s);ue.LRU_CACHE.set(s,e),he.saveToLSorCookie(b,e),i(this,It)[It].gcookie=e;const o=ue.LRU_CACHE.getSecondLastKey();if(he.readFromLSorCookie(D)&&-1!==o){const e=ue.LRU_CACHE.cache[o];i(this,wt)[wt].unregisterTokenForGuid(e)}}else r?null!=n&&(i(this,It)[It].gcookie=n,he.saveToLSorCookie(b,n),t=!1):this.clear(),he.saveToLSorCookie(D,!1),s=e[0]}o.id=s,he.saveToLSorCookie(m,o)};if(Array.isArray(e)&&e.length>0)for(const n in e)if(e.hasOwnProperty(n)){const s=e[n];let r,a={};if(null!=s.Site){if(r=s.Site,ee(r)||!at(r,{logger:i(this,Ct)[Ct]}))return}else if(null!=s.Facebook){const e=s.Facebook;ee(e)||e.error||(r=lt(e))}else if(null!=s["Google Plus"]){const e=s["Google Plus"];ee(e)&&!e.error&&(r=dt(e,{logger:i(this,Ct)[Ct]}))}if(null!=r&&!ee(r)){a.type="profile",null==r.tz&&(r.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),a.profile=r;const e=[];he._isLocalStorageSupported()&&(r.Identity&&e.push(r.Identity),r.Email&&e.push(r.Email),r.GPID&&e.push("GP:"+r.GPID),r.FBID&&e.push("FB:"+r.FBID),e.length>0&&o(e)),ct(r,!0),a=i(this,wt)[wt].addSystemDataToObject(a,void 0),i(this,wt)[wt].addFlags(a),t&&(a.isOUL=!0);const n=Ze(JSON.stringify(a),i(this,Ct)[Ct]);let s=i(this,kt)[kt].dataPostURL;s=Ge(s,"type",A),s=Ge(s,"d",n),i(this,wt)[wt].saveAndFireRequest(s,ue.blockRequest,t)}}},Lt=function(){ue.blockRequest=!1,console.debug("Block request is false"),he._isLocalStorageSupported()&&(delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),he.removeCookie(y,Je()),he.removeCookie(i(this,xt)[xt].cookieName,ue.broadDomain),he.removeCookie(P,ue.broadDomain),i(this,xt)[xt].setSessionCookieObject("")},Tt=function(){ue.blockRequest=!0,i(this,Ct)[Ct].debug("Block request is true"),ue.globalCache={gcookie:null,REQ_N:0,RESP_N:0},he._isLocalStorageSupported()&&(delete localStorage.WZRK_G,delete localStorage.WZRK_K,delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),he.removeCookie(b,ue.broadDomain),he.removeCookie(y,Je()),he.removeCookie(m,Je()),he.removeCookie(i(this,xt)[xt].cookieName,ue.broadDomain),he.removeCookie(P,ue.broadDomain),i(this,It)[It].gcookie=null,i(this,xt)[xt].setSessionCookieObject("")},Rt=function(e){if(Array.isArray(e)&&e.length>0){const t=e.pop();if(null!=t&&Q(t)&&(null!=t.Site&&Object.keys(t.Site).length>0||null!=t.Facebook&&Object.keys(t.Facebook).length>0||null!=t["Google Plus"]&&Object.keys(t["Google Plus"]).length>0)){he.setInstantDeleteFlagInK();try{i(this,St)[St]([t])}catch(e){i(this,Ct)[Ct].debug(e)}}else i(this,Ct)[Ct].error("Profile object is in incorrect format")}};class jt extends HTMLElement{constructor(){super(),this._details=null,this.shadow=null,this.shadow=this.attachShadow({mode:"open"})}get details(){return this._details||""}set details(e){null===this._details&&(this._details=e,this.renderBanner())}renderBanner(){this.shadow.innerHTML=this.getBannerContent(),!1!==this.trackClick&&this.addEventListener("click",(()=>{const e=this.details.onClick;e&&(this.details.window?window.open(e,"_blank"):window.parent.location.href=e),window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId})}getBannerContent(){return'\n \n \n ")}}class Dt extends HTMLElement{constructor(){super(),this._target=null,this._carousel=null,this.shadow=null,this.slides=0,this.previouslySelectedItem=-1,this.selectedItem=1,this.autoSlide=null,this.stopAutoSlideTimeout=null,this.shadow=this.attachShadow({mode:"open"}),void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",jt)}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderCarousel())}get details(){return this.target.display.details}get display(){return this.target.display}renderCarousel(){this.slides=this.details.length,this.shadow.innerHTML=this.getStyles();const e=this.getCarouselContent();this.display.showNavBtns&&e.insertAdjacentHTML("beforeend",this.display.navBtnsHtml),this.display.showNavArrows&&(e.insertAdjacentHTML("beforeend",this.display.leftNavArrowHtml),e.insertAdjacentHTML("beforeend",this.display.rightNavArrowHtml)),this._carousel=e,this.shadow.appendChild(e),this.setupClick(),this.updateSelectedItem(),this.startAutoSlide(),this.setupOnHover(),window.clevertap.renderNotificationViewed({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot})}setupClick(){this._carousel.addEventListener("click",(e=>{const t=e.target.id;if(t.startsWith("carousel__button")){const e=+t.split("-")[1];e!==this.selectedItem&&(this.previouslySelectedItem=this.selectedItem,this.selectedItem=e,this.updateSelectedItem(),this.startAutoSlide())}else if(t.startsWith("carousel__arrow"))t.endsWith("right")?this.goToNext():this.goToPrev(),this.startAutoSlide();else if(t.indexOf("-")>-1){const e=+t.split("-")[1],i=e-1;window.parent.clevertap&&window.clevertap.renderNotificationClicked({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot,wzrk_slideNo:e});const o=this.details[i].onClick;""!==o&&(this.details[i].window?window.open(o,"_blank"):window.location.href=o)}}))}setupOnHover(){this._carousel.addEventListener("mouseenter",(e=>{this.stopAutoSlideTimeout=setTimeout((()=>{this.autoSlide=clearInterval(this.autoSlide)}),500)})),this._carousel.addEventListener("mouseleave",(e=>{clearTimeout(this.stopAutoSlideTimeout),void 0===this.autoSlide&&this.startAutoSlide()}))}getCarouselContent(){const e=document.createElement("div");return e.setAttribute("class","carousel"),this.details.forEach(((t,i)=>{const o=document.createElement("ct-web-personalisation-banner");o.classList.add("carousel__item"),o.trackClick=!1,o.setAttribute("id","carousel__item-".concat(i+1)),o.details=t,e.appendChild(o)})),e}getStyles(){var e,t;return"\n \n ")}updateSelectedItem(){if(-1!==this.previouslySelectedItem){const e=this.shadow.getElementById("carousel__item-".concat(this.previouslySelectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.previouslySelectedItem));e.classList.remove("carousel__item--selected"),t&&t.classList.remove("carousel__button--selected")}const e=this.shadow.getElementById("carousel__item-".concat(this.selectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.selectedItem));e.classList.add("carousel__item--selected"),t&&t.classList.add("carousel__button--selected")}startAutoSlide(){clearInterval(this.autoSlide),this.autoSlide=setInterval((()=>{this.goToNext()}),this.display.sliderTime?1e3*this.display.sliderTime:3e3)}goToNext(){this.goTo(this.selectedItem,(this.selectedItem+1)%this.slides)}goToPrev(){this.goTo(this.selectedItem,this.selectedItem-1)}goTo(e,t){this.previouslySelectedItem=e,this.selectedItem=t,0===t&&(this.selectedItem=this.slides),this.updateSelectedItem()}}class Bt extends HTMLElement{constructor(){super(),this._target=null,this._session=null,this.shadow=null,this.popup=null,this.container=null,this.resizeObserver=null,this.shadow=this.attachShadow({mode:"open"})}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderImageOnlyPopup())}get session(){return this._session||""}set session(e){this._session=e}get msgId(){return this.target.wzrk_id}get pivotId(){return this.target.wzrk_pivot}get onClickUrl(){return this.target.display.onClickUrl}renderImageOnlyPopup(){const e=this.target.wzrk_id.split("_")[0],t=this.session.sessionId;this.shadow.innerHTML=this.getImageOnlyPopupContent(),this.popup=this.shadowRoot.getElementById("imageOnlyPopup"),this.container=this.shadowRoot.getElementById("container"),this.closeIcon=this.shadowRoot.getElementById("close"),this.popup.addEventListener("load",this.updateImageAndContainerWidth()),this.resizeObserver=new ResizeObserver((()=>this.handleResize(this.popup,this.container))),this.resizeObserver.observe(this.popup),this.closeIcon.addEventListener("click",(()=>{if(this.resizeObserver.unobserve(this.popup),document.getElementById("wzrkImageOnlyDiv").style.display="none",this.remove(),null!=e&&"-1"!==e&&he._isLocalStorageSupported()){const i=ot();let o=i.wp[t];null==o&&(o={},i[t]=o),o[e]="dnd",nt(i)}})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId}),this.onClickUrl&&this.popup.addEventListener("click",(()=>{this.target.display.window?window.open(this.onClickUrl,"_blank"):window.parent.location.href=this.onClickUrl,window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})}))}handleResize(e,t){const i=this.getRenderedImageWidth(e);t.style.setProperty("width","".concat(i,"px"))}getImageOnlyPopupContent(){return"\n ".concat(this.target.msgContent.css,"\n ").concat(this.target.msgContent.html,"\n ")}updateImageAndContainerWidth(){return()=>{const e=this.getRenderedImageWidth(this.popup);this.popup.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("height","auto"),this.container.style.setProperty("position","fixed"),this.popup.style.setProperty("visibility","visible"),this.closeIcon.style.setProperty("visibility","visible"),document.getElementById("wzrkImageOnlyDiv").style.visibility="visible"}}getRenderedImageWidth(e){const t=e.naturalWidth/e.naturalHeight;return e.height*t}}class Nt extends HTMLElement{constructor(e,t){super(),this.wrapper=null,this.snackBar=null,this.shadow=this.attachShadow({mode:"open"}),this.config=e,this.message=t,this.renderMessage(t)}get pivotId(){return this.message.wzrk_pivot}get campaignId(){return this.message.wzrk_id}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}renderMessage(e){switch(this.wrapper=this.createEl("div","messageWrapper"),e.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":{const t=this.prepareBasicMessage(e.msg[0]);this.wrapper.appendChild(t)}}const t=this.createEl("div","timeStamp");if(t.innerHTML="".concat(Jt(e.id.split("_")[1]),""),!e.viewed){const e=this.createEl("span","unreadMarker");t.appendChild(e)}this.wrapper.appendChild(t),this.shadow.appendChild(this.wrapper)}prepareBasicMessage(e){const t=this.createEl("div","message");if(e.imageUrl){const i=this.addImage(e.imageUrl,"mainImg");t.appendChild(i)}const i=this.createEl("div","iconTitleDescWrapper");if(e.iconUrl){const t=this.addImage(e.iconUrl,"iconImg");i.appendChild(t)}const o=this.createEl("div","titleDescWrapper");if(e.title){const t=this.createEl("div","title");t.innerText=e.title,o.appendChild(t)}if(e.description){const t=this.createEl("div","description");t.innerText=e.description,o.appendChild(t)}if((e.title||e.description)&&i.appendChild(o),(e.iconUrl||e.title||e.description)&&t.appendChild(i),e.buttons&&e.buttons.length){const i=this.addButtons(e.buttons);t.appendChild(i)}return t}addButtons(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.createEl("div","buttonsContainer");let i=!1;return e.forEach(((e,o)=>{const n=this.createEl("button","button-".concat(o),"button");n.innerText=e.text,o>0&&(n.style.cssText+="margin-left: 2px;"),"copy"===e.action&&(i=!0),t.appendChild(n)})),i&&this.addSnackbar(t),t}addSnackbar(e){this.snackBar=this.createEl("div","snackbar-".concat(this.campaignId),"snackbar"),this.snackBar.innerHTML=Yt;const t=this.createEl("span","snackbar-msg-".concat(this.campaignId),"snackbar-msg");t.innerText="Copied to clipboard",this.snackBar.appendChild(t),e.appendChild(this.snackBar)}addImage(e,t){const i=this.createEl("div","".concat(t,"Container")),o=this.createEl("img",t);return o.setAttribute("src",e),o.setAttribute("loading","lazy"),i.appendChild(o),i}raiseClickedEvent(e,t){switch(this.message.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":this.raiseClickedForBasicTemplates(e,t)}}raiseClickedForBasicTemplates(e,t){const i=this.message.msg[0],o={msgId:this.campaignId,pivotId:this.pivotId};if("BUTTON"===e.tagName){const t=e.id.split("-")[1],n=i.buttons[t];o.kv={wzrk_c2a:n.text},"url"===n.action?n.openUrlInNewTab?window.open(n.url,"_blank"):window.location=n.url:"copy"===n.action&&(window.focus(),navigator.clipboard.writeText(n.clipboardText),this.snackBar.style.setProperty("display","flex","important"),setTimeout((()=>{this.snackBar.style.setProperty("display","none","important")}),2e3))}else"CT-INBOX-MESSAGE"===e.tagName&&i.onClickUrl&&(i.openUrlInNewTab?window.open(i.onClickUrl,"_blank"):window.location=i.onClickUrl);t?console.log("Notifiction clicked event will be raised at run time with payload ::",o):window.clevertap.renderNotificationClicked(o)}}class zt extends HTMLElement{constructor(e){super(),this.isInboxOpen=!1,this.isInboxFromFlutter=!1,this.selectedCategory=null,this.unviewedMessages={},this.unviewedCounter=0,this.isPreview=!1,this.inboxConfigForPreview={},this.inboxSelector=null,this.inbox=null,this.emptyInboxMsg=null,this.inboxCard=null,this.unviewedBadge=null,this.observer=null,this.selectedCategoryRef=null,this.addClickListenerOnDocument=(()=>e=>{if(e.composedPath().includes(this.inbox)){const t=e.path||e.composedPath&&e.composedPath();if(t.length){const e=t[0].id;if("closeInbox"===e)this.toggleInbox();else if(e.startsWith("category-"))this.prevCategoryRef=this.selectedCategoryRef,this.selectedCategoryRef=t[0],this.updateActiveCategory(t[0].innerText);else{const e=t.filter((e=>{var t;return(null===(t=e.id)||void 0===t?void 0:t.startsWith("button-"))||"CT-INBOX-MESSAGE"===e.tagName}));if(e.length){e[e.length-1].raiseClickedEvent(e[0],this.isPreview)}}}}else(this.inboxSelector.contains(e.target)||this.isInboxOpen)&&(this.isInboxFromFlutter?this.isInboxFromFlutter=!1:this.toggleInbox(e))})(),this.setBadgeStyle=e=>{null!==this.unviewedBadge&&(this.unviewedBadge.innerText=e>9?"9+":e,this.unviewedBadge.style.display=e>0?"flex":"none")},this.logger=e,this.shadow=this.attachShadow({mode:"open"})}get incomingMessages(){return[]}set incomingMessages(e){void 0===e&&(e=[]),e.length>0&&this.inbox&&this.updateInboxMessages(e)}get incomingMessagesForPreview(){return[]}set incomingMessagesForPreview(e){void 0===e&&(e=[]);const t={};e.length>0&&this.inbox&&(this.isPreview=!0,this.unviewedCounter=0,e.forEach((e=>{const i="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=i,t[i]=e,this.unviewedMessages[i]=e,this.unviewedCounter++})),this.buildUIForMessages(t),this.updateUnviewedBadgeCounter())}connectedCallback(){this.init()}init(){this.config=this.isPreview?this.inboxConfigForPreview:he.readFromLSorCookie(q)||{},0!==Object.keys(this.config).length&&(this.inboxSelector=document.getElementById(this.config.inboxSelector),null!==this.inboxSelector&&(this.config.styles.notificationsBadge?this.addUnviewedBadge():this.unviewedBadge&&this.unviewedBadge.remove(),this.createinbox(),document.removeEventListener("click",this.addClickListenerOnDocument),document.addEventListener("click",this.addClickListenerOnDocument),this.config.categories.length&&this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadow.innerHTML=this.getInboxStyles(),this.shadow.appendChild(this.inbox)))}addMsgsToInboxFromLS(){const e=this.deleteExpiredAndGetUnexpiredMsgs(!1),t=e?Object.keys(e):[];0!==t.length&&(t.forEach((t=>{e[t].viewed||(this.unviewedMessages[t]=e[t],this.unviewedCounter++)})),this.buildUIForMessages(e),this.updateUnviewedBadgeCounter())}deleteExpiredAndGetUnexpiredMsgs(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Vt();const i=Math.floor(Date.now()/1e3);for(const o in t)if(t[o].wzrk_ttl&&t[o].wzrk_ttl>0&&t[o].wzrk_ttl0&&(t=Object.values(t).sort(((e,t)=>t.date-e.date)).reduce(((e,t)=>(e[t.id]=t,e)),{})),Wt(t),t}updateInboxMessages(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.deleteExpiredAndGetUnexpiredMsgs(),i=Date.now(),o={};e.forEach(((e,n)=>{const s="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=s,e.date=i-n,e.viewed=0,t[s]=e,o[s]=e,this.unviewedMessages[s]=e,this.unviewedCounter++})),Wt(t),this.buildUIForMessages(o),this.updateUnviewedBadgeCounter()}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}addUnviewedBadge(){this.unviewedBadge||(this.unviewedBadge=this.createEl("div","unviewedBadge"),this.unviewedBadge.style.cssText="display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ".concat(this.config.styles.notificationsBadge.backgroundColor,"; font-size: 12px; color: ").concat(this.config.styles.notificationsBadge.textColor,"; font-weight: bold; align-items: center; justify-content: center;"),document.body.appendChild(this.unviewedBadge)),this.updateUnviewedBadgePosition(),window.addEventListener("resize",(()=>{this.updateUnviewedBadgePosition()}))}updateUnviewedBadgePosition(){const{top:e,right:t}=this.inboxSelector.getBoundingClientRect();this.unviewedBadge.style.top="".concat(e-8,"px"),this.unviewedBadge.style.left="".concat(t-8,"px")}createinbox(){this.inbox=this.createEl("div","inbox");const e=this.createEl("div","header"),t=this.createEl("div","headerTitle");t.innerText=this.config.title;const i=this.createEl("div","closeInbox");if(i.innerHTML="×",e.appendChild(t),e.appendChild(i),this.inbox.appendChild(e),this.config.categories.length){const e=this.createCategories();this.inbox.appendChild(e)}this.inboxCard=this.createEl("div","inboxCard"),this.inbox.appendChild(this.inboxCard),this.emptyInboxMsg=this.createEl("div","emptyInboxMsg"),this.emptyInboxMsg.innerText="All messages will be displayed here.",this.inboxCard.appendChild(this.emptyInboxMsg);const o={root:this.inboxCard,rootMargin:"0px",threshold:.5};this.observer=new IntersectionObserver(((e,t)=>{this.handleMessageViewed(e)}),o),this.addMsgsToInboxFromLS()}createCategories(){const e=this.createEl("div","categoriesContainer"),t=this.createEl("div","leftArrow");t.innerHTML=$t,t.children[0].style="transform: rotate(180deg)",t.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(-70,0)})),e.appendChild(t);const i=this.createEl("div","categoriesWrapper");["All",...this.config.categories].forEach(((e,t)=>{const o=this.createEl("div","category-".concat(t),"category");o.innerText=e,0===t&&(this.selectedCategoryRef=o),i.appendChild(o)})),e.appendChild(i);const o=this.createEl("div","rightArrow");o.innerHTML=$t,o.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(70,0)})),e.appendChild(o);const n={root:e,threshold:.9},s=i.children[0],r=i.children[this.config.categories.length];new IntersectionObserver((e=>{this.categoryObserverCb(t,e[0].intersectionRatio>=.9)}),n).observe(s);return new IntersectionObserver((e=>{this.categoryObserverCb(o,e[0].intersectionRatio>=.9)}),n).observe(r),e}categoryObserverCb(e,t){e&&(e.style.display=t?"none":"flex")}updateActiveCategory(e){this.selectedCategory=e,this.inboxCard.scrollTop=0;let t=0;this.prevCategoryRef&&this.prevCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef.setAttribute("selected","true"),this.inboxCard.childNodes.forEach((e=>{"emptyInboxMsg"!==e.getAttribute("id")&&(e.style.display="All"===this.selectedCategory||e.getAttribute("category")===this.selectedCategory?"block":"none","block"===e.style.display&&t++)})),0===t?(this.emptyInboxMsg.innerText="".concat(e," messages will be displayed here."),this.emptyInboxMsg.style.display="block"):this.emptyInboxMsg.style.display="none"}buildUIForMessages(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!this.isPreview&&this.updateTSForRenderedMsgs(),this.inboxCard.scrollTop=0;const i=null!==(e=this.config.maxMsgsInInbox)&&void 0!==e?e:15,o=this.inboxCard.firstChild,n=Object.values(t).sort(((e,t)=>t.date-e.date)).map((e=>e.id));for(const e of n){const i=new Nt(this.config,t[e]);i.setAttribute("id",t[e].id),i.setAttribute("pivot",t[e].wzrk_pivot),i.setAttribute("part","ct-inbox-message"),this.config.categories.length>0?(i.setAttribute("category",t[e].tags[0]||""),i.style.display="All"===this.selectedCategory||t[e].category===this.selectedCategory?"block":"none"):i.style.display="block",this.inboxCard.insertBefore(i,o),this.observer.observe(i)}let s=this.inboxCard.querySelectorAll("ct-inbox-message").length;for(;s>i;){const e=this.inboxCard.querySelectorAll("ct-inbox-message");e.length>0&&e[e.length-1].remove(),s--}const r=this.inboxCard.querySelectorAll('ct-inbox-message[style*="display: block"]').length;this.emptyInboxMsg.style.display=r?"none":"block"}handleMessageViewed(e){const t=!this.isPreview;this.isInboxOpen&&e.forEach((e=>{e.isIntersecting&&this.unviewedMessages.hasOwnProperty(e.target.id)&&0===e.target.message.viewed&&(e.target.message.viewed=1,t?(window.clevertap.renderNotificationViewed({msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.updateMessageInLS(e.target.id,{...e.target.message,viewed:1}),setTimeout((()=>{e.target.shadowRoot.getElementById("unreadMarker").style.display="none"}),1e3)):console.log("Notifiction viewed event will be raised at run time with payload ::",{msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.unviewedCounter--,this.updateUnviewedBadgeCounter(),delete this.unviewedMessages[e.target.id])}))}updateMessageInLS(e,t){if(!this.isPreview){const i=Vt();i[e]=t,Wt(i)}}toggleInbox(e){this.isInboxOpen=!this.isInboxOpen,this.isInboxFromFlutter=!!(null==e?void 0:e.rect),this.isInboxOpen?(this.inboxCard.scrollTop=0,!this.isPreview&&this.deleteExpiredAndGetUnexpiredMsgs(),this.inbox.style.display="block",this.inbox.style.zIndex="2147483647",this.config.categories.length&&(this.selectedCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef=this.shadowRoot.getElementById("category-0"),this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadowRoot.getElementById("categoriesWrapper").scrollLeft-=this.shadowRoot.getElementById("categoriesWrapper").scrollWidth),this.setInboxPosition(e)):this.inbox.style.display="none"}setInboxPosition(e){const t=window.outerWidth,i=getComputedStyle(ue.inbox),o=i.getPropertyValue("--inbox-top"),n=i.getPropertyValue("--inbox-bottom"),s=i.getPropertyValue("--inbox-left"),r=i.getPropertyValue("--inbox-right");if(t>481&&!(o||n||s||r)){const t=Gt(e,this.inbox.clientHeight,this.inbox.clientWidth),i=t.xPos,o=t.yPos;this.inbox.style.top=o+"px",this.inbox.style.left=i+"px"}}updateUnviewedBadgeCounter(){if(this.isPreview)return void this.setBadgeStyle(this.unviewedCounter);let e=0;this.inboxCard.querySelectorAll("ct-inbox-message").forEach((t=>{const i=Vt();i[t.id]&&0===i[t.id].viewed&&e++})),this.setBadgeStyle(e)}updateTSForRenderedMsgs(){this.inboxCard.querySelectorAll("ct-inbox-message").forEach((e=>{const t=e.id.split("_")[1];e.shadow.getElementById("timeStamp").firstChild.innerText=Jt(t)}))}getInboxStyles(){const e=this.config.categories.length?64:16,t={panelBackgroundColor:this.config.styles.panelBackgroundColor,panelBorderColor:this.config.styles.panelBorderColor,headerBackgroundColor:this.config.styles.header.backgroundColor,headerTitleColor:this.config.styles.header.titleColor,closeIconColor:this.config.styles.closeIconColor,categoriesTabColor:this.config.styles.categories.tabColor,categoriesTitleColor:this.config.styles.categories.titleColor,selectedCategoryTabColor:this.config.styles.categories.selectedTab.tabColor,selectedCategoryTitleColor:this.config.styles.categories.selectedTab.titleColor,headerCategoryHeight:36+e};this.config.styles.categories.borderColor&&(t.categoriesBorderColor=this.config.styles.categories.borderColor),this.config.styles.categories.selectedTab.borderColor&&(t.selectedCategoryBorderColor=this.config.styles.categories.selectedTab.borderColor);const i=(e=>{let{panelBackgroundColor:t,panelBorderColor:i,headerBackgroundColor:o,headerTitleColor:n,closeIconColor:s,categoriesTabColor:r,categoriesTitleColor:a,categoriesBorderColor:l,selectedCategoryTabColor:d,selectedCategoryTitleColor:c,selectedCategoryBorderColor:h,headerCategoryHeight:u}=e;return'\n \n ")})(t),o=this.config.styles.cards;return i+(e=>{let{backgroundColor:t,borderColor:i,titleColor:o,descriptionColor:n,buttonColor:s,buttonTextColor:r,unreadMarkerColor:a}=e;return'\n \n ")})({backgroundColor:o.backgroundColor,borderColor:o.borderColor,titleColor:o.titleColor,descriptionColor:o.descriptionColor,buttonColor:o.buttonColor,buttonTextColor:o.buttonTextColor,unreadMarkerColor:o.unreadMarkerColor})}}const Ut=e=>{e.inbox_preview?ue.inbox.incomingMessagesForPreview=e.inbox_notifs:ue.inbox.incomingMessages=e},Ft=e=>{Ht(),ue.inbox=new zt({logger:e}),document.body.appendChild(ue.inbox)},qt=e=>{const t=he.readFromLSorCookie(V)||{};if(Object.keys(t).length>0&&Object.keys(t)[0].includes("_")){const i={};return i[e]=t,he.saveToLSorCookie(V,i),i}return t},Vt=()=>{const e=JSON.parse(decodeURIComponent(he.read(b)));if(!oe(e))return{};const t=qt(e);return t.hasOwnProperty(e)?t[e]:{}},Wt=e=>{const t=JSON.parse(decodeURIComponent(he.read(b)));if(!oe(t))return;const i={...qt(t),[t]:e};he.saveToLSorCookie(V,i)},Kt=e=>new Promise(((t,i)=>{if("complete"===document.readyState)Ft(e),t();else{const i=he.readFromLSorCookie(q)||{},o=()=>{null===ue.inbox&&Ft(e),t()};window.addEventListener("load",(()=>{if(document.getElementById(i.inboxSelector))o();else{let n=0;if(n<20){const s=setInterval((()=>{document.getElementById(i.inboxSelector)?(o(),clearInterval(s),t()):n>=20&&(clearInterval(s),e.debug("Failed to add inbox")),n++}),500)}}}))}})),Ht=()=>{void 0===customElements.get("ct-web-inbox")&&(customElements.define("ct-web-inbox",zt),customElements.define("ct-inbox-message",Nt))},Gt=(e,t,i)=>{const o=document.scrollingElement.scrollLeft,n=document.scrollingElement.scrollTop,s=window.innerWidth+o,r=window.innerHeight+n,a=e.rect||e.target.getBoundingClientRect(),l=a.x+o,d=a.y+n,c=a.left+o,h=a.right+o,u=a.top+n,p=a.bottom,g=a.height,v=a.width;let f,b,m=!1;const y=16;if(p+t<=r){const e=r-(p+t);b=e>=y?p+y:p+e}else if(u-t>=n){const e=u-t;b=e>=y?u-t-y:u-t-e}else m=!0,b=d+g/2-t/2,br&&(b=r-t);if(m){const e=h+i;if(e<=s){f=h+(e+y<=s?y:s-e)}else{const e=c-i;f=e-(e-y>=o?y:e-o)}}else f=l+v/2-i/2,fs&&(f=h-i>=o?h-i:s-i);return{xPos:f,yPos:b}},Jt=e=>{const t=Date.now();let i=Math.floor((t-e)/6e4);return i<5?"Just now":i<60?"".concat(i," minute").concat(i>1?"s":""," ago"):(i=Math.floor(i/60),i<24?"".concat(i," hour").concat(i>1?"s":""," ago"):(i=Math.floor(i/24),"".concat(i," day").concat(i>1?"s":""," ago")))},Zt=()=>Object.keys(he.readFromLSorCookie(q)||{}).length>0,$t='\n\n\n',Yt='\n\n\n',Qt=(e,t,i)=>{document.addEventListener("DOMContentLoaded",(()=>function(e,t,i){document.body.innerHTML="",Xt=document.createElement("div"),Xt.id="overlayDiv",Xt.style.position="relative",Xt.style.display="flex",document.body.appendChild(Xt);(function(e,t,i,o){return new Promise(((n,s)=>{var r=document.createElement("script");r.type="module",r.src=e,r.onload=function(){"function"==typeof window.Overlay?(window.Overlay("#overlayDiv",t,i,o),n()):s(new Error("ContentLayout not found in overlay.js"))},r.onerror=function(e){s(e)},document.head.appendChild(r)}))})("https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js",e,t,i).then((()=>{console.log("Overlay script loaded successfully.")})).catch((e=>{console.error("Error loading overlay script:",e)})),h=document.createElement("link"),h.rel="stylesheet",h.type="text/css",h.href="https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css",document.head.appendChild(h),n={kitId:"eqj6nom",scriptTimeout:3e3,async:!0},s=document,r=s.documentElement,a=setTimeout((function(){r.className=r.className.replace(/\bwf-loading\b/g,"")+" wf-inactive"}),n.scriptTimeout),l=s.createElement("script"),d=!1,c=s.getElementsByTagName("script")[0],r.className+=" wf-loading",l.src="https://use.typekit.net/"+n.kitId+".js",l.async=!0,l.onload=l.onreadystatechange=function(){if(o=this.readyState,!(d||o&&"complete"!==o&&"loaded"!==o)){d=!0,clearTimeout(a);try{Typekit.load(n)}catch(e){}}},c.parentNode.insertBefore(l,c);var o,n,s,r,a,l,d,c;var h}(e,t,i)))};let Xt;const ei=(e,t)=>{const i=t?e.details[0]:e.display.details[0],o=Object.keys(i)[0],n=i[o];if(o===window.location.href.split("?")[0])for(const i in n){const o=document.querySelector(i);if(o)n[i].html?o.outerHTML=n[i].html:ti(e,n[i]),t||window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot});else{let o=0;const s=setInterval((()=>{const r=document.querySelector(i);r?(n[i].html?r.outerHTML=n[i].html:ti(e,n[i]),t||window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot}),clearInterval(s)):(o++,o>=20&&(console.log("No element present on DOM with selector '".concat(i,"'.")),clearInterval(s)))}),500)}}};function ti(e,t){const i={};i.msgId=e.wzrk_id,e.wzrk_pivot&&(i.pivotId=e.wzrk_pivot),null!=t.json&&(i.json=t.json);const o=new CustomEvent("CT_web_native_display_buider",{detail:i});document.dispatchEvent(o)}const ii=e=>{const t=e.indexOf("\n `\n return html.replace(/(<\\s*\\/\\s*body)/, `${script}\\n$1`)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n const displayObj = targetingMsgJson.display\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = WIZ_IFRAME_INTENT\n let html = targetingMsgJson.msgContent.html\n if (displayObj['custom-editor'] && !displayObj['bee-editor'] && displayObj['custom-html-sandbox']) { // sandbox the iframe only for custom html\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox allow-forms' // allow popup to open url in new page\n html = ctEventhandler(html)\n }\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (targetingMsgJson.display['custom-editor'] && !targetingMsgJson.display['bee-editor'] && targetingMsgJson.display['custom-html-sandbox']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n let contentDiv\n iframe.onload = () => {\n if (targetingMsgJson.display['custom-editor'] && !targetingMsgJson.display['bee-editor'] && targetingMsgJson.display['custom-html-sandbox']) {\n window.addEventListener('message', event => {\n switch (event?.data?.action) {\n case GET_NOTIFICATION_DATA:\n window.clevertap.renderNotificationClicked(event.data.value)\n break\n case EVENT:\n window.clevertap.event.push(event.data.value)\n break\n case PROFILE:\n window.clevertap.profile.push(event.data.value)\n break\n case OUL:\n window.clevertap.onUserLogin.push(event.data.value)\n break\n case CLOSE_INTERSTITIAL_POPUP:\n setTimeout(() => {\n const interstitialWrapper = window.document.getElementById('intentPreview')\n const interstitialOverlay = window.document.getElementById('intentOpacityDiv')\n interstitialOverlay && interstitialOverlay.remove()\n interstitialWrapper && interstitialWrapper.remove()\n }, 0)\n break\n default:\n // Handle unknown action\n break\n }\n })\n contentDiv = ''\n } else {\n contentDiv = document.getElementById(WIZ_IFRAME_INTENT).contentDocument.getElementById('contentDiv')\n }\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n this.#logger.error('Error subscribing: ' + error)\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { initialiseCTBuilder, renderVisualBuilder } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token) {\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n #handleMessageEvent (event) {\n if (event.data && event.data.message) {\n if (event.data.message === 'Dashboard' && event.data.url) {\n initialiseCTBuilder(event.data.url, event.data.variant ?? null, event.data.details ?? {})\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n }\n }\n\n pageChanged () {\n const search = window.location.search\n const parentWindow = window.opener\n\n if (search === '?ctBuilder') {\n // open in visual builder mode\n console.log('open in visual builder mode')\n window.addEventListener('message', this.#handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('builder', '*')\n }\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', this.#handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('preview', '*')\n }\n return\n }\n\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","constructor","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","dataPostPEURL","dataPostURL","recorderURL","emailURL","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","WIZ_IFRAME","WIZ_IFRAME_INTENT","ADJUST_IFRAME_HEIGHT","UPDATE_HEIGHT","GET_NOTIFICATION","EVENT","PROFILE","OUL","CLOSE_BOX_POPUP","CLOSE_BANNER_POPUP","GET_NOTIFICATION_DATA","CLOSE_INTERSTITIAL_POPUP","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","save","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","read","data","getItem","parse","e","remove","removeItem","removeCookie","name","domain","cookieStr","document","cookie","createCookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","readCookie","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","saveToLSorCookie","property","location","hostname","$ct","globalCache","readFromLSorCookie","trim","err","createBroadCookie","broadDomain","domainParts","testBroadDomain","testCookieName","tempCookie","getMetaProp","metaObj","setMetaProp","wzrkMetaObj","getAndClearMetaProp","setInstantDeleteFlagInK","k","flag","backupEvent","reqNo","backupArr","q","debug","removeBackup","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","get","item","saveCacheToLS","set","allKeys","objToArray","index","temp","getKey","getSecondLastKey","keysArr","getLastKey","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","s","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","sessionObj","getSessionCookieObject","kIdFromLS","guidFromLRUCache","lastK","lastGUID","unregisterTokenForGuid","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","_processOldValues","getDetails","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","fireRequest","skipARP","sendOULFlag","getDelayFrequency","account","randomDelay","random","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","ProfileHandler","profilesArr","getAttribute","propName","_handleIncrementDecrementValue","command","tz","profile","addSystemDataToObject","addFlags","compressedData","saveAndFireRequest","_handleMultiValueSet","arrayVal","array","toLowerCase","sendMultiValueData","_handleMultiValueAdd","propKey","propVal","_handleMultiValueRemove","_handleMultiValueDelete","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","clear","addToK","ids","g","kId","anonymousUser","foundInCache","gFromCache","Identity","cookieName","loginArr","pop","processProfile","CTWebPersonalisationBanner","HTMLElement","_details","shadow","attachShadow","mode","details","renderBanner","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","target","renderCarousel","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","button","setInterval","sliderTime","goTo","prev","cur","CTWebPopupImageOnly","_session","popup","container","resizeObserver","renderImageOnlyPopup","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","Message","config","message","wrapper","snackBar","renderMessage","createEl","part","_el","msg","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","raiseClickedEvent","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","contains","setBadgeStyle","msgCount","incomingMessages","msgs","updateInboxMessages","incomingMessagesForPreview","previewMsgs","now","buildUIForMessages","updateUnviewedBadgeCounter","connectedCallback","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","addMsgsToInboxFromLS","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","deleteMsgsFromUI","getInboxMessages","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","top","right","getBoundingClientRect","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","inbox_notifs","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","OVERLAY_PATH","CSS_PATH","initialiseCTBuilder","variant","onContentLoad","position","overlayPath","loadOverlayScript","then","catch","loadCSS","loadTypeKit","link","rel","head","script","src","onload","Overlay","Error","onerror","kitId","scriptTimeout","docElement","documentElement","timeoutId","className","typeKitScript","scriptLoaded","firstScript","scriptReadyState","onreadystatechange","Typekit","load","renderVisualBuilder","targetingMsgJson","siteUrl","selectors","selector","element","querySelector","outerHTML","dispatchJsonData","intervalId","retryElement","inaObj","json","kvPairsEvent","CustomEvent","dispatchEvent","ctEventhandler","ctScript","insertPosition","join","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","onclick","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","sandbox","pointerCss","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","closeCampaign","Event","appendScriptForCustomEvent","srcdoc","handleMessage","heightAdjust","boxWrapper","bannerWrapper","margin","onUserLogin","handleIframeLoad","contentWindow","postMessage","contentDocument","scrollHeight","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","interstitialWrapper","interstitialOverlay","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","getTotalVisits","visitCount","getLastVisit","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","info","debugPE","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","getTimeElapsed","sessionStart","getPageCount","seqNo","requestTime","RequestManager","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","post","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","_enableWebPush","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","skipDialog","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","getValue","getdefaultValue","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","addValueChangedCallback","removeValueChangedCallback","clearStartFlag","VariableStore","syncVariables","onSyncSuccess","onSyncFailure","meta","tk","r","status","fetchVariables","onFetchCallback","addVariablesChangedCallback","callback","addOneTimeVariablesChangedCallback","removeVariablesChangedCallback","removeOneTimeVariablesChangedCallback","callBack","CleverTap","spa","isSpa","bind","enablePersonalization","_isPersonalisationActive","ReqestManager","privacy","notifications","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","handleDecrementValue","setMultiValuesForKey","addMultiValueForKey","addMultiValuesForKey","removeMultiValueForKey","removeMultiValuesForKey","removeValueForKey","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","sendLocationData","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","elements","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","parentWindow","opener","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","setOffline","arg","defineVariable","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;EAAO,MAAMA,aAAa,GAAG,oBAAtB;EACA,MAAMC,eAAe,GAAG,QAAxB;EACA,MAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;ECAQ,MAAMC,OAAN,CAAc;EAO3BC,EAAAA,WAAW,GAAsE;EAAA,QAApE;EAAEC,MAAAA;EAAF,KAAoE,uEAA3D,EAA2D;EAAA,QAAvDC,MAAuD,uEAA9C,EAA8C;EAAA,QAA1CC,YAA0C,uEAA3BP,aAA2B;EAAA,QAAZQ,KAAY,uEAAJ,EAAI;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,aALvE;EAKuE;EAAA;EAAA;EAAA,aAJjER;EAIiE;EAAA;EAAA;EAAA,aAHjE;EAGiE;EAAA;EAAA;EAAA,aAFxE;EAEwE;EAC/E,SAAKK,EAAL,GAAUA,EAAV;;EACA,QAAIC,MAAJ,EAAY;EACV,WAAKA,MAAL,GAAcA,MAAd;EACD;;EACD,QAAIC,YAAJ,EAAkB;EAChB,WAAKA,YAAL,GAAoBA,YAApB;EACD;;EACD,QAAIC,KAAJ,EAAW;EACT,WAAKA,KAAL,GAAaA,KAAb;EACD;EACF;;EAED,MAAIH,EAAJ,GAAU;EACR,uCAAO,IAAP;EACD;;EAED,MAAIA,EAAJ,CAAQI,SAAR,EAAmB;EACjB,gEAAkBA,SAAl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;QC3xBGpvB,SAAS,GAAG,IAAIw9B,SAAJ,CAActrC,MAAM,CAAC8N,SAArB;EAElB9N,MAAM,CAAC8N,SAAP,GAAmB9N,MAAM,CAAC+N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/modules/visualBuilder/builder_constants.js","src/modules/visualBuilder/pageBuilder.js","src/util/clevertap-handler.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/notification.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\nexport const WIZ_IFRAME = 'wiz-iframe'\nexport const WIZ_IFRAME_INTENT = 'wiz-iframe-intent'\nexport const ADJUST_IFRAME_HEIGHT = 'adjustIFrameHeight'\nexport const UPDATE_HEIGHT = 'update height'\nexport const GET_NOTIFICATION = 'getnotif'\nexport const EVENT = 'Event'\nexport const PROFILE = 'Profile'\nexport const OUL = 'OUL'\nexport const CLOSE_BOX_POPUP = 'closeBoxPopUp'\nexport const CLOSE_BANNER_POPUP = 'closeBannerPopUp'\nexport const GET_NOTIFICATION_DATA = 'getnotifData'\nexport const CLOSE_INTERSTITIAL_POPUP = 'closeInterstitialPopUp'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {}\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n // Initialize array\n var array = []\n\n // Check if globalProfileMap is null, initialize if needed\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n // Check if the value to be set is either string or number\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = $ct.globalProfileMap[propKey]\n array.push(typeof propVal === 'number' ? propVal : propVal.toLowerCase())\n } else {\n $ct.globalProfileMap[propKey] = propVal\n }\n } else {\n // Check if propVal is an array\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = Array.isArray($ct.globalProfileMap[propKey]) ? $ct.globalProfileMap[propKey] : [$ct.globalProfileMap[propKey]]\n }\n\n // Check for case-sensitive inputs and filter the same ones\n for (var i = 0; i < propVal.length; i++) {\n if (typeof propVal[i] === 'number' && !array.includes(propVal[i])) {\n array.push(propVal[i])\n } else if (typeof propVal[i] === 'string' && !array.includes(propVal[i].toLowerCase())) {\n array.push(propVal[i].toLowerCase())\n } else if ((typeof propVal[i] === 'number' && array.includes(propVal[i])) || (typeof propVal[i] === 'string' && array.includes(propVal[i].toLowerCase()))) {\n console.error('Values already included')\n } else {\n console.error('Array supports only string or number type values')\n }\n }\n\n // Update globalProfileMap with the array\n $ct.globalProfileMap[propKey] = array\n }\n\n // Save to local storage or cookie\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Call the sendMultiValueData function\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n var index = $ct.globalProfileMap[propKey].indexOf(propVal)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n } else {\n for (var k = 0; k < propVal.length; k++) {\n var idx = $ct.globalProfileMap[propKey].indexOf(propVal[k])\n if (idx !== -1) {\n $ct.globalProfileMap[propKey].splice(idx, 1)\n }\n }\n }\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n // console.log('Raise notification clicked event for ', item)\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","export const OVERLAY_PATH = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js'\nexport const CSS_PATH = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css'\n","import { CSS_PATH, OVERLAY_PATH } from './builder_constants'\n\n/**\n * Initializes the Clevertap builder.\n * @param {string} url - The URL to initialize the builder.\n * @param {string} variant - The variant of the builder.\n * @param {Object} details - The details object.\n */\nexport const initialiseCTBuilder = (url, variant, details) => {\n if (document.readyState === 'complete') {\n onContentLoad(url, variant, details)\n } else {\n document.addEventListener('DOMContentLoaded', () => onContentLoad(url, variant, details))\n }\n}\n\nlet container\n/**\n * Handles content load for Clevertap builder.\n */\nfunction onContentLoad (url, variant, details) {\n document.body.innerHTML = ''\n container = document.createElement('div')\n container.id = 'overlayDiv'\n container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form\n container.style.display = 'flex'\n document.body.appendChild(container)\n const overlayPath = OVERLAY_PATH\n loadOverlayScript(overlayPath, url, variant, details)\n .then(() => {\n console.log('Overlay script loaded successfully.')\n })\n .catch((error) => {\n console.error('Error loading overlay script:', error)\n })\n loadCSS()\n loadTypeKit()\n}\n\n/**\n * Loads CSS file.\n */\nfunction loadCSS () {\n var link = document.createElement('link')\n link.rel = 'stylesheet'\n link.type = 'text/css'\n link.href = CSS_PATH\n document.head.appendChild(link)\n}\n\n/**\n * Loads the overlay script.\n * @param {string} overlayPath - The path to overlay script.\n * @param {string} url - The URL.\n * @param {string} variant - The variant.\n * @param {Object} details - The details object.\n * @returns {Promise} A promise.\n */\nfunction loadOverlayScript (overlayPath, url, variant, details) {\n return new Promise((resolve, reject) => {\n var script = document.createElement('script')\n script.type = 'module'\n script.src = overlayPath\n script.onload = function () {\n if (typeof window.Overlay === 'function') {\n window.Overlay('#overlayDiv', url, variant, details)\n resolve()\n } else {\n reject(new Error('ContentLayout not found in overlay.js'))\n }\n }\n script.onerror = function (error) {\n reject(error)\n }\n document.head.appendChild(script)\n })\n}\n\n/**\n * Loads TypeKit script.\n */\nfunction loadTypeKit () {\n const config = {\n kitId: 'eqj6nom',\n scriptTimeout: 3000,\n async: true\n }\n\n const docElement = document.documentElement\n const timeoutId = setTimeout(function () {\n docElement.className = docElement.className.replace(/\\bwf-loading\\b/g, '') + ' wf-inactive'\n }, config.scriptTimeout)\n const typeKitScript = document.createElement('script')\n let scriptLoaded = false\n const firstScript = document.getElementsByTagName('script')[0]\n let scriptReadyState\n\n docElement.className += ' wf-loading'\n typeKitScript.src = 'https://use.typekit.net/' + config.kitId + '.js'\n typeKitScript.async = true\n typeKitScript.onload = typeKitScript.onreadystatechange = function () {\n scriptReadyState = this.readyState\n if (scriptLoaded || (scriptReadyState && scriptReadyState !== 'complete' && scriptReadyState !== 'loaded')) return\n scriptLoaded = true\n clearTimeout(timeoutId)\n try {\n // eslint-disable-next-line no-undef\n Typekit.load(config)\n } catch (e) {}\n }\n\n firstScript.parentNode.insertBefore(typeKitScript, firstScript)\n}\n\n/**\n * Renders the visual builder.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {boolean} isPreview - Indicates if it's a preview.\n */\nexport const renderVisualBuilder = (targetingMsgJson, isPreview) => {\n const details = isPreview ? targetingMsgJson.details[0] : targetingMsgJson.display.details[0]\n const siteUrl = Object.keys(details)[0]\n const selectors = details[siteUrl]\n\n if (siteUrl === window.location.href.split('?')[0]) {\n for (const selector in selectors) {\n const element = document.querySelector(selector)\n if (element) {\n if (selectors[selector].html) {\n element.outerHTML = selectors[selector].html\n } else {\n // Update json data\n dispatchJsonData(targetingMsgJson, selectors[selector])\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n } else {\n let count = 0\n const intervalId = setInterval(() => {\n const retryElement = document.querySelector(selector)\n if (retryElement) {\n if (selectors[selector].html) {\n retryElement.outerHTML = selectors[selector].html\n } else {\n // Update json data\n dispatchJsonData(targetingMsgJson, selectors[selector])\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n clearInterval(intervalId)\n } else {\n count++\n if (count >= 20) {\n console.log(`No element present on DOM with selector '${selector}'.`)\n clearInterval(intervalId)\n }\n }\n }, 500)\n }\n }\n }\n}\n\n/**\n * Dispatches JSON data.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {Object} selector - The selector object.\n */\nfunction dispatchJsonData (targetingMsgJson, selector) {\n const inaObj = {}\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (selector.json != null) {\n inaObj.json = selector.json\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display_buider', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n}\n","// clevertap-handler.js\n\nconst ctEventhandler = (html) => {\n const ctScript = `\n var clevertap = {\n event: {\n push: (eventName) => {\n window.parent.postMessage({\n action: 'Event',\n value: eventName\n },'*');\n }\n },\n profile: {\n push: (eventName) => {\n window.parent.postMessage({\n action: 'Profile',\n value: eventName\n },'*');\n }\n },\n onUserLogin: {\n push: (eventName) => {\n window.parent.postMessage({\n action: 'OUL',\n value: eventName\n },'*');\n }\n },\n closeBoxPopUp: () => {\n window.parent.postMessage({\n action: 'closeBoxPopUp',\n value: 'closeBoxPopUp'\n },'*');\n },\n closeBannerPopUp: () => {\n window.parent.postMessage({\n action: 'closeBannerPopUp',\n value: 'closeBannerPopUp'\n },'*');\n },\n closeInterstitialPopUp: () => {\n window.parent.postMessage({\n action: 'closeInterstitialPopUp',\n value: 'closeInterstitialPopUp'\n },'*');\n }\n }\n `\n const insertPosition = html.indexOf('\n `\n return html.replace(/(<\\s*\\/\\s*body)/, `${script}\\n$1`)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n const displayObj = targetingMsgJson.display\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = WIZ_IFRAME_INTENT\n let html = targetingMsgJson.msgContent.html\n if (displayObj['custom-editor'] && !displayObj['bee-editor'] && displayObj['custom-html-sandbox']) { // sandbox the iframe only for custom html\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox allow-forms' // allow popup to open url in new page\n html = ctEventhandler(html)\n }\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (targetingMsgJson.display['custom-editor'] && !targetingMsgJson.display['bee-editor'] && targetingMsgJson.display['custom-html-sandbox']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n let contentDiv\n iframe.onload = () => {\n if (targetingMsgJson.display['custom-editor'] && !targetingMsgJson.display['bee-editor'] && targetingMsgJson.display['custom-html-sandbox']) {\n window.addEventListener('message', event => {\n switch (event?.data?.action) {\n case GET_NOTIFICATION_DATA:\n window.clevertap.renderNotificationClicked(event.data.value)\n break\n case EVENT:\n window.clevertap.event.push(event.data.value)\n break\n case PROFILE:\n window.clevertap.profile.push(event.data.value)\n break\n case OUL:\n window.clevertap.onUserLogin.push(event.data.value)\n break\n case CLOSE_INTERSTITIAL_POPUP:\n setTimeout(() => {\n const interstitialWrapper = window.document.getElementById('intentPreview')\n const interstitialOverlay = window.document.getElementById('intentOpacityDiv')\n interstitialOverlay && interstitialOverlay.remove()\n interstitialWrapper && interstitialWrapper.remove()\n }, 0)\n break\n default:\n // Handle unknown action\n break\n }\n })\n contentDiv = ''\n } else {\n contentDiv = document.getElementById(WIZ_IFRAME_INTENT).contentDocument.getElementById('contentDiv')\n }\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n this.#logger.error('Error subscribing: ' + error)\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { initialiseCTBuilder, renderVisualBuilder } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token) {\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n #handleMessageEvent (event) {\n if (event.data && event.data.message) {\n if (event.data.message === 'Dashboard' && event.data.url) {\n initialiseCTBuilder(event.data.url, event.data.variant ?? null, event.data.details ?? {})\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n }\n }\n\n pageChanged () {\n const search = window.location.search\n const parentWindow = window.opener\n\n if (search === '?ctBuilder') {\n // open in visual builder mode\n console.log('open in visual builder mode')\n window.addEventListener('message', this.#handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('builder', '*')\n }\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', this.#handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('preview', '*')\n }\n return\n }\n\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","constructor","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","dataPostPEURL","dataPostURL","recorderURL","emailURL","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","WIZ_IFRAME","WIZ_IFRAME_INTENT","ADJUST_IFRAME_HEIGHT","UPDATE_HEIGHT","GET_NOTIFICATION","EVENT","PROFILE","OUL","CLOSE_BOX_POPUP","CLOSE_BANNER_POPUP","GET_NOTIFICATION_DATA","CLOSE_INTERSTITIAL_POPUP","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","save","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","read","data","getItem","parse","e","remove","removeItem","removeCookie","name","domain","cookieStr","document","cookie","createCookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","readCookie","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","saveToLSorCookie","property","location","hostname","$ct","globalCache","readFromLSorCookie","trim","err","createBroadCookie","broadDomain","domainParts","testBroadDomain","testCookieName","tempCookie","getMetaProp","metaObj","setMetaProp","wzrkMetaObj","getAndClearMetaProp","setInstantDeleteFlagInK","k","flag","backupEvent","reqNo","backupArr","q","debug","removeBackup","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","get","item","saveCacheToLS","set","allKeys","objToArray","index","temp","getKey","getSecondLastKey","keysArr","getLastKey","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","s","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","sessionObj","getSessionCookieObject","kIdFromLS","guidFromLRUCache","lastK","lastGUID","unregisterTokenForGuid","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","_processOldValues","getDetails","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","fireRequest","skipARP","sendOULFlag","getDelayFrequency","account","randomDelay","random","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","ProfileHandler","profilesArr","getAttribute","propName","_handleIncrementDecrementValue","command","tz","profile","addSystemDataToObject","addFlags","compressedData","saveAndFireRequest","_handleMultiValueSet","arrayVal","array","toLowerCase","sendMultiValueData","_handleMultiValueAdd","propKey","propVal","_handleMultiValueRemove","_handleMultiValueDelete","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","clear","addToK","ids","g","kId","anonymousUser","foundInCache","gFromCache","Identity","cookieName","loginArr","pop","processProfile","CTWebPersonalisationBanner","HTMLElement","_details","shadow","attachShadow","mode","details","renderBanner","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","target","renderCarousel","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","button","setInterval","sliderTime","goTo","prev","cur","CTWebPopupImageOnly","_session","popup","container","resizeObserver","renderImageOnlyPopup","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","Message","config","message","wrapper","snackBar","renderMessage","createEl","part","_el","msg","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","raiseClickedEvent","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","contains","setBadgeStyle","msgCount","incomingMessages","msgs","updateInboxMessages","incomingMessagesForPreview","previewMsgs","now","buildUIForMessages","updateUnviewedBadgeCounter","connectedCallback","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","addMsgsToInboxFromLS","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","deleteMsgsFromUI","getInboxMessages","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","top","right","getBoundingClientRect","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","inbox_notifs","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","OVERLAY_PATH","CSS_PATH","initialiseCTBuilder","variant","onContentLoad","position","overlayPath","loadOverlayScript","then","catch","loadCSS","loadTypeKit","link","rel","head","script","src","onload","Overlay","Error","onerror","kitId","scriptTimeout","docElement","documentElement","timeoutId","className","typeKitScript","scriptLoaded","firstScript","scriptReadyState","onreadystatechange","Typekit","load","renderVisualBuilder","targetingMsgJson","siteUrl","selectors","selector","element","querySelector","outerHTML","dispatchJsonData","intervalId","retryElement","inaObj","json","kvPairsEvent","CustomEvent","dispatchEvent","ctEventhandler","ctScript","insertPosition","join","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","onclick","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","sandbox","pointerCss","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","closeCampaign","Event","appendScriptForCustomEvent","srcdoc","handleMessage","heightAdjust","boxWrapper","bannerWrapper","margin","onUserLogin","handleIframeLoad","contentWindow","postMessage","contentDocument","scrollHeight","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","interstitialWrapper","interstitialOverlay","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","getTotalVisits","visitCount","getLastVisit","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","info","debugPE","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","getTimeElapsed","sessionStart","getPageCount","seqNo","requestTime","RequestManager","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","post","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","_enableWebPush","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","skipDialog","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","getValue","getdefaultValue","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","addValueChangedCallback","removeValueChangedCallback","clearStartFlag","VariableStore","syncVariables","onSyncSuccess","onSyncFailure","meta","tk","r","status","fetchVariables","onFetchCallback","addVariablesChangedCallback","callback","addOneTimeVariablesChangedCallback","removeVariablesChangedCallback","removeOneTimeVariablesChangedCallback","callBack","CleverTap","spa","isSpa","bind","enablePersonalization","_isPersonalisationActive","ReqestManager","privacy","notifications","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","handleDecrementValue","setMultiValuesForKey","addMultiValueForKey","addMultiValuesForKey","removeMultiValueForKey","removeMultiValuesForKey","removeValueForKey","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","sendLocationData","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","elements","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","parentWindow","opener","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","setOffline","arg","defineVariable","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;EAAO,MAAMA,aAAa,GAAG,oBAAtB;EACA,MAAMC,eAAe,GAAG,QAAxB;EACA,MAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;ECAQ,MAAMC,OAAN,CAAc;EAO3BC,EAAAA,WAA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AAsC;EAC3C2R,MAAAA,mBAAmB,CAAC9U,KAAK,CAAC3c,IAAP,EAAa,IAAb,CAAnB;EACD;EACF;EACF;;+CAuGe;EACd,MAAIqP,WAAW,GAAG,0DAAchY,WAAhC;;EACA,MAAI2I,IAAI,GAAG,EAAX;EACAA,EAAAA,IAAI,GAAG,0DAAcqX,qBAAd,CAAoCrX,IAApC,EAA0C7C,SAA1C,CAAP;EACAkS,EAAAA,WAAW,GAAGzD,QAAQ,CAACyD,WAAD,EAAc,MAAd,EAAsBhW,QAAtB,CAAtB;EACAgW,EAAAA,WAAW,GAAGzD,QAAQ,CAACyD,WAAD,EAAc,GAAd,EAAmB3C,YAAY,CAAC7M,IAAI,CAACC,SAAL,CAAeE,IAAf,CAAD,8BAAuB,IAAvB,wBAA/B,CAAtB;;EAEA,4DAAcwX,kBAAd,CAAiCnI,WAAjC,EAA8CpN,GAAG,CAACgC,YAAlD;EACD;;yDAEoB;EACnB,SAAQ,OAAOrC,MAAM,CAACorC,MAAd,KAAyB,WAAzB,IAAwCprC,MAAM,CAACorC,MAAP,CAAcC,IAAd,KAAuB,YAAvE;EACD;;yDAMmBjtC,MAAM;EACxB,MAAI,KAAKomC,wBAAL,EAAJ,EAAqC;EACnCpmC,IAAAA,IAAI,CAAC8+B,KAAL,GAAa,IAAb;EACD;EACF;;QC3xBGpvB,SAAS,GAAG,IAAIw9B,SAAJ,CAActrC,MAAM,CAAC8N,SAArB;EAElB9N,MAAM,CAAC8N,SAAP,GAAmB9N,MAAM,CAAC+N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file diff --git a/clevertap.min.js b/clevertap.min.js index 7ed91725..3591c5ad 100644 --- a/clevertap.min.js +++ b/clevertap.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).clevertap=t()}(this,(function(){"use strict";var e=0;function t(t){return"__private_"+e+++"_"+t}function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}const o="clevertap-prod.com",n="https:";var s=t("accountId"),r=t("region"),a=t("targetDomain"),l=t("dcSdkversion"),d=t("token");class c{constructor(){let{id:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";Object.defineProperty(this,s,{writable:!0,value:void 0}),Object.defineProperty(this,r,{writable:!0,value:""}),Object.defineProperty(this,a,{writable:!0,value:o}),Object.defineProperty(this,l,{writable:!0,value:""}),Object.defineProperty(this,d,{writable:!0,value:""}),this.id=e,t&&(this.region=t),i&&(this.targetDomain=i),n&&(this.token=n)}get id(){return i(this,s)[s]}set id(e){i(this,s)[s]=e}get region(){return i(this,r)[r]}set region(e){i(this,r)[r]=e}get dcSDKVersion(){return i(this,l)[l]}set dcSDKVersion(e){i(this,l)[l]=e}get targetDomain(){return i(this,a)[a]}set targetDomain(e){i(this,a)[a]=e}get token(){return i(this,d)[d]}set token(e){i(this,d)[d]=e}get finalTargetDomain(){return this.region?"".concat(this.region,".").concat(this.targetDomain):this.targetDomain===o?"".concat("eu1",".").concat(this.targetDomain):this.targetDomain}get dataPostPEURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/defineVars")}get dataPostURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/a?t=96")}get recorderURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/r?r=1")}get emailURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/e?r=1")}}const h=new RegExp("^\\s+|\\.|:|\\$|'|\"|\\\\|\\s+$","g"),u=new RegExp("^\\s+|'|\"|\\\\|\\s+$","g"),p=new RegExp("'","g"),g="clear",v="Charged ID",f="WZRK_CHARGED_ID",b="WZRK_G",m="WZRK_K",y="WZRK_CAMP",w="WZRK_CAMP_G",C="WZRK_EV",k="WZRK_META",x="WZRK_PR",P="WZRK_ARP",I="WZRK_L",S="global",O="optOut",_="useIP",E="WZRK_X",A="push",M=31536e3,L="wzrk_",T="wzrk_id",R="Notification Viewed",j="Notification Clicked",D="WZRK_FPU",B="WZRK_PSD",N="$incr",z="$add",U="$remove",F="$delete",q="WZRK_INBOX_CONFIG",V="WZRK_INBOX",W=1e3,K="wzrk_fetch",H="wiz-iframe",G="wiz-iframe-intent",J="Event",Z="Profile",$=["Stayed","UTM Visited","App Launched","Notification Sent",R,j],Y=e=>"string"==typeof e||e instanceof String,Q=e=>"[object Object]"===Object.prototype.toString.call(e),X=e=>"object"==typeof e&&e instanceof Date,ee=e=>{for(const t in e)if(e.hasOwnProperty(t))return!1;return!0},te=e=>!isNaN(parseFloat(e))&&isFinite(e),ie=e=>/^-?[\d.]+(?:e-?\d+)?$/.test(e)&&"number"==typeof e,oe=e=>null!=e&&"undefined"!==e,ne=(e,t)=>{if("object"!=typeof e){let i;return Y(e)?(i=se(e,u),i.length>1024&&(i=i.substring(0,1024),t.reportError(521,i+"... length exceeded 1024 chars. Trimmed."))):i=e,i}for(const i in e)if(e.hasOwnProperty(i)){const o=ne(e[i],t);let n;n=se(i,h),n.length>1024&&(n=n.substring(0,1024),t.reportError(520,n+"... length exceeded 1024 chars. Trimmed.")),delete e[i],e[n]=o}return e},se=(e,t)=>e.replace(t,""),re=()=>{const e=new Date;return e.getFullYear()+""+e.getMonth()+e.getDay()},ae=()=>Math.floor((new Date).getTime()/1e3),le=e=>"$D_"+Math.round(e.getTime()/1e3),de=e=>{if(ce(e))return"$D_"+e},ce=e=>{const t=/^(\d{4})(\d{2})(\d{2})$/.exec(e);if(null==t)return!1;const i=t[3],o=t[2]-1,n=t[1],s=new Date(n,o,i);return s.getDate()==i&&s.getMonth()==o&&s.getFullYear()==n};class he{static save(e,t){return!(!e||!t)&&(this._isLocalStorageSupported()?(localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),!0):void 0)}static read(e){if(!e)return!1;let t=null;if(this._isLocalStorageSupported()&&(t=localStorage.getItem(e)),null!=t)try{t=JSON.parse(t)}catch(e){}return t}static remove(e){return!!e&&(this._isLocalStorageSupported()?(localStorage.removeItem(e),!0):void 0)}static removeCookie(e,t){let i=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";t&&(i=i+" domain="+t+"; path=/"),document.cookie=i}static createCookie(e,t,i,o){let n="",s="";if(i){const e=new Date;e.setTime(e.getTime()+1e3*i),n="; expires="+e.toGMTString()}o&&(s="; domain="+o),t=encodeURIComponent(t),document.cookie=e+"="+t+n+s+"; path=/"}static readCookie(e){const t=e+"=",i=document.cookie.split(";");for(let e=0;e=0;o--){if(a=0===o?r[o]+a:"."+r[o]+a,this.readCookie(e)){var n="test_"+e+o;if(this.createCookie(n,t,10,a),!this.readCookie(n))continue;this.removeCookie(n,a)}this.createCookie(e,t,i,a);if(this.readCookie(e)==t){s=a,ue.broadDomain=s;break}}}else this.createCookie(e,t,i,s)}else this.createCookie(e,t,i,o)}static getMetaProp(e){const t=this.readFromLSorCookie(k);if(null!=t)return t[e]}static setMetaProp(e,t){if(this._isLocalStorageSupported()){let i=this.readFromLSorCookie(k);null==i&&(i={}),void 0===t?delete i[e]:i[e]=t,this.saveToLSorCookie(k,i)}}static getAndClearMetaProp(e){const t=this.getMetaProp(e);return this.setMetaProp(e,void 0),t}static setInstantDeleteFlagInK(){let e=this.readFromLSorCookie(m);null==e&&(e={}),e.flag=!0,this.saveToLSorCookie(m,e)}static backupEvent(e,t,i){let o=this.readFromLSorCookie(I);void 0===o&&(o={}),o[t]={q:e},this.saveToLSorCookie(I,o),i.debug("stored in ".concat(I," reqNo : ").concat(t," -> ").concat(e))}static removeBackup(e,t){const i=this.readFromLSorCookie(I);null!=i&&void 0!==i[e]&&(t.debug("del event: ".concat(e," data-> ").concat(i[e].q)),delete i[e],this.saveToLSorCookie(I,i))}}const ue={globalCache:{gcookie:null,REQ_N:0,RESP_N:0},LRU_CACHE:null,globalProfileMap:void 0,globalEventsMap:void 0,blockRequest:!1,isOptInRequest:!1,broadDomain:null,webPushEnabled:null,campaignDivMap:{},currentSessionId:null,wiz_counter:0,notifApi:{notifEnabledFromApi:!1},unsubGroups:[],updatedCategoryLong:null,inbox:null,isPrivacyArrPushed:!1,privacyArray:[],offline:!1,location:null,dismissSpamControl:!1,globalUnsubscribe:!0,flutterVersion:null,variableStore:{}};var pe=t("keyOrder"),ge=t("deleteFromObject");class ve{constructor(e){Object.defineProperty(this,ge,{value:fe}),Object.defineProperty(this,pe,{writable:!0,value:void 0}),this.max=e;let t=he.readFromLSorCookie(E);if(t){const e={};i(this,pe)[pe]=[],t=t.cache;for(const o in t)t.hasOwnProperty(o)&&(e[t[o][0]]=t[o][1],i(this,pe)[pe].push(t[o][0]));this.cache=e}else this.cache={},i(this,pe)[pe]=[]}get(e){const t=this.cache[e];return t&&(this.cache=i(this,ge)[ge](e,this.cache),this.cache[e]=t,i(this,pe)[pe].push(e)),this.saveCacheToLS(this.cache),t}set(e,t){const o=this.cache[e],n=i(this,pe)[pe];null!=o?this.cache=i(this,ge)[ge](e,this.cache):n.length===this.max&&(this.cache=i(this,ge)[ge](n[0],this.cache)),this.cache[e]=t,i(this,pe)[pe][i(this,pe)[pe]-1]!==e&&i(this,pe)[pe].push(e),this.saveCacheToLS(this.cache)}saveCacheToLS(e){const t=[],o=i(this,pe)[pe];for(const i in o)if(o.hasOwnProperty(i)){const n=[];n.push(o[i]),n.push(e[o[i]]),t.push(n)}he.saveToLSorCookie(E,{cache:t})}getKey(e){if(null===e)return null;const t=i(this,pe)[pe];for(const i in t)if(t.hasOwnProperty(i)&&this.cache[t[i]]===e)return t[i];return null}getSecondLastKey(){const e=i(this,pe)[pe];return null!=e&&e.length>1?e[e.length-2]:-1}getLastKey(){const e=i(this,pe)[pe].length;if(e)return i(this,pe)[pe][e-1]}}var fe=function(e,t){const o=JSON.parse(JSON.stringify(i(this,pe)[pe])),n={};let s;for(const i in o)o.hasOwnProperty(i)&&(o[i]!==e?n[o[i]]=t[o[i]]:s=i);return o.splice(s,1),i(this,pe)[pe]=JSON.parse(JSON.stringify(o)),n},be=t("logger"),me=t("request"),ye=t("device"),we=t("session");class Ce{constructor(e){let{logger:t,request:o,device:n,session:s}=e;Object.defineProperty(this,be,{writable:!0,value:void 0}),Object.defineProperty(this,me,{writable:!0,value:void 0}),Object.defineProperty(this,ye,{writable:!0,value:void 0}),Object.defineProperty(this,we,{writable:!0,value:void 0}),i(this,be)[be]=t,i(this,me)[me]=o,i(this,ye)[ye]=n,i(this,we)[we]=s}s(e,t,o,n,s){let r=!1,a=!1;if(window.isOULInProgress&&(o||"undefined"!==n&&n===window.oulReqN)&&(window.isOULInProgress=!1,r=!0),void 0===n&&(n=0),he.removeBackup(n,i(this,be)[be]),n>ue.globalCache.REQ_N)return;if(oe(i(this,ye)[ye].gcookie)||e&&(a=!0),!oe(i(this,ye)[ye].gcookie)||o||"boolean"==typeof s){const n=i(this,we)[we].getSessionCookieObject();if(window.isOULInProgress||n.s&&t{if(Q(e)){for(var t in e)if(e.hasOwnProperty(t)){if(Q(e[t])||Array.isArray(e[t]))return!1;X(e[t])&&(e[t]=le(e[t]))}return!0}return!1},Ne=(e,t)=>{if(Q(e)){for(var i in e)if(e.hasOwnProperty(i))if("Items"===i){if(!Array.isArray(e[i]))return!1;for(var o in e[i].length>50&&t.reportError(522,"Charged Items exceed 50 limit. Actual count: "+e[i].length),e[i])if(e[i].hasOwnProperty(o)&&(!Q(e[i][o])||!Be(e[i][o])))return!1}else{if(Q(e[i])||Array.isArray(e[i]))return!1;X(e[i])&&(e[i]=le(e[i]))}if(Y(e[v])||ie(e[v])){const i=e[v]+"";if(void 0===De&&(De=he.readFromLSorCookie(f)),void 0!==De&&De.trim()===i.trim())return t.error("Duplicate charged Id - Dropped"+e),!1;De=i,he.saveToLSorCookie(f,i)}return!0}return!1};var ze=t("logger"),Ue=t("oldValues"),Fe=t("request"),qe=t("isPersonalisationActive"),Ve=t("processEventArray");class We extends Array{constructor(e,t){let{logger:o,request:n,isPersonalisationActive:s}=e;super(),Object.defineProperty(this,Ve,{value:Ke}),Object.defineProperty(this,ze,{writable:!0,value:void 0}),Object.defineProperty(this,Ue,{writable:!0,value:void 0}),Object.defineProperty(this,Fe,{writable:!0,value:void 0}),Object.defineProperty(this,qe,{writable:!0,value:void 0}),i(this,ze)[ze]=o,i(this,Ue)[Ue]=t,i(this,Fe)[Fe]=n,i(this,qe)[qe]=s}push(){for(var e=arguments.length,t=new Array(e),o=0;o0;){var t=e.shift();if(!Y(t)){i(this,ze)[ze].error(Oe);continue}if(t.length>1024&&(t=t.substring(0,1024),i(this,ze)[ze].reportError(510,t+"... length exceeded 1024 chars. Trimmed.")),$.includes(t)){i(this,ze)[ze].reportError(513,t+" is a restricted system event. It cannot be used as an event name.");continue}const o={type:"event"};if(o.evtName=se(t,h),0!==e.length){const n=e.shift();if(Q(n)){if("Charged"===t){if(!Ne(n,i(this,ze)[ze])){i(this,ze)[ze].reportError(511,"Charged event structure invalid. Not sent.");continue}}else if(!Be(n)){i(this,ze)[ze].reportError(512,t+" event structure invalid. Not sent.");continue}o.evtData=n}else e.unshift(n)}i(this,Fe)[Fe].processEvent(o)}};const He=e=>{const t={},i=e.indexOf("?");if(i>1){const o=e.substring(i+1);let n;const s=/\+/g,r=/([^&=]+)=?([^&]*)/g,a=function(e){let t=e.replace(s," ");try{t=decodeURIComponent(t)}catch(e){}return t};for(n=r.exec(o);n;)t[a(n[1])]=a(n[2]),n=r.exec(o)}return t},Ge=(e,t,i)=>e+"&"+t+"="+encodeURIComponent(i),Je=()=>window.location.hostname,Ze=(e,t)=>(t&&"function"==typeof t.debug&&t.debug("dobj:"+e),Ye(e)),$e=(()=>{let e="",t=0;for(t=0;t<=25;t++)e+=String.fromCharCode(t+65);for(t=0;t<=25;t++)e+=String.fromCharCode(t+97);for(t=0;t<10;t++)e+=t;return e+"+/="})(),Ye=e=>{if(null==e)return"";var t,i,o,n,s,r,a,l="",d=0;for(e=(e=>{if(null==e)return"";let t,i,o,n={},s={},r="",a="",l="",d=2,c=3,h=2,u="",p=0,g=0,v=String.fromCharCode;for(o=0;o>=1}else{for(i=1,t=0;t>=1}d--,0==d&&(d=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;d--,0==d&&(d=Math.pow(2,h),h++),n[a]=c++,l=String(r)}if(""!==l){if(Object.prototype.hasOwnProperty.call(s,l)){if(l.charCodeAt(0)<256){for(t=0;t>=1}else{for(i=1,t=0;t>=1}d--,0==d&&(d=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;d--,0==d&&(d=Math.pow(2,h),h++)}for(i=2,t=0;t>=1;for(;;){if(p<<=1,15==g){u+=v(p);break}g++}return u})(e);d<2*e.length;)d%2==0?(t=e.charCodeAt(d/2)>>8,i=255&e.charCodeAt(d/2),o=d/2+1>8:NaN):(t=255&e.charCodeAt((d-1)/2),(d+1)/2>8,o=255&e.charCodeAt((d+1)/2)):i=o=NaN),d+=3,n=t>>2,s=(3&t)<<4|i>>4,r=(15&i)<<2|o>>6,a=63&o,isNaN(i)?r=a=64:isNaN(o)&&(a=64),l=l+$e.charAt(n)+$e.charAt(s)+$e.charAt(r)+$e.charAt(a);return l};var Qe=t("fireRequest"),Xe=t("dropRequestDueToOptOut"),et=t("addUseIPToRequest"),tt=t("addARPToRequest");class it{constructor(){this.networkRetryCount=0,this.minDelayFrequency=0}static fireRequest(e,t,o,n){i(this,Qe)[Qe](e,1,t,o,n)}getDelayFrequency(){if(this.logger.debug("Network retry #"+this.networkRetryCount),this.networkRetryCount<10)return this.logger.debug(this.account.id,"Failure count is "+this.networkRetryCount+". Setting delay frequency to 1s"),this.minDelayFrequency=W,this.minDelayFrequency;if(null==this.account.region)return this.logger.debug(this.account.id,"Setting delay frequency to 1s"),W;{const e=1e3*(Math.floor(10*Math.random())+1);return this.minDelayFrequency+=e,this.minDelayFrequency<6e5?(this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency):(this.minDelayFrequency=W,this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency)}}}it.logger=void 0,it.device=void 0,it.account=void 0,Object.defineProperty(it,Qe,{value:function(e,t,o,n,s){var r,a;if(i(this,Xe)[Xe]())return void this.logger.debug("req dropped due to optout cookie: "+this.device.gcookie);if(oe(this.device.gcookie)||(ue.blockRequest=!0),s&&s===K)!oe(this.device.gcookie)&&ue.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(this.networkRetryCount)),i(this,Qe)[Qe](e,void 0,o,n)}),this.getDelayFrequency());else if(!oe(this.device.gcookie)&&ue.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(t)),i(this,Qe)[Qe](e,t+1,o,n)}),50);if(n?window.isOULInProgress=!0:(oe(this.device.gcookie)&&(e=Ge(e,"gc",this.device.gcookie)),e=i(this,tt)[tt](e,o)),e=Ge(e,"tries",t),e=i(this,et)[et](e),e=Ge(e,"r",(new Date).getTime()),(null===(r=window.clevertap)||void 0===r?void 0:r.hasOwnProperty("plugin"))||(null===(a=window.wizrocket)||void 0===a?void 0:a.hasOwnProperty("plugin"))){const t=window.clevertap.plugin||window.wizrocket.plugin;e=Ge(e,"ct_pl",t)}-1!==e.indexOf("chrome-extension:")&&(e=e.replace("chrome-extension:","https:"));for(var l=document.getElementsByClassName("ct-jp-cb");l[0]&&l[0].parentNode;)l[0].parentNode.removeChild(l[0]);const d=document.createElement("script");d.setAttribute("type","text/javascript"),d.setAttribute("src",e),d.setAttribute("class","ct-jp-cb"),d.setAttribute("rel","nofollow"),d.async=!0,document.getElementsByTagName("head")[0].appendChild(d),this.logger.debug("req snt -> url: "+e)}}),Object.defineProperty(it,Xe,{value:function(){return!ue.isOptInRequest&&oe(this.device.gcookie)&&Y(this.device.gcookie)?":OO"===this.device.gcookie.slice(-3):(ue.isOptInRequest=!1,!1)}}),Object.defineProperty(it,et,{value:function(e){var t=he.getMetaProp(_);return"boolean"!=typeof t&&(t=!1),Ge(e,_,t?"true":"false")}}),Object.defineProperty(it,tt,{value:function(e,t){if(!0===t){const t={skipResARP:!0};return Ge(e,"arp",Ze(JSON.stringify(t),this.logger))}return he._isLocalStorageSupported()&&void 0!==localStorage.getItem(P)&&null!==localStorage.getItem(P)?Ge(e,"arp",Ze(JSON.stringify(he.readFromLSorCookie(P)),this.logger)):e}});const ot=()=>{let e={};if(he._isLocalStorageSupported()){let t=he.read(y);null!=t?(t=JSON.parse(decodeURIComponent(t).replace(p,'"')),t.hasOwnProperty("global")?e.wp=t:e=t):e={}}return e},nt=e=>{if(he._isLocalStorageSupported()){const t={...ot(),...e},i=JSON.stringify(t);he.save(y,encodeURIComponent(i)),st()}},st=()=>{if(he._isLocalStorageSupported()){let i=he.read(b);if(oe(i))try{i=JSON.parse(decodeURIComponent(he.read(b)));const o=he.read(w)?JSON.parse(decodeURIComponent(he.read(w))):{};if(i&&he._isLocalStorageSupported()){var e={},t=ot();Object.keys(t).forEach((n=>{const s=i in o&&Object.keys(o[i]).length&&o[i][n]?o[i][n]:{},r=t[n].global,a=re(),l=t[n][a];if(void 0!==r){const e=Object.keys(r);for(const t in e){let i=[];if(e.hasOwnProperty(t)){let o=0,n=0;const a=e[t];if("tc"===a)continue;void 0!==l&&void 0!==l[a]&&(o=l[a]),void 0!==r&&void 0!==r[a]&&(n=r[a]),i=[a,o,n],s[a]=i}}}e={...e,[n]:s}})),o[i]=e,he.save(w,encodeURIComponent(JSON.stringify(o)))}}catch(e){console.error("Invalid clevertap Id "+e)}}},rt=()=>{const e=JSON.parse(decodeURIComponent(he.read(b)));let t={};if(he._isLocalStorageSupported()){let i={};t=ot();const o=he.read(w),n=o?decodeURIComponent(o):null,s=n?JSON.parse(n):null,r=e&&null!=o&&s&&s[e]&&s[e].wp?Object.values(s[e].wp):[],a=e&&null!=o&&s&&s[e]&&s[e].wi?Object.values(s[e].wi):[],l=re();let d=0,c=0;return t.wp&&t.wp[l]&&"undefined"!==t.wp[l].tc&&(d=t.wp[l].tc),t.wi&&t.wi[l]&&"undefined"!==t.wi[l].tc&&(c=t.wi[l].tc),i={wmp:d,wimp:c,tlc:r,witlc:a},i}},at=(e,t)=>{let{logger:i}=t,o=!1;if(Q(e))for(const t in e)if(e.hasOwnProperty(t)){o=!0;let n=e[t];if(null==n){delete e[t];continue}"Gender"!==t||n.match(/^M$|^F$/)||(o=!1,i.error(_e)),"Employed"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Ee)),"Married"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Ae)),"Education"!==t||n.match(/^School$|^College$|^Graduate$/)||(o=!1,i.error(Me)),"Age"===t&&null!=n&&(te(n)?e.Age=+n:(o=!1,i.error(Le))),"DOB"===t?(/^\$D_/.test(n)&&11===(n+"").length||X(n)||(o=!1,i.error(Te)),X(n)&&(e[t]=le(n))):X(n)&&(e[t]=le(n)),"Phone"!==t||ee(n)||(n.length>8&&"+"===n.charAt(0)?(n=n.substring(1,n.length),te(n)?e.Phone=+n:(o=!1,i.error(je+". Removed."))):(o=!1,i.error(je+". Removed."))),o||delete e[t]}return o},lt=e=>{const t={};t.Name=e.name,null!=e.id&&(t.FBID=e.id+""),"male"===e.gender?t.Gender="M":"female"===e.gender?t.Gender="F":t.Gender="O";null!=e.relationship_status&&(t.Married="N","Married"===e.relationship_status&&(t.Married="Y"));const i=function(e){if(null!=e){let t="",i="";for(let o=0;o0?"Y":"N",null!=e.email&&(t.Email=e.email),null!=e.birthday){const i=e.birthday.split("/");t.DOB=de(i[2]+i[0]+i[1])}return t},dt=(e,t)=>{let{logger:i}=t;const o={};if(null!=e.displayName&&(o.Name=e.displayName),null!=e.id&&(o.GPID=e.id+""),null!=e.gender&&("male"===e.gender?o.Gender="M":"female"===e.gender?o.Gender="F":"other"===e.gender&&(o.Gender="O")),null!=e.image&&!1===e.image.isDefault&&(o.Photo=e.image.url.split("?sz")[0]),null!=e.emails)for(let t=0;t{if(he._isLocalStorageSupported()){if(null==ue.globalProfileMap&&(ue.globalProfileMap=he.readFromLSorCookie(x),null==ue.globalProfileMap&&(ue.globalProfileMap={})),null!=e._custom){const t=e._custom;for(const i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);delete e._custom}for(const i in e)if(e.hasOwnProperty(i)){if(ue.globalProfileMap.hasOwnProperty(i)&&!t)continue;ue.globalProfileMap[i]=e[i]}null!=ue.globalProfileMap._custom&&delete ue.globalProfileMap._custom,he.saveToLSorCookie(x,ue.globalProfileMap)}},ht=(e,t,i)=>{if(null!=e&&"-1"!==e&&he._isLocalStorageSupported()){const t=ot();let o=t.wp[i];null==o&&(o={},t[i]=o),o[e]="dnd",nt(t)}if(null!=ue.campaignDivMap){const t=ue.campaignDivMap[e];null!=t&&(document.getElementById(t).style.display="none","intentPreview"===t&&null!=document.getElementById("intentOpacityDiv")&&(document.getElementById("intentOpacityDiv").style.display="none"))}};var ut=t("logger"),pt=t("request"),gt=t("account"),vt=t("oldValues"),ft=t("isPersonalisationActive"),bt=t("processProfileArray");class mt extends Array{constructor(e,t){let{logger:o,request:n,account:s,isPersonalisationActive:r}=e;super(),Object.defineProperty(this,bt,{value:yt}),Object.defineProperty(this,ut,{writable:!0,value:void 0}),Object.defineProperty(this,pt,{writable:!0,value:void 0}),Object.defineProperty(this,gt,{writable:!0,value:void 0}),Object.defineProperty(this,vt,{writable:!0,value:void 0}),Object.defineProperty(this,ft,{writable:!0,value:void 0}),i(this,ut)[ut]=o,i(this,pt)[pt]=n,i(this,gt)[gt]=s,i(this,vt)[vt]=t,i(this,ft)[ft]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o0)for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];let n,s={};if(null!=o.Site){if(n=o.Site,ee(n)||!at(n,{logger:i(this,ut)[ut]}))return}else if(null!=o.Facebook){const e=o.Facebook;ee(e)||e.error||(n=lt(e))}else if(null!=o["Google Plus"]){const e=o["Google Plus"];ee(e)||e.error||(n=dt(e,{logger:i(this,ut)[ut]}))}if(null!=n&&!ee(n)){s.type="profile",null==n.tz&&(n.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),s.profile=n,ct(n,!0),s=i(this,pt)[pt].addSystemDataToObject(s,void 0),i(this,pt)[pt].addFlags(s);const e=Ze(JSON.stringify(s),i(this,ut)[ut]);let t=i(this,gt)[gt].dataPostURL;t=Ge(t,"type",A),t=Ge(t,"d",e),i(this,pt)[pt].saveAndFireRequest(t,ue.blockRequest)}}},wt=t("request"),Ct=t("logger"),kt=t("account"),xt=t("session"),Pt=t("oldValues"),It=t("device"),St=t("processOUL"),Ot=t("handleCookieFromCache"),_t=t("deleteUser"),Et=t("processLoginArray");class At extends Array{constructor(e,t){let{request:o,account:n,session:s,logger:r,device:a}=e;super(),Object.defineProperty(this,Et,{value:Rt}),Object.defineProperty(this,_t,{value:Tt}),Object.defineProperty(this,Ot,{value:Lt}),Object.defineProperty(this,St,{value:Mt}),Object.defineProperty(this,wt,{writable:!0,value:void 0}),Object.defineProperty(this,Ct,{writable:!0,value:void 0}),Object.defineProperty(this,kt,{writable:!0,value:void 0}),Object.defineProperty(this,xt,{writable:!0,value:void 0}),Object.defineProperty(this,Pt,{writable:!0,value:void 0}),Object.defineProperty(this,It,{writable:!0,value:void 0}),i(this,wt)[wt]=o,i(this,kt)[kt]=n,i(this,xt)[xt]=s,i(this,Ct)[Ct]=r,i(this,Pt)[Pt]=t,i(this,It)[It]=a}clear(){i(this,Ct)[Ct].debug("clear called. Reset flag has been set."),i(this,_t)[_t](),he.setMetaProp(g,!0)}push(){for(var e=arguments.length,t=new Array(e),o=0;o{let o=he.readFromLSorCookie(m);const n=he.readFromLSorCookie(b);let s;if(null==o)o={},s=e;else{s=o.id;let r=!1,a=!1;if(null==s&&(s=e[0],r=!0),null==ue.LRU_CACHE&&he._isLocalStorageSupported()&&(ue.LRU_CACHE=new ve(100)),r)null!=n&&(ue.LRU_CACHE.set(s,n),ue.blockRequest=!1);else for(const t in e)if(e.hasOwnProperty(t)){const i=e[t];if(ue.LRU_CACHE.cache[i]){s=i,a=!0;break}}if(a){s!==ue.LRU_CACHE.getLastKey()?i(this,Ot)[Ot]():(t=!1,he.saveToLSorCookie(D,t));const e=ue.LRU_CACHE.get(s);ue.LRU_CACHE.set(s,e),he.saveToLSorCookie(b,e),i(this,It)[It].gcookie=e;const o=ue.LRU_CACHE.getSecondLastKey();if(he.readFromLSorCookie(D)&&-1!==o){const e=ue.LRU_CACHE.cache[o];i(this,wt)[wt].unregisterTokenForGuid(e)}}else r?null!=n&&(i(this,It)[It].gcookie=n,he.saveToLSorCookie(b,n),t=!1):this.clear(),he.saveToLSorCookie(D,!1),s=e[0]}o.id=s,he.saveToLSorCookie(m,o)};if(Array.isArray(e)&&e.length>0)for(const n in e)if(e.hasOwnProperty(n)){const s=e[n];let r,a={};if(null!=s.Site){if(r=s.Site,ee(r)||!at(r,{logger:i(this,Ct)[Ct]}))return}else if(null!=s.Facebook){const e=s.Facebook;ee(e)||e.error||(r=lt(e))}else if(null!=s["Google Plus"]){const e=s["Google Plus"];ee(e)&&!e.error&&(r=dt(e,{logger:i(this,Ct)[Ct]}))}if(null!=r&&!ee(r)){a.type="profile",null==r.tz&&(r.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),a.profile=r;const e=[];he._isLocalStorageSupported()&&(r.Identity&&e.push(r.Identity),r.Email&&e.push(r.Email),r.GPID&&e.push("GP:"+r.GPID),r.FBID&&e.push("FB:"+r.FBID),e.length>0&&o(e)),ct(r,!0),a=i(this,wt)[wt].addSystemDataToObject(a,void 0),i(this,wt)[wt].addFlags(a),t&&(a.isOUL=!0);const n=Ze(JSON.stringify(a),i(this,Ct)[Ct]);let s=i(this,kt)[kt].dataPostURL;s=Ge(s,"type",A),s=Ge(s,"d",n),i(this,wt)[wt].saveAndFireRequest(s,ue.blockRequest,t)}}},Lt=function(){ue.blockRequest=!1,console.debug("Block request is false"),he._isLocalStorageSupported()&&(delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),he.removeCookie(y,Je()),he.removeCookie(i(this,xt)[xt].cookieName,ue.broadDomain),he.removeCookie(P,ue.broadDomain),i(this,xt)[xt].setSessionCookieObject("")},Tt=function(){ue.blockRequest=!0,i(this,Ct)[Ct].debug("Block request is true"),ue.globalCache={gcookie:null,REQ_N:0,RESP_N:0},he._isLocalStorageSupported()&&(delete localStorage.WZRK_G,delete localStorage.WZRK_K,delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),he.removeCookie(b,ue.broadDomain),he.removeCookie(y,Je()),he.removeCookie(m,Je()),he.removeCookie(i(this,xt)[xt].cookieName,ue.broadDomain),he.removeCookie(P,ue.broadDomain),i(this,It)[It].gcookie=null,i(this,xt)[xt].setSessionCookieObject("")},Rt=function(e){if(Array.isArray(e)&&e.length>0){const t=e.pop();if(null!=t&&Q(t)&&(null!=t.Site&&Object.keys(t.Site).length>0||null!=t.Facebook&&Object.keys(t.Facebook).length>0||null!=t["Google Plus"]&&Object.keys(t["Google Plus"]).length>0)){he.setInstantDeleteFlagInK();try{i(this,St)[St]([t])}catch(e){i(this,Ct)[Ct].debug(e)}}else i(this,Ct)[Ct].error("Profile object is in incorrect format")}};class jt extends HTMLElement{constructor(){super(),this._details=null,this.shadow=null,this.shadow=this.attachShadow({mode:"open"})}get details(){return this._details||""}set details(e){null===this._details&&(this._details=e,this.renderBanner())}renderBanner(){this.shadow.innerHTML=this.getBannerContent(),!1!==this.trackClick&&this.addEventListener("click",(()=>{const e=this.details.onClick;e&&(this.details.window?window.open(e,"_blank"):window.parent.location.href=e),window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId})}getBannerContent(){return'\n \n \n ")}}class Dt extends HTMLElement{constructor(){super(),this._target=null,this._carousel=null,this.shadow=null,this.slides=0,this.previouslySelectedItem=-1,this.selectedItem=1,this.autoSlide=null,this.stopAutoSlideTimeout=null,this.shadow=this.attachShadow({mode:"open"}),void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",jt)}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderCarousel())}get details(){return this.target.display.details}get display(){return this.target.display}renderCarousel(){this.slides=this.details.length,this.shadow.innerHTML=this.getStyles();const e=this.getCarouselContent();this.display.showNavBtns&&e.insertAdjacentHTML("beforeend",this.display.navBtnsHtml),this.display.showNavArrows&&(e.insertAdjacentHTML("beforeend",this.display.leftNavArrowHtml),e.insertAdjacentHTML("beforeend",this.display.rightNavArrowHtml)),this._carousel=e,this.shadow.appendChild(e),this.setupClick(),this.updateSelectedItem(),this.startAutoSlide(),this.setupOnHover(),window.clevertap.renderNotificationViewed({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot})}setupClick(){this._carousel.addEventListener("click",(e=>{const t=e.target.id;if(t.startsWith("carousel__button")){const e=+t.split("-")[1];e!==this.selectedItem&&(this.previouslySelectedItem=this.selectedItem,this.selectedItem=e,this.updateSelectedItem(),this.startAutoSlide())}else if(t.startsWith("carousel__arrow"))t.endsWith("right")?this.goToNext():this.goToPrev(),this.startAutoSlide();else if(t.indexOf("-")>-1){const e=+t.split("-")[1],i=e-1;window.parent.clevertap&&window.clevertap.renderNotificationClicked({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot,wzrk_slideNo:e});const o=this.details[i].onClick;""!==o&&(this.details[i].window?window.open(o,"_blank"):window.location.href=o)}}))}setupOnHover(){this._carousel.addEventListener("mouseenter",(e=>{this.stopAutoSlideTimeout=setTimeout((()=>{this.autoSlide=clearInterval(this.autoSlide)}),500)})),this._carousel.addEventListener("mouseleave",(e=>{clearTimeout(this.stopAutoSlideTimeout),void 0===this.autoSlide&&this.startAutoSlide()}))}getCarouselContent(){const e=document.createElement("div");return e.setAttribute("class","carousel"),this.details.forEach(((t,i)=>{const o=document.createElement("ct-web-personalisation-banner");o.classList.add("carousel__item"),o.trackClick=!1,o.setAttribute("id","carousel__item-".concat(i+1)),o.details=t,e.appendChild(o)})),e}getStyles(){var e,t;return"\n \n ")}updateSelectedItem(){if(-1!==this.previouslySelectedItem){const e=this.shadow.getElementById("carousel__item-".concat(this.previouslySelectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.previouslySelectedItem));e.classList.remove("carousel__item--selected"),t&&t.classList.remove("carousel__button--selected")}const e=this.shadow.getElementById("carousel__item-".concat(this.selectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.selectedItem));e.classList.add("carousel__item--selected"),t&&t.classList.add("carousel__button--selected")}startAutoSlide(){clearInterval(this.autoSlide),this.autoSlide=setInterval((()=>{this.goToNext()}),this.display.sliderTime?1e3*this.display.sliderTime:3e3)}goToNext(){this.goTo(this.selectedItem,(this.selectedItem+1)%this.slides)}goToPrev(){this.goTo(this.selectedItem,this.selectedItem-1)}goTo(e,t){this.previouslySelectedItem=e,this.selectedItem=t,0===t&&(this.selectedItem=this.slides),this.updateSelectedItem()}}class Bt extends HTMLElement{constructor(){super(),this._target=null,this._session=null,this.shadow=null,this.popup=null,this.container=null,this.resizeObserver=null,this.shadow=this.attachShadow({mode:"open"})}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderImageOnlyPopup())}get session(){return this._session||""}set session(e){this._session=e}get msgId(){return this.target.wzrk_id}get pivotId(){return this.target.wzrk_pivot}get onClickUrl(){return this.target.display.onClickUrl}renderImageOnlyPopup(){const e=this.target.wzrk_id.split("_")[0],t=this.session.sessionId;this.shadow.innerHTML=this.getImageOnlyPopupContent(),this.popup=this.shadowRoot.getElementById("imageOnlyPopup"),this.container=this.shadowRoot.getElementById("container"),this.closeIcon=this.shadowRoot.getElementById("close"),this.popup.addEventListener("load",this.updateImageAndContainerWidth()),this.resizeObserver=new ResizeObserver((()=>this.handleResize(this.popup,this.container))),this.resizeObserver.observe(this.popup),this.closeIcon.addEventListener("click",(()=>{if(this.resizeObserver.unobserve(this.popup),document.getElementById("wzrkImageOnlyDiv").style.display="none",this.remove(),null!=e&&"-1"!==e&&he._isLocalStorageSupported()){const i=ot();let o=i.wp[t];null==o&&(o={},i[t]=o),o[e]="dnd",nt(i)}})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId}),this.onClickUrl&&this.popup.addEventListener("click",(()=>{this.target.display.window?window.open(this.onClickUrl,"_blank"):window.parent.location.href=this.onClickUrl,window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})}))}handleResize(e,t){const i=this.getRenderedImageWidth(e);t.style.setProperty("width","".concat(i,"px"))}getImageOnlyPopupContent(){return"\n ".concat(this.target.msgContent.css,"\n ").concat(this.target.msgContent.html,"\n ")}updateImageAndContainerWidth(){return()=>{const e=this.getRenderedImageWidth(this.popup);this.popup.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("height","auto"),this.container.style.setProperty("position","fixed"),this.popup.style.setProperty("visibility","visible"),this.closeIcon.style.setProperty("visibility","visible"),document.getElementById("wzrkImageOnlyDiv").style.visibility="visible"}}getRenderedImageWidth(e){const t=e.naturalWidth/e.naturalHeight;return e.height*t}}class Nt extends HTMLElement{constructor(e,t){super(),this.wrapper=null,this.snackBar=null,this.shadow=this.attachShadow({mode:"open"}),this.config=e,this.message=t,this.renderMessage(t)}get pivotId(){return this.message.wzrk_pivot}get campaignId(){return this.message.wzrk_id}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}renderMessage(e){switch(this.wrapper=this.createEl("div","messageWrapper"),e.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":{const t=this.prepareBasicMessage(e.msg[0]);this.wrapper.appendChild(t)}}const t=this.createEl("div","timeStamp");if(t.innerHTML="".concat(Jt(e.id.split("_")[1]),""),!e.viewed){const e=this.createEl("span","unreadMarker");t.appendChild(e)}this.wrapper.appendChild(t),this.shadow.appendChild(this.wrapper)}prepareBasicMessage(e){const t=this.createEl("div","message");if(e.imageUrl){const i=this.addImage(e.imageUrl,"mainImg");t.appendChild(i)}const i=this.createEl("div","iconTitleDescWrapper");if(e.iconUrl){const t=this.addImage(e.iconUrl,"iconImg");i.appendChild(t)}const o=this.createEl("div","titleDescWrapper");if(e.title){const t=this.createEl("div","title");t.innerText=e.title,o.appendChild(t)}if(e.description){const t=this.createEl("div","description");t.innerText=e.description,o.appendChild(t)}if((e.title||e.description)&&i.appendChild(o),(e.iconUrl||e.title||e.description)&&t.appendChild(i),e.buttons&&e.buttons.length){const i=this.addButtons(e.buttons);t.appendChild(i)}return t}addButtons(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.createEl("div","buttonsContainer");let i=!1;return e.forEach(((e,o)=>{const n=this.createEl("button","button-".concat(o),"button");n.innerText=e.text,o>0&&(n.style.cssText+="margin-left: 2px;"),"copy"===e.action&&(i=!0),t.appendChild(n)})),i&&this.addSnackbar(t),t}addSnackbar(e){this.snackBar=this.createEl("div","snackbar-".concat(this.campaignId),"snackbar"),this.snackBar.innerHTML=Yt;const t=this.createEl("span","snackbar-msg-".concat(this.campaignId),"snackbar-msg");t.innerText="Copied to clipboard",this.snackBar.appendChild(t),e.appendChild(this.snackBar)}addImage(e,t){const i=this.createEl("div","".concat(t,"Container")),o=this.createEl("img",t);return o.setAttribute("src",e),o.setAttribute("loading","lazy"),i.appendChild(o),i}raiseClickedEvent(e,t){switch(this.message.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":this.raiseClickedForBasicTemplates(e,t)}}raiseClickedForBasicTemplates(e,t){const i=this.message.msg[0],o={msgId:this.campaignId,pivotId:this.pivotId};if("BUTTON"===e.tagName){const t=e.id.split("-")[1],n=i.buttons[t];o.kv={wzrk_c2a:n.text},"url"===n.action?n.openUrlInNewTab?window.open(n.url,"_blank"):window.location=n.url:"copy"===n.action&&(window.focus(),navigator.clipboard.writeText(n.clipboardText),this.snackBar.style.setProperty("display","flex","important"),setTimeout((()=>{this.snackBar.style.setProperty("display","none","important")}),2e3))}else"CT-INBOX-MESSAGE"===e.tagName&&i.onClickUrl&&(i.openUrlInNewTab?window.open(i.onClickUrl,"_blank"):window.location=i.onClickUrl);t?console.log("Notifiction clicked event will be raised at run time with payload ::",o):window.clevertap.renderNotificationClicked(o)}}class zt extends HTMLElement{constructor(e){super(),this.isInboxOpen=!1,this.isInboxFromFlutter=!1,this.selectedCategory=null,this.unviewedMessages={},this.unviewedCounter=0,this.isPreview=!1,this.inboxConfigForPreview={},this.inboxSelector=null,this.inbox=null,this.emptyInboxMsg=null,this.inboxCard=null,this.unviewedBadge=null,this.observer=null,this.selectedCategoryRef=null,this.addClickListenerOnDocument=(()=>e=>{if(e.composedPath().includes(this.inbox)){const t=e.path||e.composedPath&&e.composedPath();if(t.length){const e=t[0].id;if("closeInbox"===e)this.toggleInbox();else if(e.startsWith("category-"))this.prevCategoryRef=this.selectedCategoryRef,this.selectedCategoryRef=t[0],this.updateActiveCategory(t[0].innerText);else{const e=t.filter((e=>{var t;return(null===(t=e.id)||void 0===t?void 0:t.startsWith("button-"))||"CT-INBOX-MESSAGE"===e.tagName}));if(e.length){e[e.length-1].raiseClickedEvent(e[0],this.isPreview)}}}}else(this.inboxSelector.contains(e.target)||this.isInboxOpen)&&(this.isInboxFromFlutter?this.isInboxFromFlutter=!1:this.toggleInbox(e))})(),this.setBadgeStyle=e=>{null!==this.unviewedBadge&&(this.unviewedBadge.innerText=e>9?"9+":e,this.unviewedBadge.style.display=e>0?"flex":"none")},this.logger=e,this.shadow=this.attachShadow({mode:"open"})}get incomingMessages(){return[]}set incomingMessages(e){void 0===e&&(e=[]),e.length>0&&this.inbox&&this.updateInboxMessages(e)}get incomingMessagesForPreview(){return[]}set incomingMessagesForPreview(e){void 0===e&&(e=[]);const t={};e.length>0&&this.inbox&&(this.isPreview=!0,this.unviewedCounter=0,e.forEach((e=>{const i="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=i,t[i]=e,this.unviewedMessages[i]=e,this.unviewedCounter++})),this.buildUIForMessages(t),this.updateUnviewedBadgeCounter())}connectedCallback(){this.init()}init(){this.config=this.isPreview?this.inboxConfigForPreview:he.readFromLSorCookie(q)||{},0!==Object.keys(this.config).length&&(this.inboxSelector=document.getElementById(this.config.inboxSelector),null!==this.inboxSelector&&(this.config.styles.notificationsBadge?this.addUnviewedBadge():this.unviewedBadge&&this.unviewedBadge.remove(),this.createinbox(),document.removeEventListener("click",this.addClickListenerOnDocument),document.addEventListener("click",this.addClickListenerOnDocument),this.config.categories.length&&this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadow.innerHTML=this.getInboxStyles(),this.shadow.appendChild(this.inbox)))}addMsgsToInboxFromLS(){const e=this.deleteExpiredAndGetUnexpiredMsgs(!1),t=e?Object.keys(e):[];0!==t.length&&(t.forEach((t=>{e[t].viewed||(this.unviewedMessages[t]=e[t],this.unviewedCounter++)})),this.buildUIForMessages(e),this.updateUnviewedBadgeCounter())}deleteExpiredAndGetUnexpiredMsgs(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Vt();const i=Math.floor(Date.now()/1e3);for(const o in t)if(t[o].wzrk_ttl&&t[o].wzrk_ttl>0&&t[o].wzrk_ttl0&&(t=Object.values(t).sort(((e,t)=>t.date-e.date)).reduce(((e,t)=>(e[t.id]=t,e)),{})),Wt(t),t}updateInboxMessages(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.deleteExpiredAndGetUnexpiredMsgs(),i=Date.now(),o={};e.forEach(((e,n)=>{const s="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=s,e.date=i-n,e.viewed=0,t[s]=e,o[s]=e,this.unviewedMessages[s]=e,this.unviewedCounter++})),Wt(t),this.buildUIForMessages(o),this.updateUnviewedBadgeCounter()}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}addUnviewedBadge(){this.unviewedBadge||(this.unviewedBadge=this.createEl("div","unviewedBadge"),this.unviewedBadge.style.cssText="display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ".concat(this.config.styles.notificationsBadge.backgroundColor,"; font-size: 12px; color: ").concat(this.config.styles.notificationsBadge.textColor,"; font-weight: bold; align-items: center; justify-content: center;"),document.body.appendChild(this.unviewedBadge)),this.updateUnviewedBadgePosition(),window.addEventListener("resize",(()=>{this.updateUnviewedBadgePosition()}))}updateUnviewedBadgePosition(){const{top:e,right:t}=this.inboxSelector.getBoundingClientRect();this.unviewedBadge.style.top="".concat(e-8,"px"),this.unviewedBadge.style.left="".concat(t-8,"px")}createinbox(){this.inbox=this.createEl("div","inbox");const e=this.createEl("div","header"),t=this.createEl("div","headerTitle");t.innerText=this.config.title;const i=this.createEl("div","closeInbox");if(i.innerHTML="×",e.appendChild(t),e.appendChild(i),this.inbox.appendChild(e),this.config.categories.length){const e=this.createCategories();this.inbox.appendChild(e)}this.inboxCard=this.createEl("div","inboxCard"),this.inbox.appendChild(this.inboxCard),this.emptyInboxMsg=this.createEl("div","emptyInboxMsg"),this.emptyInboxMsg.innerText="All messages will be displayed here.",this.inboxCard.appendChild(this.emptyInboxMsg);const o={root:this.inboxCard,rootMargin:"0px",threshold:.5};this.observer=new IntersectionObserver(((e,t)=>{this.handleMessageViewed(e)}),o),this.addMsgsToInboxFromLS()}createCategories(){const e=this.createEl("div","categoriesContainer"),t=this.createEl("div","leftArrow");t.innerHTML=$t,t.children[0].style="transform: rotate(180deg)",t.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(-70,0)})),e.appendChild(t);const i=this.createEl("div","categoriesWrapper");["All",...this.config.categories].forEach(((e,t)=>{const o=this.createEl("div","category-".concat(t),"category");o.innerText=e,0===t&&(this.selectedCategoryRef=o),i.appendChild(o)})),e.appendChild(i);const o=this.createEl("div","rightArrow");o.innerHTML=$t,o.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(70,0)})),e.appendChild(o);const n={root:e,threshold:.9},s=i.children[0],r=i.children[this.config.categories.length];new IntersectionObserver((e=>{this.categoryObserverCb(t,e[0].intersectionRatio>=.9)}),n).observe(s);return new IntersectionObserver((e=>{this.categoryObserverCb(o,e[0].intersectionRatio>=.9)}),n).observe(r),e}categoryObserverCb(e,t){e&&(e.style.display=t?"none":"flex")}updateActiveCategory(e){this.selectedCategory=e,this.inboxCard.scrollTop=0;let t=0;this.prevCategoryRef&&this.prevCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef.setAttribute("selected","true"),this.inboxCard.childNodes.forEach((e=>{"emptyInboxMsg"!==e.getAttribute("id")&&(e.style.display="All"===this.selectedCategory||e.getAttribute("category")===this.selectedCategory?"block":"none","block"===e.style.display&&t++)})),0===t?(this.emptyInboxMsg.innerText="".concat(e," messages will be displayed here."),this.emptyInboxMsg.style.display="block"):this.emptyInboxMsg.style.display="none"}buildUIForMessages(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!this.isPreview&&this.updateTSForRenderedMsgs(),this.inboxCard.scrollTop=0;const i=null!==(e=this.config.maxMsgsInInbox)&&void 0!==e?e:15,o=this.inboxCard.firstChild,n=Object.values(t).sort(((e,t)=>t.date-e.date)).map((e=>e.id));for(const e of n){const i=new Nt(this.config,t[e]);i.setAttribute("id",t[e].id),i.setAttribute("pivot",t[e].wzrk_pivot),i.setAttribute("part","ct-inbox-message"),this.config.categories.length>0?(i.setAttribute("category",t[e].tags[0]||""),i.style.display="All"===this.selectedCategory||t[e].category===this.selectedCategory?"block":"none"):i.style.display="block",this.inboxCard.insertBefore(i,o),this.observer.observe(i)}let s=this.inboxCard.querySelectorAll("ct-inbox-message").length;for(;s>i;){const e=this.inboxCard.querySelectorAll("ct-inbox-message");e.length>0&&e[e.length-1].remove(),s--}const r=this.inboxCard.querySelectorAll('ct-inbox-message[style*="display: block"]').length;this.emptyInboxMsg.style.display=r?"none":"block"}handleMessageViewed(e){const t=!this.isPreview;this.isInboxOpen&&e.forEach((e=>{e.isIntersecting&&this.unviewedMessages.hasOwnProperty(e.target.id)&&0===e.target.message.viewed&&(e.target.message.viewed=1,t?(window.clevertap.renderNotificationViewed({msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.updateMessageInLS(e.target.id,{...e.target.message,viewed:1}),setTimeout((()=>{e.target.shadowRoot.getElementById("unreadMarker").style.display="none"}),1e3)):console.log("Notifiction viewed event will be raised at run time with payload ::",{msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.unviewedCounter--,this.updateUnviewedBadgeCounter(),delete this.unviewedMessages[e.target.id])}))}updateMessageInLS(e,t){if(!this.isPreview){const i=Vt();i[e]=t,Wt(i)}}toggleInbox(e){this.isInboxOpen=!this.isInboxOpen,this.isInboxFromFlutter=!!(null==e?void 0:e.rect),this.isInboxOpen?(this.inboxCard.scrollTop=0,!this.isPreview&&this.deleteExpiredAndGetUnexpiredMsgs(),this.inbox.style.display="block",this.inbox.style.zIndex="2147483647",this.config.categories.length&&(this.selectedCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef=this.shadowRoot.getElementById("category-0"),this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadowRoot.getElementById("categoriesWrapper").scrollLeft-=this.shadowRoot.getElementById("categoriesWrapper").scrollWidth),this.setInboxPosition(e)):this.inbox.style.display="none"}setInboxPosition(e){const t=window.outerWidth,i=getComputedStyle(ue.inbox),o=i.getPropertyValue("--inbox-top"),n=i.getPropertyValue("--inbox-bottom"),s=i.getPropertyValue("--inbox-left"),r=i.getPropertyValue("--inbox-right");if(t>481&&!(o||n||s||r)){const t=Gt(e,this.inbox.clientHeight,this.inbox.clientWidth),i=t.xPos,o=t.yPos;this.inbox.style.top=o+"px",this.inbox.style.left=i+"px"}}updateUnviewedBadgeCounter(){if(this.isPreview)return void this.setBadgeStyle(this.unviewedCounter);let e=0;this.inboxCard.querySelectorAll("ct-inbox-message").forEach((t=>{const i=Vt();i[t.id]&&0===i[t.id].viewed&&e++})),this.setBadgeStyle(e)}updateTSForRenderedMsgs(){this.inboxCard.querySelectorAll("ct-inbox-message").forEach((e=>{const t=e.id.split("_")[1];e.shadow.getElementById("timeStamp").firstChild.innerText=Jt(t)}))}getInboxStyles(){const e=this.config.categories.length?64:16,t={panelBackgroundColor:this.config.styles.panelBackgroundColor,panelBorderColor:this.config.styles.panelBorderColor,headerBackgroundColor:this.config.styles.header.backgroundColor,headerTitleColor:this.config.styles.header.titleColor,closeIconColor:this.config.styles.closeIconColor,categoriesTabColor:this.config.styles.categories.tabColor,categoriesTitleColor:this.config.styles.categories.titleColor,selectedCategoryTabColor:this.config.styles.categories.selectedTab.tabColor,selectedCategoryTitleColor:this.config.styles.categories.selectedTab.titleColor,headerCategoryHeight:36+e};this.config.styles.categories.borderColor&&(t.categoriesBorderColor=this.config.styles.categories.borderColor),this.config.styles.categories.selectedTab.borderColor&&(t.selectedCategoryBorderColor=this.config.styles.categories.selectedTab.borderColor);const i=(e=>{let{panelBackgroundColor:t,panelBorderColor:i,headerBackgroundColor:o,headerTitleColor:n,closeIconColor:s,categoriesTabColor:r,categoriesTitleColor:a,categoriesBorderColor:l,selectedCategoryTabColor:d,selectedCategoryTitleColor:c,selectedCategoryBorderColor:h,headerCategoryHeight:u}=e;return'\n \n ")})(t),o=this.config.styles.cards;return i+(e=>{let{backgroundColor:t,borderColor:i,titleColor:o,descriptionColor:n,buttonColor:s,buttonTextColor:r,unreadMarkerColor:a}=e;return'\n \n ")})({backgroundColor:o.backgroundColor,borderColor:o.borderColor,titleColor:o.titleColor,descriptionColor:o.descriptionColor,buttonColor:o.buttonColor,buttonTextColor:o.buttonTextColor,unreadMarkerColor:o.unreadMarkerColor})}}const Ut=e=>{e.inbox_preview?ue.inbox.incomingMessagesForPreview=e.inbox_notifs:ue.inbox.incomingMessages=e},Ft=e=>{Ht(),ue.inbox=new zt({logger:e}),document.body.appendChild(ue.inbox)},qt=e=>{const t=he.readFromLSorCookie(V)||{};if(Object.keys(t).length>0&&Object.keys(t)[0].includes("_")){const i={};return i[e]=t,he.saveToLSorCookie(V,i),i}return t},Vt=()=>{const e=JSON.parse(decodeURIComponent(he.read(b)));if(!oe(e))return{};const t=qt(e);return t.hasOwnProperty(e)?t[e]:{}},Wt=e=>{const t=JSON.parse(decodeURIComponent(he.read(b)));if(!oe(t))return;const i={...qt(t),[t]:e};he.saveToLSorCookie(V,i)},Kt=e=>new Promise(((t,i)=>{if("complete"===document.readyState)Ft(e),t();else{const i=he.readFromLSorCookie(q)||{},o=()=>{null===ue.inbox&&Ft(e),t()};window.addEventListener("load",(()=>{if(document.getElementById(i.inboxSelector))o();else{let n=0;if(n<20){const s=setInterval((()=>{document.getElementById(i.inboxSelector)?(o(),clearInterval(s),t()):n>=20&&(clearInterval(s),e.debug("Failed to add inbox")),n++}),500)}}}))}})),Ht=()=>{void 0===customElements.get("ct-web-inbox")&&(customElements.define("ct-web-inbox",zt),customElements.define("ct-inbox-message",Nt))},Gt=(e,t,i)=>{const o=document.scrollingElement.scrollLeft,n=document.scrollingElement.scrollTop,s=window.innerWidth+o,r=window.innerHeight+n,a=e.rect||e.target.getBoundingClientRect(),l=a.x+o,d=a.y+n,c=a.left+o,h=a.right+o,u=a.top+n,p=a.bottom,g=a.height,v=a.width;let f,b,m=!1;const y=16;if(p+t<=r){const e=r-(p+t);b=e>=y?p+y:p+e}else if(u-t>=n){const e=u-t;b=e>=y?u-t-y:u-t-e}else m=!0,b=d+g/2-t/2,br&&(b=r-t);if(m){const e=h+i;if(e<=s){f=h+(e+y<=s?y:s-e)}else{const e=c-i;f=e-(e-y>=o?y:e-o)}}else f=l+v/2-i/2,fs&&(f=h-i>=o?h-i:s-i);return{xPos:f,yPos:b}},Jt=e=>{const t=Date.now();let i=Math.floor((t-e)/6e4);return i<5?"Just now":i<60?"".concat(i," minute").concat(i>1?"s":""," ago"):(i=Math.floor(i/60),i<24?"".concat(i," hour").concat(i>1?"s":""," ago"):(i=Math.floor(i/24),"".concat(i," day").concat(i>1?"s":""," ago")))},Zt=()=>Object.keys(he.readFromLSorCookie(q)||{}).length>0,$t='\n\n\n',Yt='\n\n\n',Qt="https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js",Xt="https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css",ei=(e,t,i)=>{document.addEventListener("DOMContentLoaded",(()=>function(e,t,i){document.body.innerHTML="",ti=document.createElement("div"),ti.id="overlayDiv",ti.style.position="relative",ti.style.display="flex",document.body.appendChild(ti);(function(e,t,i,o){return new Promise(((n,s)=>{var r=document.createElement("script");r.type="module",r.src=e,r.onload=function(){"function"==typeof window.Overlay?(window.Overlay("#overlayDiv",t,i,o),n()):s(new Error("ContentLayout not found in overlay.js"))},r.onerror=function(e){s(e)},document.head.appendChild(r)}))})(Qt,e,t,i).then((()=>{console.log("Overlay script loaded successfully.")})).catch((e=>{console.error("Error loading overlay script:",e)})),o=document.createElement("link"),o.rel="stylesheet",o.type="text/css",o.href=Xt,document.head.appendChild(o),function(){const e={kitId:"eqj6nom",scriptTimeout:3e3,async:!0},t=document.documentElement,i=setTimeout((function(){t.className=t.className.replace(/\bwf-loading\b/g,"")+" wf-inactive"}),e.scriptTimeout),o=document.createElement("script");let n=!1;const s=document.getElementsByTagName("script")[0];let r;t.className+=" wf-loading",o.src="https://use.typekit.net/"+e.kitId+".js",o.async=!0,o.onload=o.onreadystatechange=function(){if(r=this.readyState,!(n||r&&"complete"!==r&&"loaded"!==r)){n=!0,clearTimeout(i);try{Typekit.load(e)}catch(e){}}},s.parentNode.insertBefore(o,s)}();var o}(e,t,i)))};let ti;const ii=(e,t)=>{const i=t?e.details[0]:e.display.details[0],o=Object.keys(i)[0],n=i[o];if(o===window.location.href.split("?")[0])for(const i in n){const o=document.querySelector(i);if(o)n[i].html?o.outerHTML=n[i].html:oi(e,n[i]),t||window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot});else{let o=0;const s=setInterval((()=>{const r=document.querySelector(i);r?(n[i].html?r.outerHTML=n[i].html:oi(e,n[i]),t||window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot}),clearInterval(s)):(o++,o>=20&&(console.log("No element present on DOM with selector '".concat(i,"'.")),clearInterval(s)))}),500)}}};function oi(e,t){const i={};i.msgId=e.wzrk_id,e.wzrk_pivot&&(i.pivotId=e.wzrk_pivot),null!=t.json&&(i.json=t.json);const o=new CustomEvent("CT_web_native_display_buider",{detail:i});document.dispatchEvent(o)}const ni=e=>{const t=e.indexOf("\n `\n return html.replace(/(<\\s*\\/\\s*body)/, `${script}\\n$1`)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n const displayObj = targetingMsgJson.display\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = WIZ_IFRAME_INTENT\n let html = targetingMsgJson.msgContent.html\n if (displayObj['custom-editor'] && !displayObj['bee-editor'] && displayObj['custom-html-sandbox']) { // sandbox the iframe only for custom html\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox allow-forms' // allow popup to open url in new page\n html = ctEventhandler(html)\n }\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (targetingMsgJson.display['custom-editor'] && !targetingMsgJson.display['bee-editor'] && targetingMsgJson.display['custom-html-sandbox']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n let contentDiv\n iframe.onload = () => {\n if (targetingMsgJson.display['custom-editor'] && !targetingMsgJson.display['bee-editor'] && targetingMsgJson.display['custom-html-sandbox']) {\n window.addEventListener('message', event => {\n switch (event?.data?.action) {\n case GET_NOTIFICATION_DATA:\n window.clevertap.renderNotificationClicked(event.data.value)\n break\n case EVENT:\n window.clevertap.event.push(event.data.value)\n break\n case PROFILE:\n window.clevertap.profile.push(event.data.value)\n break\n case OUL:\n window.clevertap.onUserLogin.push(event.data.value)\n break\n case CLOSE_INTERSTITIAL_POPUP:\n setTimeout(() => {\n const interstitialWrapper = window.document.getElementById('intentPreview')\n const interstitialOverlay = window.document.getElementById('intentOpacityDiv')\n interstitialOverlay && interstitialOverlay.remove()\n interstitialWrapper && interstitialWrapper.remove()\n }, 0)\n break\n default:\n // Handle unknown action\n break\n }\n })\n contentDiv = ''\n } else {\n contentDiv = document.getElementById(WIZ_IFRAME_INTENT).contentDocument.getElementById('contentDiv')\n }\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n this.#logger.error('Error subscribing: ' + error)\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { initialiseCTBuilder, renderVisualBuilder } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token) {\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n #handleMessageEvent (event) {\n if (event.data && event.data.message) {\n if (event.data.message === 'Dashboard' && event.data.url) {\n initialiseCTBuilder(event.data.url, event.data.variant ?? null, event.data.details ?? {})\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n }\n }\n\n pageChanged () {\n const search = window.location.search\n const parentWindow = window.opener\n\n if (search === '?ctBuilder') {\n // open in visual builder mode\n console.log('open in visual builder mode')\n window.addEventListener('message', this.#handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('builder', '*')\n }\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', this.#handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('preview', '*')\n }\n return\n }\n\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","constructor","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","dataPostPEURL","dataPostURL","recorderURL","emailURL","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","WIZ_IFRAME","WIZ_IFRAME_INTENT","ADJUST_IFRAME_HEIGHT","UPDATE_HEIGHT","GET_NOTIFICATION","EVENT","PROFILE","OUL","CLOSE_BOX_POPUP","CLOSE_BANNER_POPUP","GET_NOTIFICATION_DATA","CLOSE_INTERSTITIAL_POPUP","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","save","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","read","data","getItem","parse","e","remove","removeItem","removeCookie","name","domain","cookieStr","document","cookie","createCookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","readCookie","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","saveToLSorCookie","property","location","hostname","$ct","globalCache","readFromLSorCookie","trim","err","createBroadCookie","broadDomain","domainParts","testBroadDomain","testCookieName","tempCookie","getMetaProp","metaObj","setMetaProp","wzrkMetaObj","getAndClearMetaProp","setInstantDeleteFlagInK","k","flag","backupEvent","reqNo","backupArr","q","debug","removeBackup","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","get","item","saveCacheToLS","set","allKeys","objToArray","index","temp","getKey","getSecondLastKey","keysArr","getLastKey","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","s","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","sessionObj","getSessionCookieObject","kIdFromLS","guidFromLRUCache","lastK","lastGUID","unregisterTokenForGuid","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","_processOldValues","getDetails","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","fireRequest","skipARP","sendOULFlag","getDelayFrequency","account","randomDelay","random","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","ProfileHandler","profilesArr","getAttribute","propName","_handleIncrementDecrementValue","command","tz","profile","addSystemDataToObject","addFlags","compressedData","saveAndFireRequest","_handleMultiValueSet","arrayVal","array","toLowerCase","sendMultiValueData","_handleMultiValueAdd","propKey","propVal","_handleMultiValueRemove","_handleMultiValueDelete","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","clear","addToK","ids","g","kId","anonymousUser","foundInCache","gFromCache","Identity","cookieName","loginArr","pop","processProfile","CTWebPersonalisationBanner","HTMLElement","_details","shadow","attachShadow","mode","details","renderBanner","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","target","renderCarousel","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","button","setInterval","sliderTime","goTo","prev","cur","CTWebPopupImageOnly","_session","popup","container","resizeObserver","renderImageOnlyPopup","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","Message","config","message","wrapper","snackBar","renderMessage","createEl","part","_el","msg","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","raiseClickedEvent","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","contains","setBadgeStyle","msgCount","incomingMessages","msgs","updateInboxMessages","incomingMessagesForPreview","previewMsgs","now","buildUIForMessages","updateUnviewedBadgeCounter","connectedCallback","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","addMsgsToInboxFromLS","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","deleteMsgsFromUI","getInboxMessages","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","top","right","getBoundingClientRect","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","inbox_notifs","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","OVERLAY_PATH","CSS_PATH","initialiseCTBuilder","variant","onContentLoad","position","overlayPath","loadOverlayScript","then","catch","loadCSS","loadTypeKit","link","rel","head","script","src","onload","Overlay","Error","onerror","kitId","scriptTimeout","docElement","documentElement","timeoutId","className","typeKitScript","scriptLoaded","firstScript","scriptReadyState","onreadystatechange","Typekit","load","renderVisualBuilder","targetingMsgJson","siteUrl","selectors","selector","element","querySelector","outerHTML","dispatchJsonData","intervalId","retryElement","inaObj","json","kvPairsEvent","CustomEvent","dispatchEvent","ctEventhandler","ctScript","insertPosition","join","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","onclick","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","sandbox","pointerCss","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","closeCampaign","Event","appendScriptForCustomEvent","srcdoc","handleMessage","heightAdjust","boxWrapper","bannerWrapper","margin","onUserLogin","handleIframeLoad","contentWindow","postMessage","contentDocument","scrollHeight","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","interstitialWrapper","interstitialOverlay","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","getTotalVisits","visitCount","getLastVisit","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","info","debugPE","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","getTimeElapsed","sessionStart","getPageCount","seqNo","requestTime","RequestManager","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","post","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","_enableWebPush","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","skipDialog","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","getValue","getdefaultValue","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","addValueChangedCallback","removeValueChangedCallback","clearStartFlag","VariableStore","syncVariables","onSyncSuccess","onSyncFailure","meta","tk","r","status","fetchVariables","onFetchCallback","addVariablesChangedCallback","callback","addOneTimeVariablesChangedCallback","removeVariablesChangedCallback","removeOneTimeVariablesChangedCallback","callBack","CleverTap","spa","isSpa","bind","enablePersonalization","_isPersonalisationActive","ReqestManager","privacy","notifications","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","handleDecrementValue","setMultiValuesForKey","addMultiValueForKey","addMultiValuesForKey","removeMultiValueForKey","removeMultiValuesForKey","removeValueForKey","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","sendLocationData","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","elements","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","parentWindow","opener","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","setOffline","arg","defineVariable","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;EAAO,MAAMA,aAAa,GAAG,oBAAtB;EACA,MAAMC,eAAe,GAAG,QAAxB;EACA,MAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;ECAQ,MAAMC,OAAN,CAAc;EAO3BC,EAAAA,WAAW,GAAsE;EAAA,QAApE;EAAEC,MAAAA;EAAF,KAAoE,uEAA3D,EAA2D;EAAA,QAAvDC,MAAuD,uEAA9C,EAA8C;EAAA,QAA1CC,YAA0C,uEAA3BP,aAA2B;EAAA,QAAZQ,KAAY,uEAAJ,EAAI;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,aALvE;EAKuE;EAAA;EAAA;EAAA,aAJjER;EAIiE;EAAA;EAAA;EAAA,aAHjE;EAGiE;EAAA;EAAA;EAAA,aAFxE;EAEwE;EAC/E,SAAKK,EAAL,GAAUA,EAAV;;EACA,QAAIC,MAAJ,EAAY;EACV,WAAKA,MAAL,GAAcA,MAAd;EACD;;EACD,QAAIC,YAAJ,EAAkB;EAChB,WAAKA,YAAL,GAAoBA,YAApB;EACD;;EACD,QAAIC,KAAJ,EAAW;EACT,WAAKA,KAAL,GAAaA,KAAb;EACD;EACF;;EAED,MAAIH,EAAJ,GAAU;EACR,uCAAO,IAAP;EACD;;EAED,MAAIA,EAAJ,CAAQI,SAAR,EAAmB;EACjB,gEAAkBA,SAAlB;EACD;;EAED,MAAIH,MAAJ,GAAc;EACZ,uCAAO,IAAP;EACD;;EAED,MAAIA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wBAAL,EAAJ,EAAqC;EACnCpmC,IAAAA,IAAI,CAAC8+B,KAAL,GAAa,IAAb;EACD;EACF;;QC3xBGpvB,SAAS,GAAG,IAAIw9B,SAAJ,CAActrC,MAAM,CAAC8N,SAArB;EAElB9N,MAAM,CAAC8N,SAAP,GAAmB9N,MAAM,CAAC+N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/modules/visualBuilder/builder_constants.js","src/modules/visualBuilder/pageBuilder.js","src/util/clevertap-handler.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/notification.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\nexport const WIZ_IFRAME = 'wiz-iframe'\nexport const WIZ_IFRAME_INTENT = 'wiz-iframe-intent'\nexport const ADJUST_IFRAME_HEIGHT = 'adjustIFrameHeight'\nexport const UPDATE_HEIGHT = 'update height'\nexport const GET_NOTIFICATION = 'getnotif'\nexport const EVENT = 'Event'\nexport const PROFILE = 'Profile'\nexport const OUL = 'OUL'\nexport const CLOSE_BOX_POPUP = 'closeBoxPopUp'\nexport const CLOSE_BANNER_POPUP = 'closeBannerPopUp'\nexport const GET_NOTIFICATION_DATA = 'getnotifData'\nexport const CLOSE_INTERSTITIAL_POPUP = 'closeInterstitialPopUp'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {}\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n // Initialize array\n var array = []\n\n // Check if globalProfileMap is null, initialize if needed\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n // Check if the value to be set is either string or number\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = $ct.globalProfileMap[propKey]\n array.push(typeof propVal === 'number' ? propVal : propVal.toLowerCase())\n } else {\n $ct.globalProfileMap[propKey] = propVal\n }\n } else {\n // Check if propVal is an array\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = Array.isArray($ct.globalProfileMap[propKey]) ? $ct.globalProfileMap[propKey] : [$ct.globalProfileMap[propKey]]\n }\n\n // Check for case-sensitive inputs and filter the same ones\n for (var i = 0; i < propVal.length; i++) {\n if (typeof propVal[i] === 'number' && !array.includes(propVal[i])) {\n array.push(propVal[i])\n } else if (typeof propVal[i] === 'string' && !array.includes(propVal[i].toLowerCase())) {\n array.push(propVal[i].toLowerCase())\n } else if ((typeof propVal[i] === 'number' && array.includes(propVal[i])) || (typeof propVal[i] === 'string' && array.includes(propVal[i].toLowerCase()))) {\n console.error('Values already included')\n } else {\n console.error('Array supports only string or number type values')\n }\n }\n\n // Update globalProfileMap with the array\n $ct.globalProfileMap[propKey] = array\n }\n\n // Save to local storage or cookie\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Call the sendMultiValueData function\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n var index = $ct.globalProfileMap[propKey].indexOf(propVal)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n } else {\n for (var k = 0; k < propVal.length; k++) {\n var idx = $ct.globalProfileMap[propKey].indexOf(propVal[k])\n if (idx !== -1) {\n $ct.globalProfileMap[propKey].splice(idx, 1)\n }\n }\n }\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n // console.log('Raise notification clicked event for ', item)\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","export const OVERLAY_PATH = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js'\nexport const CSS_PATH = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css'\n","import { CSS_PATH, OVERLAY_PATH } from './builder_constants'\n\n/**\n * Initializes the Clevertap builder.\n * @param {string} url - The URL to initialize the builder.\n * @param {string} variant - The variant of the builder.\n * @param {Object} details - The details object.\n */\nexport const initialiseCTBuilder = (url, variant, details) => {\n document.addEventListener('DOMContentLoaded', () => onContentLoad(url, variant, details))\n}\n\nlet container\n/**\n * Handles content load for Clevertap builder.\n */\nfunction onContentLoad (url, variant, details) {\n document.body.innerHTML = ''\n container = document.createElement('div')\n container.id = 'overlayDiv'\n container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form\n container.style.display = 'flex'\n document.body.appendChild(container)\n const overlayPath = OVERLAY_PATH\n loadOverlayScript(overlayPath, url, variant, details)\n .then(() => {\n console.log('Overlay script loaded successfully.')\n })\n .catch((error) => {\n console.error('Error loading overlay script:', error)\n })\n loadCSS()\n loadTypeKit()\n}\n\n/**\n * Loads CSS file.\n */\nfunction loadCSS () {\n var link = document.createElement('link')\n link.rel = 'stylesheet'\n link.type = 'text/css'\n link.href = CSS_PATH\n document.head.appendChild(link)\n}\n\n/**\n * Loads the overlay script.\n * @param {string} overlayPath - The path to overlay script.\n * @param {string} url - The URL.\n * @param {string} variant - The variant.\n * @param {Object} details - The details object.\n * @returns {Promise} A promise.\n */\nfunction loadOverlayScript (overlayPath, url, variant, details) {\n return new Promise((resolve, reject) => {\n var script = document.createElement('script')\n script.type = 'module'\n script.src = overlayPath\n script.onload = function () {\n if (typeof window.Overlay === 'function') {\n window.Overlay('#overlayDiv', url, variant, details)\n resolve()\n } else {\n reject(new Error('ContentLayout not found in overlay.js'))\n }\n }\n script.onerror = function (error) {\n reject(error)\n }\n document.head.appendChild(script)\n })\n}\n\n/**\n * Loads TypeKit script.\n */\nfunction loadTypeKit () {\n const config = {\n kitId: 'eqj6nom',\n scriptTimeout: 3000,\n async: true\n }\n\n const docElement = document.documentElement\n const timeoutId = setTimeout(function () {\n docElement.className = docElement.className.replace(/\\bwf-loading\\b/g, '') + ' wf-inactive'\n }, config.scriptTimeout)\n const typeKitScript = document.createElement('script')\n let scriptLoaded = false\n const firstScript = document.getElementsByTagName('script')[0]\n let scriptReadyState\n\n docElement.className += ' wf-loading'\n typeKitScript.src = 'https://use.typekit.net/' + config.kitId + '.js'\n typeKitScript.async = true\n typeKitScript.onload = typeKitScript.onreadystatechange = function () {\n scriptReadyState = this.readyState\n if (scriptLoaded || (scriptReadyState && scriptReadyState !== 'complete' && scriptReadyState !== 'loaded')) return\n scriptLoaded = true\n clearTimeout(timeoutId)\n try {\n // eslint-disable-next-line no-undef\n Typekit.load(config)\n } catch (e) {}\n }\n\n firstScript.parentNode.insertBefore(typeKitScript, firstScript)\n}\n\n/**\n * Renders the visual builder.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {boolean} isPreview - Indicates if it's a preview.\n */\nexport const renderVisualBuilder = (targetingMsgJson, isPreview) => {\n const details = isPreview ? targetingMsgJson.details[0] : targetingMsgJson.display.details[0]\n const siteUrl = Object.keys(details)[0]\n const selectors = details[siteUrl]\n\n if (siteUrl === window.location.href.split('?')[0]) {\n for (const selector in selectors) {\n const element = document.querySelector(selector)\n if (element) {\n if (selectors[selector].html) {\n element.outerHTML = selectors[selector].html\n } else {\n // Update json data\n dispatchJsonData(targetingMsgJson, selectors[selector])\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n } else {\n let count = 0\n const intervalId = setInterval(() => {\n const retryElement = document.querySelector(selector)\n if (retryElement) {\n if (selectors[selector].html) {\n retryElement.outerHTML = selectors[selector].html\n } else {\n // Update json data\n dispatchJsonData(targetingMsgJson, selectors[selector])\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n clearInterval(intervalId)\n } else {\n count++\n if (count >= 20) {\n console.log(`No element present on DOM with selector '${selector}'.`)\n clearInterval(intervalId)\n }\n }\n }, 500)\n }\n }\n }\n}\n\n/**\n * Dispatches JSON data.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {Object} selector - The selector object.\n */\nfunction dispatchJsonData (targetingMsgJson, selector) {\n const inaObj = {}\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (selector.json != null) {\n inaObj.json = selector.json\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display_buider', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n}\n","// clevertap-handler.js\n\nconst ctEventhandler = (html) => {\n const ctScript = `\n var clevertap = {\n event: {\n push: (eventName) => {\n window.parent.postMessage({\n action: 'Event',\n value: eventName\n },'*');\n }\n },\n profile: {\n push: (eventName) => {\n window.parent.postMessage({\n action: 'Profile',\n value: eventName\n },'*');\n }\n },\n onUserLogin: {\n push: (eventName) => {\n window.parent.postMessage({\n action: 'OUL',\n value: eventName\n },'*');\n }\n },\n closeBoxPopUp: () => {\n window.parent.postMessage({\n action: 'closeBoxPopUp',\n value: 'closeBoxPopUp'\n },'*');\n },\n closeBannerPopUp: () => {\n window.parent.postMessage({\n action: 'closeBannerPopUp',\n value: 'closeBannerPopUp'\n },'*');\n },\n closeInterstitialPopUp: () => {\n window.parent.postMessage({\n action: 'closeInterstitialPopUp',\n value: 'closeInterstitialPopUp'\n },'*');\n }\n }\n `\n const insertPosition = html.indexOf('\n `\n return html.replace(/(<\\s*\\/\\s*body)/, `${script}\\n$1`)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n const displayObj = targetingMsgJson.display\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = WIZ_IFRAME_INTENT\n let html = targetingMsgJson.msgContent.html\n if (displayObj['custom-editor'] && !displayObj['bee-editor'] && displayObj['custom-html-sandbox']) { // sandbox the iframe only for custom html\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox allow-forms' // allow popup to open url in new page\n html = ctEventhandler(html)\n }\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (targetingMsgJson.display['custom-editor'] && !targetingMsgJson.display['bee-editor'] && targetingMsgJson.display['custom-html-sandbox']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n let contentDiv\n iframe.onload = () => {\n if (targetingMsgJson.display['custom-editor'] && !targetingMsgJson.display['bee-editor'] && targetingMsgJson.display['custom-html-sandbox']) {\n window.addEventListener('message', event => {\n switch (event?.data?.action) {\n case GET_NOTIFICATION_DATA:\n window.clevertap.renderNotificationClicked(event.data.value)\n break\n case EVENT:\n window.clevertap.event.push(event.data.value)\n break\n case PROFILE:\n window.clevertap.profile.push(event.data.value)\n break\n case OUL:\n window.clevertap.onUserLogin.push(event.data.value)\n break\n case CLOSE_INTERSTITIAL_POPUP:\n setTimeout(() => {\n const interstitialWrapper = window.document.getElementById('intentPreview')\n const interstitialOverlay = window.document.getElementById('intentOpacityDiv')\n interstitialOverlay && interstitialOverlay.remove()\n interstitialWrapper && interstitialWrapper.remove()\n }, 0)\n break\n default:\n // Handle unknown action\n break\n }\n })\n contentDiv = ''\n } else {\n contentDiv = document.getElementById(WIZ_IFRAME_INTENT).contentDocument.getElementById('contentDiv')\n }\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n this.#logger.error('Error subscribing: ' + error)\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { initialiseCTBuilder, renderVisualBuilder } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token) {\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n #handleMessageEvent (event) {\n if (event.data && event.data.message) {\n if (event.data.message === 'Dashboard' && event.data.url) {\n initialiseCTBuilder(event.data.url, event.data.variant ?? null, event.data.details ?? {})\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n }\n }\n\n pageChanged () {\n const search = window.location.search\n const parentWindow = window.opener\n\n if (search === '?ctBuilder') {\n // open in visual builder mode\n console.log('open in visual builder mode')\n window.addEventListener('message', this.#handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('builder', '*')\n }\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', this.#handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('preview', '*')\n }\n return\n }\n\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","constructor","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","dataPostPEURL","dataPostURL","recorderURL","emailURL","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","WIZ_IFRAME","WIZ_IFRAME_INTENT","ADJUST_IFRAME_HEIGHT","UPDATE_HEIGHT","GET_NOTIFICATION","EVENT","PROFILE","OUL","CLOSE_BOX_POPUP","CLOSE_BANNER_POPUP","GET_NOTIFICATION_DATA","CLOSE_INTERSTITIAL_POPUP","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","save","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","read","data","getItem","parse","e","remove","removeItem","removeCookie","name","domain","cookieStr","document","cookie","createCookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","readCookie","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","saveToLSorCookie","property","location","hostname","$ct","globalCache","readFromLSorCookie","trim","err","createBroadCookie","broadDomain","domainParts","testBroadDomain","testCookieName","tempCookie","getMetaProp","metaObj","setMetaProp","wzrkMetaObj","getAndClearMetaProp","setInstantDeleteFlagInK","k","flag","backupEvent","reqNo","backupArr","q","debug","removeBackup","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","get","item","saveCacheToLS","set","allKeys","objToArray","index","temp","getKey","getSecondLastKey","keysArr","getLastKey","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","s","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","sessionObj","getSessionCookieObject","kIdFromLS","guidFromLRUCache","lastK","lastGUID","unregisterTokenForGuid","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","_processOldValues","getDetails","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","fireRequest","skipARP","sendOULFlag","getDelayFrequency","account","randomDelay","random","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","ProfileHandler","profilesArr","getAttribute","propName","_handleIncrementDecrementValue","command","tz","profile","addSystemDataToObject","addFlags","compressedData","saveAndFireRequest","_handleMultiValueSet","arrayVal","array","toLowerCase","sendMultiValueData","_handleMultiValueAdd","propKey","propVal","_handleMultiValueRemove","_handleMultiValueDelete","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","clear","addToK","ids","g","kId","anonymousUser","foundInCache","gFromCache","Identity","cookieName","loginArr","pop","processProfile","CTWebPersonalisationBanner","HTMLElement","_details","shadow","attachShadow","mode","details","renderBanner","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","target","renderCarousel","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","button","setInterval","sliderTime","goTo","prev","cur","CTWebPopupImageOnly","_session","popup","container","resizeObserver","renderImageOnlyPopup","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","Message","config","message","wrapper","snackBar","renderMessage","createEl","part","_el","msg","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","raiseClickedEvent","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","contains","setBadgeStyle","msgCount","incomingMessages","msgs","updateInboxMessages","incomingMessagesForPreview","previewMsgs","now","buildUIForMessages","updateUnviewedBadgeCounter","connectedCallback","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","addMsgsToInboxFromLS","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","deleteMsgsFromUI","getInboxMessages","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","top","right","getBoundingClientRect","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","inbox_notifs","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","OVERLAY_PATH","CSS_PATH","initialiseCTBuilder","variant","onContentLoad","position","overlayPath","loadOverlayScript","then","catch","loadCSS","loadTypeKit","link","rel","head","script","src","onload","Overlay","Error","onerror","kitId","scriptTimeout","docElement","documentElement","timeoutId","className","typeKitScript","scriptLoaded","firstScript","scriptReadyState","onreadystatechange","Typekit","load","renderVisualBuilder","targetingMsgJson","siteUrl","selectors","selector","element","querySelector","outerHTML","dispatchJsonData","intervalId","retryElement","inaObj","json","kvPairsEvent","CustomEvent","dispatchEvent","ctEventhandler","ctScript","insertPosition","join","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","onclick","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","sandbox","pointerCss","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","closeCampaign","Event","appendScriptForCustomEvent","srcdoc","handleMessage","heightAdjust","boxWrapper","bannerWrapper","margin","onUserLogin","handleIframeLoad","contentWindow","postMessage","contentDocument","scrollHeight","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","interstitialWrapper","interstitialOverlay","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","getTotalVisits","visitCount","getLastVisit","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","info","debugPE","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","getTimeElapsed","sessionStart","getPageCount","seqNo","requestTime","RequestManager","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","post","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","_enableWebPush","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","skipDialog","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","getValue","getdefaultValue","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","addValueChangedCallback","removeValueChangedCallback","clearStartFlag","VariableStore","syncVariables","onSyncSuccess","onSyncFailure","meta","tk","r","status","fetchVariables","onFetchCallback","addVariablesChangedCallback","callback","addOneTimeVariablesChangedCallback","removeVariablesChangedCallback","removeOneTimeVariablesChangedCallback","callBack","CleverTap","spa","isSpa","bind","enablePersonalization","_isPersonalisationActive","ReqestManager","privacy","notifications","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","handleDecrementValue","setMultiValuesForKey","addMultiValueForKey","addMultiValuesForKey","removeMultiValueForKey","removeMultiValuesForKey","removeValueForKey","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","sendLocationData","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","elements","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","parentWindow","opener","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","setOffline","arg","defineVariable","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;EAAO,MAAMA,aAAa,GAAG,oBAAtB;EACA,MAAMC,eAAe,GAAG,QAAxB;EACA,MAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;ECAQ,MAAM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AAW,GAAG,0DAAchY,WAAhC;;EACA,MAAI2I,IAAI,GAAG,EAAX;EACAA,EAAAA,IAAI,GAAG,0DAAcqX,qBAAd,CAAoCrX,IAApC,EAA0C7C,SAA1C,CAAP;EACAkS,EAAAA,WAAW,GAAGzD,QAAQ,CAACyD,WAAD,EAAc,MAAd,EAAsBhW,QAAtB,CAAtB;EACAgW,EAAAA,WAAW,GAAGzD,QAAQ,CAACyD,WAAD,EAAc,GAAd,EAAmB3C,YAAY,CAAC7M,IAAI,CAACC,SAAL,CAAeE,IAAf,CAAD,8BAAuB,IAAvB,wBAA/B,CAAtB;;EAEA,4DAAcwX,kBAAd,CAAiCnI,WAAjC,EAA8CpN,GAAG,CAACgC,YAAlD;EACD;;yDAEoB;EACnB,SAAQ,OAAOrC,MAAM,CAACorC,MAAd,KAAyB,WAAzB,IAAwCprC,MAAM,CAACorC,MAAP,CAAcC,IAAd,KAAuB,YAAvE;EACD;;yDAMmBjtC,MAAM;EACxB,MAAI,KAAKomC,wBAAL,EAAJ,EAAqC;EACnCpmC,IAAAA,IAAI,CAAC8+B,KAAL,GAAa,IAAb;EACD;EACF;;QC3xBGpvB,SAAS,GAAG,IAAIw9B,SAAJ,CAActrC,MAAM,CAAC8N,SAArB;EAElB9N,MAAM,CAAC8N,SAAP,GAAmB9N,MAAM,CAAC+N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file diff --git a/clevertap.min.js b/clevertap.min.js index 3591c5ad..7ed91725 100644 --- a/clevertap.min.js +++ b/clevertap.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).clevertap=t()}(this,(function(){"use strict";var e=0;function t(t){return"__private_"+e+++"_"+t}function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}const o="clevertap-prod.com",n="https:";var s=t("accountId"),r=t("region"),a=t("targetDomain"),l=t("dcSdkversion"),d=t("token");class c{constructor(){let{id:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";Object.defineProperty(this,s,{writable:!0,value:void 0}),Object.defineProperty(this,r,{writable:!0,value:""}),Object.defineProperty(this,a,{writable:!0,value:o}),Object.defineProperty(this,l,{writable:!0,value:""}),Object.defineProperty(this,d,{writable:!0,value:""}),this.id=e,t&&(this.region=t),i&&(this.targetDomain=i),n&&(this.token=n)}get id(){return i(this,s)[s]}set id(e){i(this,s)[s]=e}get region(){return i(this,r)[r]}set region(e){i(this,r)[r]=e}get dcSDKVersion(){return i(this,l)[l]}set dcSDKVersion(e){i(this,l)[l]=e}get targetDomain(){return i(this,a)[a]}set targetDomain(e){i(this,a)[a]=e}get token(){return i(this,d)[d]}set token(e){i(this,d)[d]=e}get finalTargetDomain(){return this.region?"".concat(this.region,".").concat(this.targetDomain):this.targetDomain===o?"".concat("eu1",".").concat(this.targetDomain):this.targetDomain}get dataPostPEURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/defineVars")}get dataPostURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/a?t=96")}get recorderURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/r?r=1")}get emailURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/e?r=1")}}const h=new RegExp("^\\s+|\\.|:|\\$|'|\"|\\\\|\\s+$","g"),u=new RegExp("^\\s+|'|\"|\\\\|\\s+$","g"),p=new RegExp("'","g"),g="clear",v="Charged ID",f="WZRK_CHARGED_ID",b="WZRK_G",m="WZRK_K",y="WZRK_CAMP",w="WZRK_CAMP_G",C="WZRK_EV",k="WZRK_META",x="WZRK_PR",P="WZRK_ARP",S="WZRK_L",I="global",O="optOut",_="useIP",E="WZRK_X",A="push",M=31536e3,L="wzrk_",T="wzrk_id",R="Notification Viewed",j="Notification Clicked",D="WZRK_FPU",B="WZRK_PSD",N="$incr",z="$add",U="$remove",F="$delete",q="WZRK_INBOX_CONFIG",V="WZRK_INBOX",W=1e3,K="wzrk_fetch",H="wiz-iframe",G="wiz-iframe-intent",J="Event",Z="Profile",$=["Stayed","UTM Visited","App Launched","Notification Sent",R,j],Y=e=>"string"==typeof e||e instanceof String,Q=e=>"[object Object]"===Object.prototype.toString.call(e),X=e=>"object"==typeof e&&e instanceof Date,ee=e=>{for(const t in e)if(e.hasOwnProperty(t))return!1;return!0},te=e=>!isNaN(parseFloat(e))&&isFinite(e),ie=e=>/^-?[\d.]+(?:e-?\d+)?$/.test(e)&&"number"==typeof e,oe=e=>null!=e&&"undefined"!==e,ne=(e,t)=>{if("object"!=typeof e){let i;return Y(e)?(i=se(e,u),i.length>1024&&(i=i.substring(0,1024),t.reportError(521,i+"... length exceeded 1024 chars. Trimmed."))):i=e,i}for(const i in e)if(e.hasOwnProperty(i)){const o=ne(e[i],t);let n;n=se(i,h),n.length>1024&&(n=n.substring(0,1024),t.reportError(520,n+"... length exceeded 1024 chars. Trimmed.")),delete e[i],e[n]=o}return e},se=(e,t)=>e.replace(t,""),re=()=>{const e=new Date;return e.getFullYear()+""+e.getMonth()+e.getDay()},ae=()=>Math.floor((new Date).getTime()/1e3),le=e=>"$D_"+Math.round(e.getTime()/1e3),de=e=>{if(ce(e))return"$D_"+e},ce=e=>{const t=/^(\d{4})(\d{2})(\d{2})$/.exec(e);if(null==t)return!1;const i=t[3],o=t[2]-1,n=t[1],s=new Date(n,o,i);return s.getDate()==i&&s.getMonth()==o&&s.getFullYear()==n};class he{static save(e,t){return!(!e||!t)&&(this._isLocalStorageSupported()?(localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),!0):void 0)}static read(e){if(!e)return!1;let t=null;if(this._isLocalStorageSupported()&&(t=localStorage.getItem(e)),null!=t)try{t=JSON.parse(t)}catch(e){}return t}static remove(e){return!!e&&(this._isLocalStorageSupported()?(localStorage.removeItem(e),!0):void 0)}static removeCookie(e,t){let i=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";t&&(i=i+" domain="+t+"; path=/"),document.cookie=i}static createCookie(e,t,i,o){let n="",s="";if(i){const e=new Date;e.setTime(e.getTime()+1e3*i),n="; expires="+e.toGMTString()}o&&(s="; domain="+o),t=encodeURIComponent(t),document.cookie=e+"="+t+n+s+"; path=/"}static readCookie(e){const t=e+"=",i=document.cookie.split(";");for(let e=0;e=0;o--){if(a=0===o?r[o]+a:"."+r[o]+a,this.readCookie(e)){var n="test_"+e+o;if(this.createCookie(n,t,10,a),!this.readCookie(n))continue;this.removeCookie(n,a)}this.createCookie(e,t,i,a);if(this.readCookie(e)==t){s=a,ue.broadDomain=s;break}}}else this.createCookie(e,t,i,s)}else this.createCookie(e,t,i,o)}static getMetaProp(e){const t=this.readFromLSorCookie(k);if(null!=t)return t[e]}static setMetaProp(e,t){if(this._isLocalStorageSupported()){let i=this.readFromLSorCookie(k);null==i&&(i={}),void 0===t?delete i[e]:i[e]=t,this.saveToLSorCookie(k,i)}}static getAndClearMetaProp(e){const t=this.getMetaProp(e);return this.setMetaProp(e,void 0),t}static setInstantDeleteFlagInK(){let e=this.readFromLSorCookie(m);null==e&&(e={}),e.flag=!0,this.saveToLSorCookie(m,e)}static backupEvent(e,t,i){let o=this.readFromLSorCookie(S);void 0===o&&(o={}),o[t]={q:e},this.saveToLSorCookie(S,o),i.debug("stored in ".concat(S," reqNo : ").concat(t," -> ").concat(e))}static removeBackup(e,t){const i=this.readFromLSorCookie(S);null!=i&&void 0!==i[e]&&(t.debug("del event: ".concat(e," data-> ").concat(i[e].q)),delete i[e],this.saveToLSorCookie(S,i))}}const ue={globalCache:{gcookie:null,REQ_N:0,RESP_N:0},LRU_CACHE:null,globalProfileMap:void 0,globalEventsMap:void 0,blockRequest:!1,isOptInRequest:!1,broadDomain:null,webPushEnabled:null,campaignDivMap:{},currentSessionId:null,wiz_counter:0,notifApi:{notifEnabledFromApi:!1},unsubGroups:[],updatedCategoryLong:null,inbox:null,isPrivacyArrPushed:!1,privacyArray:[],offline:!1,location:null,dismissSpamControl:!1,globalUnsubscribe:!0,flutterVersion:null,variableStore:{}};var pe=t("keyOrder"),ge=t("deleteFromObject");class ve{constructor(e){Object.defineProperty(this,ge,{value:fe}),Object.defineProperty(this,pe,{writable:!0,value:void 0}),this.max=e;let t=he.readFromLSorCookie(E);if(t){const e={};i(this,pe)[pe]=[],t=t.cache;for(const o in t)t.hasOwnProperty(o)&&(e[t[o][0]]=t[o][1],i(this,pe)[pe].push(t[o][0]));this.cache=e}else this.cache={},i(this,pe)[pe]=[]}get(e){const t=this.cache[e];return t&&(this.cache=i(this,ge)[ge](e,this.cache),this.cache[e]=t,i(this,pe)[pe].push(e)),this.saveCacheToLS(this.cache),t}set(e,t){const o=this.cache[e],n=i(this,pe)[pe];null!=o?this.cache=i(this,ge)[ge](e,this.cache):n.length===this.max&&(this.cache=i(this,ge)[ge](n[0],this.cache)),this.cache[e]=t,i(this,pe)[pe][i(this,pe)[pe]-1]!==e&&i(this,pe)[pe].push(e),this.saveCacheToLS(this.cache)}saveCacheToLS(e){const t=[],o=i(this,pe)[pe];for(const i in o)if(o.hasOwnProperty(i)){const n=[];n.push(o[i]),n.push(e[o[i]]),t.push(n)}he.saveToLSorCookie(E,{cache:t})}getKey(e){if(null===e)return null;const t=i(this,pe)[pe];for(const i in t)if(t.hasOwnProperty(i)&&this.cache[t[i]]===e)return t[i];return null}getSecondLastKey(){const e=i(this,pe)[pe];return null!=e&&e.length>1?e[e.length-2]:-1}getLastKey(){const e=i(this,pe)[pe].length;if(e)return i(this,pe)[pe][e-1]}}var fe=function(e,t){const o=JSON.parse(JSON.stringify(i(this,pe)[pe])),n={};let s;for(const i in o)o.hasOwnProperty(i)&&(o[i]!==e?n[o[i]]=t[o[i]]:s=i);return o.splice(s,1),i(this,pe)[pe]=JSON.parse(JSON.stringify(o)),n},be=t("logger"),me=t("request"),ye=t("device"),we=t("session");class Ce{constructor(e){let{logger:t,request:o,device:n,session:s}=e;Object.defineProperty(this,be,{writable:!0,value:void 0}),Object.defineProperty(this,me,{writable:!0,value:void 0}),Object.defineProperty(this,ye,{writable:!0,value:void 0}),Object.defineProperty(this,we,{writable:!0,value:void 0}),i(this,be)[be]=t,i(this,me)[me]=o,i(this,ye)[ye]=n,i(this,we)[we]=s}s(e,t,o,n,s){let r=!1,a=!1;if(window.isOULInProgress&&(o||"undefined"!==n&&n===window.oulReqN)&&(window.isOULInProgress=!1,r=!0),void 0===n&&(n=0),he.removeBackup(n,i(this,be)[be]),n>ue.globalCache.REQ_N)return;if(oe(i(this,ye)[ye].gcookie)||e&&(a=!0),!oe(i(this,ye)[ye].gcookie)||o||"boolean"==typeof s){const n=i(this,we)[we].getSessionCookieObject();if(window.isOULInProgress||n.s&&t{if(Q(e)){for(var t in e)if(e.hasOwnProperty(t)){if(Q(e[t])||Array.isArray(e[t]))return!1;X(e[t])&&(e[t]=le(e[t]))}return!0}return!1},Ne=(e,t)=>{if(Q(e)){for(var i in e)if(e.hasOwnProperty(i))if("Items"===i){if(!Array.isArray(e[i]))return!1;for(var o in e[i].length>50&&t.reportError(522,"Charged Items exceed 50 limit. Actual count: "+e[i].length),e[i])if(e[i].hasOwnProperty(o)&&(!Q(e[i][o])||!Be(e[i][o])))return!1}else{if(Q(e[i])||Array.isArray(e[i]))return!1;X(e[i])&&(e[i]=le(e[i]))}if(Y(e[v])||ie(e[v])){const i=e[v]+"";if(void 0===De&&(De=he.readFromLSorCookie(f)),void 0!==De&&De.trim()===i.trim())return t.error("Duplicate charged Id - Dropped"+e),!1;De=i,he.saveToLSorCookie(f,i)}return!0}return!1};var ze=t("logger"),Ue=t("oldValues"),Fe=t("request"),qe=t("isPersonalisationActive"),Ve=t("processEventArray");class We extends Array{constructor(e,t){let{logger:o,request:n,isPersonalisationActive:s}=e;super(),Object.defineProperty(this,Ve,{value:Ke}),Object.defineProperty(this,ze,{writable:!0,value:void 0}),Object.defineProperty(this,Ue,{writable:!0,value:void 0}),Object.defineProperty(this,Fe,{writable:!0,value:void 0}),Object.defineProperty(this,qe,{writable:!0,value:void 0}),i(this,ze)[ze]=o,i(this,Ue)[Ue]=t,i(this,Fe)[Fe]=n,i(this,qe)[qe]=s}push(){for(var e=arguments.length,t=new Array(e),o=0;o0;){var t=e.shift();if(!Y(t)){i(this,ze)[ze].error(Oe);continue}if(t.length>1024&&(t=t.substring(0,1024),i(this,ze)[ze].reportError(510,t+"... length exceeded 1024 chars. Trimmed.")),$.includes(t)){i(this,ze)[ze].reportError(513,t+" is a restricted system event. It cannot be used as an event name.");continue}const o={type:"event"};if(o.evtName=se(t,h),0!==e.length){const n=e.shift();if(Q(n)){if("Charged"===t){if(!Ne(n,i(this,ze)[ze])){i(this,ze)[ze].reportError(511,"Charged event structure invalid. Not sent.");continue}}else if(!Be(n)){i(this,ze)[ze].reportError(512,t+" event structure invalid. Not sent.");continue}o.evtData=n}else e.unshift(n)}i(this,Fe)[Fe].processEvent(o)}};const He=e=>{const t={},i=e.indexOf("?");if(i>1){const o=e.substring(i+1);let n;const s=/\+/g,r=/([^&=]+)=?([^&]*)/g,a=function(e){let t=e.replace(s," ");try{t=decodeURIComponent(t)}catch(e){}return t};for(n=r.exec(o);n;)t[a(n[1])]=a(n[2]),n=r.exec(o)}return t},Ge=(e,t,i)=>e+"&"+t+"="+encodeURIComponent(i),Je=()=>window.location.hostname,Ze=(e,t)=>(t&&"function"==typeof t.debug&&t.debug("dobj:"+e),Ye(e)),$e=(()=>{let e="",t=0;for(t=0;t<=25;t++)e+=String.fromCharCode(t+65);for(t=0;t<=25;t++)e+=String.fromCharCode(t+97);for(t=0;t<10;t++)e+=t;return e+"+/="})(),Ye=e=>{if(null==e)return"";var t,i,o,n,s,r,a,l="",d=0;for(e=(e=>{if(null==e)return"";let t,i,o,n={},s={},r="",a="",l="",d=2,c=3,h=2,u="",p=0,g=0,v=String.fromCharCode;for(o=0;o>=1}else{for(i=1,t=0;t>=1}d--,0==d&&(d=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;d--,0==d&&(d=Math.pow(2,h),h++),n[a]=c++,l=String(r)}if(""!==l){if(Object.prototype.hasOwnProperty.call(s,l)){if(l.charCodeAt(0)<256){for(t=0;t>=1}else{for(i=1,t=0;t>=1}d--,0==d&&(d=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;d--,0==d&&(d=Math.pow(2,h),h++)}for(i=2,t=0;t>=1;for(;;){if(p<<=1,15==g){u+=v(p);break}g++}return u})(e);d<2*e.length;)d%2==0?(t=e.charCodeAt(d/2)>>8,i=255&e.charCodeAt(d/2),o=d/2+1>8:NaN):(t=255&e.charCodeAt((d-1)/2),(d+1)/2>8,o=255&e.charCodeAt((d+1)/2)):i=o=NaN),d+=3,n=t>>2,s=(3&t)<<4|i>>4,r=(15&i)<<2|o>>6,a=63&o,isNaN(i)?r=a=64:isNaN(o)&&(a=64),l=l+$e.charAt(n)+$e.charAt(s)+$e.charAt(r)+$e.charAt(a);return l};var Qe=t("fireRequest"),Xe=t("dropRequestDueToOptOut"),et=t("addUseIPToRequest"),tt=t("addARPToRequest");class it{constructor(){this.networkRetryCount=0,this.minDelayFrequency=0}static fireRequest(e,t,o,n){i(this,Qe)[Qe](e,1,t,o,n)}getDelayFrequency(){if(this.logger.debug("Network retry #"+this.networkRetryCount),this.networkRetryCount<10)return this.logger.debug(this.account.id,"Failure count is "+this.networkRetryCount+". Setting delay frequency to 1s"),this.minDelayFrequency=W,this.minDelayFrequency;if(null==this.account.region)return this.logger.debug(this.account.id,"Setting delay frequency to 1s"),W;{const e=1e3*(Math.floor(10*Math.random())+1);return this.minDelayFrequency+=e,this.minDelayFrequency<6e5?(this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency):(this.minDelayFrequency=W,this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency)}}}it.logger=void 0,it.device=void 0,it.account=void 0,Object.defineProperty(it,Qe,{value:function(e,t,o,n,s){var r,a;if(i(this,Xe)[Xe]())return void this.logger.debug("req dropped due to optout cookie: "+this.device.gcookie);if(oe(this.device.gcookie)||(ue.blockRequest=!0),s&&s===K)!oe(this.device.gcookie)&&ue.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(this.networkRetryCount)),i(this,Qe)[Qe](e,void 0,o,n)}),this.getDelayFrequency());else if(!oe(this.device.gcookie)&&ue.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(t)),i(this,Qe)[Qe](e,t+1,o,n)}),50);if(n?window.isOULInProgress=!0:(oe(this.device.gcookie)&&(e=Ge(e,"gc",this.device.gcookie)),e=i(this,tt)[tt](e,o)),e=Ge(e,"tries",t),e=i(this,et)[et](e),e=Ge(e,"r",(new Date).getTime()),(null===(r=window.clevertap)||void 0===r?void 0:r.hasOwnProperty("plugin"))||(null===(a=window.wizrocket)||void 0===a?void 0:a.hasOwnProperty("plugin"))){const t=window.clevertap.plugin||window.wizrocket.plugin;e=Ge(e,"ct_pl",t)}-1!==e.indexOf("chrome-extension:")&&(e=e.replace("chrome-extension:","https:"));for(var l=document.getElementsByClassName("ct-jp-cb");l[0]&&l[0].parentNode;)l[0].parentNode.removeChild(l[0]);const d=document.createElement("script");d.setAttribute("type","text/javascript"),d.setAttribute("src",e),d.setAttribute("class","ct-jp-cb"),d.setAttribute("rel","nofollow"),d.async=!0,document.getElementsByTagName("head")[0].appendChild(d),this.logger.debug("req snt -> url: "+e)}}),Object.defineProperty(it,Xe,{value:function(){return!ue.isOptInRequest&&oe(this.device.gcookie)&&Y(this.device.gcookie)?":OO"===this.device.gcookie.slice(-3):(ue.isOptInRequest=!1,!1)}}),Object.defineProperty(it,et,{value:function(e){var t=he.getMetaProp(_);return"boolean"!=typeof t&&(t=!1),Ge(e,_,t?"true":"false")}}),Object.defineProperty(it,tt,{value:function(e,t){if(!0===t){const t={skipResARP:!0};return Ge(e,"arp",Ze(JSON.stringify(t),this.logger))}return he._isLocalStorageSupported()&&void 0!==localStorage.getItem(P)&&null!==localStorage.getItem(P)?Ge(e,"arp",Ze(JSON.stringify(he.readFromLSorCookie(P)),this.logger)):e}});const ot=()=>{let e={};if(he._isLocalStorageSupported()){let t=he.read(y);null!=t?(t=JSON.parse(decodeURIComponent(t).replace(p,'"')),t.hasOwnProperty("global")?e.wp=t:e=t):e={}}return e},nt=e=>{if(he._isLocalStorageSupported()){const t={...ot(),...e},i=JSON.stringify(t);he.save(y,encodeURIComponent(i)),st()}},st=()=>{if(he._isLocalStorageSupported()){let i=he.read(b);if(oe(i))try{i=JSON.parse(decodeURIComponent(he.read(b)));const o=he.read(w)?JSON.parse(decodeURIComponent(he.read(w))):{};if(i&&he._isLocalStorageSupported()){var e={},t=ot();Object.keys(t).forEach((n=>{const s=i in o&&Object.keys(o[i]).length&&o[i][n]?o[i][n]:{},r=t[n].global,a=re(),l=t[n][a];if(void 0!==r){const e=Object.keys(r);for(const t in e){let i=[];if(e.hasOwnProperty(t)){let o=0,n=0;const a=e[t];if("tc"===a)continue;void 0!==l&&void 0!==l[a]&&(o=l[a]),void 0!==r&&void 0!==r[a]&&(n=r[a]),i=[a,o,n],s[a]=i}}}e={...e,[n]:s}})),o[i]=e,he.save(w,encodeURIComponent(JSON.stringify(o)))}}catch(e){console.error("Invalid clevertap Id "+e)}}},rt=()=>{const e=JSON.parse(decodeURIComponent(he.read(b)));let t={};if(he._isLocalStorageSupported()){let i={};t=ot();const o=he.read(w),n=o?decodeURIComponent(o):null,s=n?JSON.parse(n):null,r=e&&null!=o&&s&&s[e]&&s[e].wp?Object.values(s[e].wp):[],a=e&&null!=o&&s&&s[e]&&s[e].wi?Object.values(s[e].wi):[],l=re();let d=0,c=0;return t.wp&&t.wp[l]&&"undefined"!==t.wp[l].tc&&(d=t.wp[l].tc),t.wi&&t.wi[l]&&"undefined"!==t.wi[l].tc&&(c=t.wi[l].tc),i={wmp:d,wimp:c,tlc:r,witlc:a},i}},at=(e,t)=>{let{logger:i}=t,o=!1;if(Q(e))for(const t in e)if(e.hasOwnProperty(t)){o=!0;let n=e[t];if(null==n){delete e[t];continue}"Gender"!==t||n.match(/^M$|^F$/)||(o=!1,i.error(_e)),"Employed"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Ee)),"Married"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Ae)),"Education"!==t||n.match(/^School$|^College$|^Graduate$/)||(o=!1,i.error(Me)),"Age"===t&&null!=n&&(te(n)?e.Age=+n:(o=!1,i.error(Le))),"DOB"===t?(/^\$D_/.test(n)&&11===(n+"").length||X(n)||(o=!1,i.error(Te)),X(n)&&(e[t]=le(n))):X(n)&&(e[t]=le(n)),"Phone"!==t||ee(n)||(n.length>8&&"+"===n.charAt(0)?(n=n.substring(1,n.length),te(n)?e.Phone=+n:(o=!1,i.error(je+". Removed."))):(o=!1,i.error(je+". Removed."))),o||delete e[t]}return o},lt=e=>{const t={};t.Name=e.name,null!=e.id&&(t.FBID=e.id+""),"male"===e.gender?t.Gender="M":"female"===e.gender?t.Gender="F":t.Gender="O";null!=e.relationship_status&&(t.Married="N","Married"===e.relationship_status&&(t.Married="Y"));const i=function(e){if(null!=e){let t="",i="";for(let o=0;o0?"Y":"N",null!=e.email&&(t.Email=e.email),null!=e.birthday){const i=e.birthday.split("/");t.DOB=de(i[2]+i[0]+i[1])}return t},dt=(e,t)=>{let{logger:i}=t;const o={};if(null!=e.displayName&&(o.Name=e.displayName),null!=e.id&&(o.GPID=e.id+""),null!=e.gender&&("male"===e.gender?o.Gender="M":"female"===e.gender?o.Gender="F":"other"===e.gender&&(o.Gender="O")),null!=e.image&&!1===e.image.isDefault&&(o.Photo=e.image.url.split("?sz")[0]),null!=e.emails)for(let t=0;t{if(he._isLocalStorageSupported()){if(null==ue.globalProfileMap&&(ue.globalProfileMap=he.readFromLSorCookie(x),null==ue.globalProfileMap&&(ue.globalProfileMap={})),null!=e._custom){const t=e._custom;for(const i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);delete e._custom}for(const i in e)if(e.hasOwnProperty(i)){if(ue.globalProfileMap.hasOwnProperty(i)&&!t)continue;ue.globalProfileMap[i]=e[i]}null!=ue.globalProfileMap._custom&&delete ue.globalProfileMap._custom,he.saveToLSorCookie(x,ue.globalProfileMap)}},ht=(e,t,i)=>{if(null!=e&&"-1"!==e&&he._isLocalStorageSupported()){const t=ot();let o=t.wp[i];null==o&&(o={},t[i]=o),o[e]="dnd",nt(t)}if(null!=ue.campaignDivMap){const t=ue.campaignDivMap[e];null!=t&&(document.getElementById(t).style.display="none","intentPreview"===t&&null!=document.getElementById("intentOpacityDiv")&&(document.getElementById("intentOpacityDiv").style.display="none"))}};var ut=t("logger"),pt=t("request"),gt=t("account"),vt=t("oldValues"),ft=t("isPersonalisationActive"),bt=t("processProfileArray");class mt extends Array{constructor(e,t){let{logger:o,request:n,account:s,isPersonalisationActive:r}=e;super(),Object.defineProperty(this,bt,{value:yt}),Object.defineProperty(this,ut,{writable:!0,value:void 0}),Object.defineProperty(this,pt,{writable:!0,value:void 0}),Object.defineProperty(this,gt,{writable:!0,value:void 0}),Object.defineProperty(this,vt,{writable:!0,value:void 0}),Object.defineProperty(this,ft,{writable:!0,value:void 0}),i(this,ut)[ut]=o,i(this,pt)[pt]=n,i(this,gt)[gt]=s,i(this,vt)[vt]=t,i(this,ft)[ft]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o0)for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];let n,s={};if(null!=o.Site){if(n=o.Site,ee(n)||!at(n,{logger:i(this,ut)[ut]}))return}else if(null!=o.Facebook){const e=o.Facebook;ee(e)||e.error||(n=lt(e))}else if(null!=o["Google Plus"]){const e=o["Google Plus"];ee(e)||e.error||(n=dt(e,{logger:i(this,ut)[ut]}))}if(null!=n&&!ee(n)){s.type="profile",null==n.tz&&(n.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),s.profile=n,ct(n,!0),s=i(this,pt)[pt].addSystemDataToObject(s,void 0),i(this,pt)[pt].addFlags(s);const e=Ze(JSON.stringify(s),i(this,ut)[ut]);let t=i(this,gt)[gt].dataPostURL;t=Ge(t,"type",A),t=Ge(t,"d",e),i(this,pt)[pt].saveAndFireRequest(t,ue.blockRequest)}}},wt=t("request"),Ct=t("logger"),kt=t("account"),xt=t("session"),Pt=t("oldValues"),St=t("device"),It=t("processOUL"),Ot=t("handleCookieFromCache"),_t=t("deleteUser"),Et=t("processLoginArray");class At extends Array{constructor(e,t){let{request:o,account:n,session:s,logger:r,device:a}=e;super(),Object.defineProperty(this,Et,{value:Rt}),Object.defineProperty(this,_t,{value:Tt}),Object.defineProperty(this,Ot,{value:Lt}),Object.defineProperty(this,It,{value:Mt}),Object.defineProperty(this,wt,{writable:!0,value:void 0}),Object.defineProperty(this,Ct,{writable:!0,value:void 0}),Object.defineProperty(this,kt,{writable:!0,value:void 0}),Object.defineProperty(this,xt,{writable:!0,value:void 0}),Object.defineProperty(this,Pt,{writable:!0,value:void 0}),Object.defineProperty(this,St,{writable:!0,value:void 0}),i(this,wt)[wt]=o,i(this,kt)[kt]=n,i(this,xt)[xt]=s,i(this,Ct)[Ct]=r,i(this,Pt)[Pt]=t,i(this,St)[St]=a}clear(){i(this,Ct)[Ct].debug("clear called. Reset flag has been set."),i(this,_t)[_t](),he.setMetaProp(g,!0)}push(){for(var e=arguments.length,t=new Array(e),o=0;o{let o=he.readFromLSorCookie(m);const n=he.readFromLSorCookie(b);let s;if(null==o)o={},s=e;else{s=o.id;let r=!1,a=!1;if(null==s&&(s=e[0],r=!0),null==ue.LRU_CACHE&&he._isLocalStorageSupported()&&(ue.LRU_CACHE=new ve(100)),r)null!=n&&(ue.LRU_CACHE.set(s,n),ue.blockRequest=!1);else for(const t in e)if(e.hasOwnProperty(t)){const i=e[t];if(ue.LRU_CACHE.cache[i]){s=i,a=!0;break}}if(a){s!==ue.LRU_CACHE.getLastKey()?i(this,Ot)[Ot]():(t=!1,he.saveToLSorCookie(D,t));const e=ue.LRU_CACHE.get(s);ue.LRU_CACHE.set(s,e),he.saveToLSorCookie(b,e),i(this,St)[St].gcookie=e;const o=ue.LRU_CACHE.getSecondLastKey();if(he.readFromLSorCookie(D)&&-1!==o){const e=ue.LRU_CACHE.cache[o];i(this,wt)[wt].unregisterTokenForGuid(e)}}else r?null!=n&&(i(this,St)[St].gcookie=n,he.saveToLSorCookie(b,n),t=!1):this.clear(),he.saveToLSorCookie(D,!1),s=e[0]}o.id=s,he.saveToLSorCookie(m,o)};if(Array.isArray(e)&&e.length>0)for(const n in e)if(e.hasOwnProperty(n)){const s=e[n];let r,a={};if(null!=s.Site){if(r=s.Site,ee(r)||!at(r,{logger:i(this,Ct)[Ct]}))return}else if(null!=s.Facebook){const e=s.Facebook;ee(e)||e.error||(r=lt(e))}else if(null!=s["Google Plus"]){const e=s["Google Plus"];ee(e)&&!e.error&&(r=dt(e,{logger:i(this,Ct)[Ct]}))}if(null!=r&&!ee(r)){a.type="profile",null==r.tz&&(r.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),a.profile=r;const e=[];he._isLocalStorageSupported()&&(r.Identity&&e.push(r.Identity),r.Email&&e.push(r.Email),r.GPID&&e.push("GP:"+r.GPID),r.FBID&&e.push("FB:"+r.FBID),e.length>0&&o(e)),ct(r,!0),a=i(this,wt)[wt].addSystemDataToObject(a,void 0),i(this,wt)[wt].addFlags(a),t&&(a.isOUL=!0);const n=Ze(JSON.stringify(a),i(this,Ct)[Ct]);let s=i(this,kt)[kt].dataPostURL;s=Ge(s,"type",A),s=Ge(s,"d",n),i(this,wt)[wt].saveAndFireRequest(s,ue.blockRequest,t)}}},Lt=function(){ue.blockRequest=!1,console.debug("Block request is false"),he._isLocalStorageSupported()&&(delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),he.removeCookie(y,Je()),he.removeCookie(i(this,xt)[xt].cookieName,ue.broadDomain),he.removeCookie(P,ue.broadDomain),i(this,xt)[xt].setSessionCookieObject("")},Tt=function(){ue.blockRequest=!0,i(this,Ct)[Ct].debug("Block request is true"),ue.globalCache={gcookie:null,REQ_N:0,RESP_N:0},he._isLocalStorageSupported()&&(delete localStorage.WZRK_G,delete localStorage.WZRK_K,delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),he.removeCookie(b,ue.broadDomain),he.removeCookie(y,Je()),he.removeCookie(m,Je()),he.removeCookie(i(this,xt)[xt].cookieName,ue.broadDomain),he.removeCookie(P,ue.broadDomain),i(this,St)[St].gcookie=null,i(this,xt)[xt].setSessionCookieObject("")},Rt=function(e){if(Array.isArray(e)&&e.length>0){const t=e.pop();if(null!=t&&Q(t)&&(null!=t.Site&&Object.keys(t.Site).length>0||null!=t.Facebook&&Object.keys(t.Facebook).length>0||null!=t["Google Plus"]&&Object.keys(t["Google Plus"]).length>0)){he.setInstantDeleteFlagInK();try{i(this,It)[It]([t])}catch(e){i(this,Ct)[Ct].debug(e)}}else i(this,Ct)[Ct].error("Profile object is in incorrect format")}};class jt extends HTMLElement{constructor(){super(),this._details=null,this.shadow=null,this.shadow=this.attachShadow({mode:"open"})}get details(){return this._details||""}set details(e){null===this._details&&(this._details=e,this.renderBanner())}renderBanner(){this.shadow.innerHTML=this.getBannerContent(),!1!==this.trackClick&&this.addEventListener("click",(()=>{const e=this.details.onClick;e&&(this.details.window?window.open(e,"_blank"):window.parent.location.href=e),window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId})}getBannerContent(){return'\n \n \n ")}}class Dt extends HTMLElement{constructor(){super(),this._target=null,this._carousel=null,this.shadow=null,this.slides=0,this.previouslySelectedItem=-1,this.selectedItem=1,this.autoSlide=null,this.stopAutoSlideTimeout=null,this.shadow=this.attachShadow({mode:"open"}),void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",jt)}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderCarousel())}get details(){return this.target.display.details}get display(){return this.target.display}renderCarousel(){this.slides=this.details.length,this.shadow.innerHTML=this.getStyles();const e=this.getCarouselContent();this.display.showNavBtns&&e.insertAdjacentHTML("beforeend",this.display.navBtnsHtml),this.display.showNavArrows&&(e.insertAdjacentHTML("beforeend",this.display.leftNavArrowHtml),e.insertAdjacentHTML("beforeend",this.display.rightNavArrowHtml)),this._carousel=e,this.shadow.appendChild(e),this.setupClick(),this.updateSelectedItem(),this.startAutoSlide(),this.setupOnHover(),window.clevertap.renderNotificationViewed({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot})}setupClick(){this._carousel.addEventListener("click",(e=>{const t=e.target.id;if(t.startsWith("carousel__button")){const e=+t.split("-")[1];e!==this.selectedItem&&(this.previouslySelectedItem=this.selectedItem,this.selectedItem=e,this.updateSelectedItem(),this.startAutoSlide())}else if(t.startsWith("carousel__arrow"))t.endsWith("right")?this.goToNext():this.goToPrev(),this.startAutoSlide();else if(t.indexOf("-")>-1){const e=+t.split("-")[1],i=e-1;window.parent.clevertap&&window.clevertap.renderNotificationClicked({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot,wzrk_slideNo:e});const o=this.details[i].onClick;""!==o&&(this.details[i].window?window.open(o,"_blank"):window.location.href=o)}}))}setupOnHover(){this._carousel.addEventListener("mouseenter",(e=>{this.stopAutoSlideTimeout=setTimeout((()=>{this.autoSlide=clearInterval(this.autoSlide)}),500)})),this._carousel.addEventListener("mouseleave",(e=>{clearTimeout(this.stopAutoSlideTimeout),void 0===this.autoSlide&&this.startAutoSlide()}))}getCarouselContent(){const e=document.createElement("div");return e.setAttribute("class","carousel"),this.details.forEach(((t,i)=>{const o=document.createElement("ct-web-personalisation-banner");o.classList.add("carousel__item"),o.trackClick=!1,o.setAttribute("id","carousel__item-".concat(i+1)),o.details=t,e.appendChild(o)})),e}getStyles(){var e,t;return"\n \n ")}updateSelectedItem(){if(-1!==this.previouslySelectedItem){const e=this.shadow.getElementById("carousel__item-".concat(this.previouslySelectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.previouslySelectedItem));e.classList.remove("carousel__item--selected"),t&&t.classList.remove("carousel__button--selected")}const e=this.shadow.getElementById("carousel__item-".concat(this.selectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.selectedItem));e.classList.add("carousel__item--selected"),t&&t.classList.add("carousel__button--selected")}startAutoSlide(){clearInterval(this.autoSlide),this.autoSlide=setInterval((()=>{this.goToNext()}),this.display.sliderTime?1e3*this.display.sliderTime:3e3)}goToNext(){this.goTo(this.selectedItem,(this.selectedItem+1)%this.slides)}goToPrev(){this.goTo(this.selectedItem,this.selectedItem-1)}goTo(e,t){this.previouslySelectedItem=e,this.selectedItem=t,0===t&&(this.selectedItem=this.slides),this.updateSelectedItem()}}class Bt extends HTMLElement{constructor(){super(),this._target=null,this._session=null,this.shadow=null,this.popup=null,this.container=null,this.resizeObserver=null,this.shadow=this.attachShadow({mode:"open"})}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderImageOnlyPopup())}get session(){return this._session||""}set session(e){this._session=e}get msgId(){return this.target.wzrk_id}get pivotId(){return this.target.wzrk_pivot}get onClickUrl(){return this.target.display.onClickUrl}renderImageOnlyPopup(){const e=this.target.wzrk_id.split("_")[0],t=this.session.sessionId;this.shadow.innerHTML=this.getImageOnlyPopupContent(),this.popup=this.shadowRoot.getElementById("imageOnlyPopup"),this.container=this.shadowRoot.getElementById("container"),this.closeIcon=this.shadowRoot.getElementById("close"),this.popup.addEventListener("load",this.updateImageAndContainerWidth()),this.resizeObserver=new ResizeObserver((()=>this.handleResize(this.popup,this.container))),this.resizeObserver.observe(this.popup),this.closeIcon.addEventListener("click",(()=>{if(this.resizeObserver.unobserve(this.popup),document.getElementById("wzrkImageOnlyDiv").style.display="none",this.remove(),null!=e&&"-1"!==e&&he._isLocalStorageSupported()){const i=ot();let o=i.wp[t];null==o&&(o={},i[t]=o),o[e]="dnd",nt(i)}})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId}),this.onClickUrl&&this.popup.addEventListener("click",(()=>{this.target.display.window?window.open(this.onClickUrl,"_blank"):window.parent.location.href=this.onClickUrl,window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})}))}handleResize(e,t){const i=this.getRenderedImageWidth(e);t.style.setProperty("width","".concat(i,"px"))}getImageOnlyPopupContent(){return"\n ".concat(this.target.msgContent.css,"\n ").concat(this.target.msgContent.html,"\n ")}updateImageAndContainerWidth(){return()=>{const e=this.getRenderedImageWidth(this.popup);this.popup.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("height","auto"),this.container.style.setProperty("position","fixed"),this.popup.style.setProperty("visibility","visible"),this.closeIcon.style.setProperty("visibility","visible"),document.getElementById("wzrkImageOnlyDiv").style.visibility="visible"}}getRenderedImageWidth(e){const t=e.naturalWidth/e.naturalHeight;return e.height*t}}class Nt extends HTMLElement{constructor(e,t){super(),this.wrapper=null,this.snackBar=null,this.shadow=this.attachShadow({mode:"open"}),this.config=e,this.message=t,this.renderMessage(t)}get pivotId(){return this.message.wzrk_pivot}get campaignId(){return this.message.wzrk_id}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}renderMessage(e){switch(this.wrapper=this.createEl("div","messageWrapper"),e.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":{const t=this.prepareBasicMessage(e.msg[0]);this.wrapper.appendChild(t)}}const t=this.createEl("div","timeStamp");if(t.innerHTML="".concat(Jt(e.id.split("_")[1]),""),!e.viewed){const e=this.createEl("span","unreadMarker");t.appendChild(e)}this.wrapper.appendChild(t),this.shadow.appendChild(this.wrapper)}prepareBasicMessage(e){const t=this.createEl("div","message");if(e.imageUrl){const i=this.addImage(e.imageUrl,"mainImg");t.appendChild(i)}const i=this.createEl("div","iconTitleDescWrapper");if(e.iconUrl){const t=this.addImage(e.iconUrl,"iconImg");i.appendChild(t)}const o=this.createEl("div","titleDescWrapper");if(e.title){const t=this.createEl("div","title");t.innerText=e.title,o.appendChild(t)}if(e.description){const t=this.createEl("div","description");t.innerText=e.description,o.appendChild(t)}if((e.title||e.description)&&i.appendChild(o),(e.iconUrl||e.title||e.description)&&t.appendChild(i),e.buttons&&e.buttons.length){const i=this.addButtons(e.buttons);t.appendChild(i)}return t}addButtons(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.createEl("div","buttonsContainer");let i=!1;return e.forEach(((e,o)=>{const n=this.createEl("button","button-".concat(o),"button");n.innerText=e.text,o>0&&(n.style.cssText+="margin-left: 2px;"),"copy"===e.action&&(i=!0),t.appendChild(n)})),i&&this.addSnackbar(t),t}addSnackbar(e){this.snackBar=this.createEl("div","snackbar-".concat(this.campaignId),"snackbar"),this.snackBar.innerHTML=Yt;const t=this.createEl("span","snackbar-msg-".concat(this.campaignId),"snackbar-msg");t.innerText="Copied to clipboard",this.snackBar.appendChild(t),e.appendChild(this.snackBar)}addImage(e,t){const i=this.createEl("div","".concat(t,"Container")),o=this.createEl("img",t);return o.setAttribute("src",e),o.setAttribute("loading","lazy"),i.appendChild(o),i}raiseClickedEvent(e,t){switch(this.message.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":this.raiseClickedForBasicTemplates(e,t)}}raiseClickedForBasicTemplates(e,t){const i=this.message.msg[0],o={msgId:this.campaignId,pivotId:this.pivotId};if("BUTTON"===e.tagName){const t=e.id.split("-")[1],n=i.buttons[t];o.kv={wzrk_c2a:n.text},"url"===n.action?n.openUrlInNewTab?window.open(n.url,"_blank"):window.location=n.url:"copy"===n.action&&(window.focus(),navigator.clipboard.writeText(n.clipboardText),this.snackBar.style.setProperty("display","flex","important"),setTimeout((()=>{this.snackBar.style.setProperty("display","none","important")}),2e3))}else"CT-INBOX-MESSAGE"===e.tagName&&i.onClickUrl&&(i.openUrlInNewTab?window.open(i.onClickUrl,"_blank"):window.location=i.onClickUrl);t?console.log("Notifiction clicked event will be raised at run time with payload ::",o):window.clevertap.renderNotificationClicked(o)}}class zt extends HTMLElement{constructor(e){super(),this.isInboxOpen=!1,this.isInboxFromFlutter=!1,this.selectedCategory=null,this.unviewedMessages={},this.unviewedCounter=0,this.isPreview=!1,this.inboxConfigForPreview={},this.inboxSelector=null,this.inbox=null,this.emptyInboxMsg=null,this.inboxCard=null,this.unviewedBadge=null,this.observer=null,this.selectedCategoryRef=null,this.addClickListenerOnDocument=(()=>e=>{if(e.composedPath().includes(this.inbox)){const t=e.path||e.composedPath&&e.composedPath();if(t.length){const e=t[0].id;if("closeInbox"===e)this.toggleInbox();else if(e.startsWith("category-"))this.prevCategoryRef=this.selectedCategoryRef,this.selectedCategoryRef=t[0],this.updateActiveCategory(t[0].innerText);else{const e=t.filter((e=>{var t;return(null===(t=e.id)||void 0===t?void 0:t.startsWith("button-"))||"CT-INBOX-MESSAGE"===e.tagName}));if(e.length){e[e.length-1].raiseClickedEvent(e[0],this.isPreview)}}}}else(this.inboxSelector.contains(e.target)||this.isInboxOpen)&&(this.isInboxFromFlutter?this.isInboxFromFlutter=!1:this.toggleInbox(e))})(),this.setBadgeStyle=e=>{null!==this.unviewedBadge&&(this.unviewedBadge.innerText=e>9?"9+":e,this.unviewedBadge.style.display=e>0?"flex":"none")},this.logger=e,this.shadow=this.attachShadow({mode:"open"})}get incomingMessages(){return[]}set incomingMessages(e){void 0===e&&(e=[]),e.length>0&&this.inbox&&this.updateInboxMessages(e)}get incomingMessagesForPreview(){return[]}set incomingMessagesForPreview(e){void 0===e&&(e=[]);const t={};e.length>0&&this.inbox&&(this.isPreview=!0,this.unviewedCounter=0,e.forEach((e=>{const i="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=i,t[i]=e,this.unviewedMessages[i]=e,this.unviewedCounter++})),this.buildUIForMessages(t),this.updateUnviewedBadgeCounter())}connectedCallback(){this.init()}init(){this.config=this.isPreview?this.inboxConfigForPreview:he.readFromLSorCookie(q)||{},0!==Object.keys(this.config).length&&(this.inboxSelector=document.getElementById(this.config.inboxSelector),null!==this.inboxSelector&&(this.config.styles.notificationsBadge?this.addUnviewedBadge():this.unviewedBadge&&this.unviewedBadge.remove(),this.createinbox(),document.removeEventListener("click",this.addClickListenerOnDocument),document.addEventListener("click",this.addClickListenerOnDocument),this.config.categories.length&&this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadow.innerHTML=this.getInboxStyles(),this.shadow.appendChild(this.inbox)))}addMsgsToInboxFromLS(){const e=this.deleteExpiredAndGetUnexpiredMsgs(!1),t=e?Object.keys(e):[];0!==t.length&&(t.forEach((t=>{e[t].viewed||(this.unviewedMessages[t]=e[t],this.unviewedCounter++)})),this.buildUIForMessages(e),this.updateUnviewedBadgeCounter())}deleteExpiredAndGetUnexpiredMsgs(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Vt();const i=Math.floor(Date.now()/1e3);for(const o in t)if(t[o].wzrk_ttl&&t[o].wzrk_ttl>0&&t[o].wzrk_ttl0&&(t=Object.values(t).sort(((e,t)=>t.date-e.date)).reduce(((e,t)=>(e[t.id]=t,e)),{})),Wt(t),t}updateInboxMessages(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.deleteExpiredAndGetUnexpiredMsgs(),i=Date.now(),o={};e.forEach(((e,n)=>{const s="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=s,e.date=i-n,e.viewed=0,t[s]=e,o[s]=e,this.unviewedMessages[s]=e,this.unviewedCounter++})),Wt(t),this.buildUIForMessages(o),this.updateUnviewedBadgeCounter()}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}addUnviewedBadge(){this.unviewedBadge||(this.unviewedBadge=this.createEl("div","unviewedBadge"),this.unviewedBadge.style.cssText="display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ".concat(this.config.styles.notificationsBadge.backgroundColor,"; font-size: 12px; color: ").concat(this.config.styles.notificationsBadge.textColor,"; font-weight: bold; align-items: center; justify-content: center;"),document.body.appendChild(this.unviewedBadge)),this.updateUnviewedBadgePosition(),window.addEventListener("resize",(()=>{this.updateUnviewedBadgePosition()}))}updateUnviewedBadgePosition(){const{top:e,right:t}=this.inboxSelector.getBoundingClientRect();this.unviewedBadge.style.top="".concat(e-8,"px"),this.unviewedBadge.style.left="".concat(t-8,"px")}createinbox(){this.inbox=this.createEl("div","inbox");const e=this.createEl("div","header"),t=this.createEl("div","headerTitle");t.innerText=this.config.title;const i=this.createEl("div","closeInbox");if(i.innerHTML="×",e.appendChild(t),e.appendChild(i),this.inbox.appendChild(e),this.config.categories.length){const e=this.createCategories();this.inbox.appendChild(e)}this.inboxCard=this.createEl("div","inboxCard"),this.inbox.appendChild(this.inboxCard),this.emptyInboxMsg=this.createEl("div","emptyInboxMsg"),this.emptyInboxMsg.innerText="All messages will be displayed here.",this.inboxCard.appendChild(this.emptyInboxMsg);const o={root:this.inboxCard,rootMargin:"0px",threshold:.5};this.observer=new IntersectionObserver(((e,t)=>{this.handleMessageViewed(e)}),o),this.addMsgsToInboxFromLS()}createCategories(){const e=this.createEl("div","categoriesContainer"),t=this.createEl("div","leftArrow");t.innerHTML=$t,t.children[0].style="transform: rotate(180deg)",t.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(-70,0)})),e.appendChild(t);const i=this.createEl("div","categoriesWrapper");["All",...this.config.categories].forEach(((e,t)=>{const o=this.createEl("div","category-".concat(t),"category");o.innerText=e,0===t&&(this.selectedCategoryRef=o),i.appendChild(o)})),e.appendChild(i);const o=this.createEl("div","rightArrow");o.innerHTML=$t,o.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(70,0)})),e.appendChild(o);const n={root:e,threshold:.9},s=i.children[0],r=i.children[this.config.categories.length];new IntersectionObserver((e=>{this.categoryObserverCb(t,e[0].intersectionRatio>=.9)}),n).observe(s);return new IntersectionObserver((e=>{this.categoryObserverCb(o,e[0].intersectionRatio>=.9)}),n).observe(r),e}categoryObserverCb(e,t){e&&(e.style.display=t?"none":"flex")}updateActiveCategory(e){this.selectedCategory=e,this.inboxCard.scrollTop=0;let t=0;this.prevCategoryRef&&this.prevCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef.setAttribute("selected","true"),this.inboxCard.childNodes.forEach((e=>{"emptyInboxMsg"!==e.getAttribute("id")&&(e.style.display="All"===this.selectedCategory||e.getAttribute("category")===this.selectedCategory?"block":"none","block"===e.style.display&&t++)})),0===t?(this.emptyInboxMsg.innerText="".concat(e," messages will be displayed here."),this.emptyInboxMsg.style.display="block"):this.emptyInboxMsg.style.display="none"}buildUIForMessages(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!this.isPreview&&this.updateTSForRenderedMsgs(),this.inboxCard.scrollTop=0;const i=null!==(e=this.config.maxMsgsInInbox)&&void 0!==e?e:15,o=this.inboxCard.firstChild,n=Object.values(t).sort(((e,t)=>t.date-e.date)).map((e=>e.id));for(const e of n){const i=new Nt(this.config,t[e]);i.setAttribute("id",t[e].id),i.setAttribute("pivot",t[e].wzrk_pivot),i.setAttribute("part","ct-inbox-message"),this.config.categories.length>0?(i.setAttribute("category",t[e].tags[0]||""),i.style.display="All"===this.selectedCategory||t[e].category===this.selectedCategory?"block":"none"):i.style.display="block",this.inboxCard.insertBefore(i,o),this.observer.observe(i)}let s=this.inboxCard.querySelectorAll("ct-inbox-message").length;for(;s>i;){const e=this.inboxCard.querySelectorAll("ct-inbox-message");e.length>0&&e[e.length-1].remove(),s--}const r=this.inboxCard.querySelectorAll('ct-inbox-message[style*="display: block"]').length;this.emptyInboxMsg.style.display=r?"none":"block"}handleMessageViewed(e){const t=!this.isPreview;this.isInboxOpen&&e.forEach((e=>{e.isIntersecting&&this.unviewedMessages.hasOwnProperty(e.target.id)&&0===e.target.message.viewed&&(e.target.message.viewed=1,t?(window.clevertap.renderNotificationViewed({msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.updateMessageInLS(e.target.id,{...e.target.message,viewed:1}),setTimeout((()=>{e.target.shadowRoot.getElementById("unreadMarker").style.display="none"}),1e3)):console.log("Notifiction viewed event will be raised at run time with payload ::",{msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.unviewedCounter--,this.updateUnviewedBadgeCounter(),delete this.unviewedMessages[e.target.id])}))}updateMessageInLS(e,t){if(!this.isPreview){const i=Vt();i[e]=t,Wt(i)}}toggleInbox(e){this.isInboxOpen=!this.isInboxOpen,this.isInboxFromFlutter=!!(null==e?void 0:e.rect),this.isInboxOpen?(this.inboxCard.scrollTop=0,!this.isPreview&&this.deleteExpiredAndGetUnexpiredMsgs(),this.inbox.style.display="block",this.inbox.style.zIndex="2147483647",this.config.categories.length&&(this.selectedCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef=this.shadowRoot.getElementById("category-0"),this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadowRoot.getElementById("categoriesWrapper").scrollLeft-=this.shadowRoot.getElementById("categoriesWrapper").scrollWidth),this.setInboxPosition(e)):this.inbox.style.display="none"}setInboxPosition(e){const t=window.outerWidth,i=getComputedStyle(ue.inbox),o=i.getPropertyValue("--inbox-top"),n=i.getPropertyValue("--inbox-bottom"),s=i.getPropertyValue("--inbox-left"),r=i.getPropertyValue("--inbox-right");if(t>481&&!(o||n||s||r)){const t=Gt(e,this.inbox.clientHeight,this.inbox.clientWidth),i=t.xPos,o=t.yPos;this.inbox.style.top=o+"px",this.inbox.style.left=i+"px"}}updateUnviewedBadgeCounter(){if(this.isPreview)return void this.setBadgeStyle(this.unviewedCounter);let e=0;this.inboxCard.querySelectorAll("ct-inbox-message").forEach((t=>{const i=Vt();i[t.id]&&0===i[t.id].viewed&&e++})),this.setBadgeStyle(e)}updateTSForRenderedMsgs(){this.inboxCard.querySelectorAll("ct-inbox-message").forEach((e=>{const t=e.id.split("_")[1];e.shadow.getElementById("timeStamp").firstChild.innerText=Jt(t)}))}getInboxStyles(){const e=this.config.categories.length?64:16,t={panelBackgroundColor:this.config.styles.panelBackgroundColor,panelBorderColor:this.config.styles.panelBorderColor,headerBackgroundColor:this.config.styles.header.backgroundColor,headerTitleColor:this.config.styles.header.titleColor,closeIconColor:this.config.styles.closeIconColor,categoriesTabColor:this.config.styles.categories.tabColor,categoriesTitleColor:this.config.styles.categories.titleColor,selectedCategoryTabColor:this.config.styles.categories.selectedTab.tabColor,selectedCategoryTitleColor:this.config.styles.categories.selectedTab.titleColor,headerCategoryHeight:36+e};this.config.styles.categories.borderColor&&(t.categoriesBorderColor=this.config.styles.categories.borderColor),this.config.styles.categories.selectedTab.borderColor&&(t.selectedCategoryBorderColor=this.config.styles.categories.selectedTab.borderColor);const i=(e=>{let{panelBackgroundColor:t,panelBorderColor:i,headerBackgroundColor:o,headerTitleColor:n,closeIconColor:s,categoriesTabColor:r,categoriesTitleColor:a,categoriesBorderColor:l,selectedCategoryTabColor:d,selectedCategoryTitleColor:c,selectedCategoryBorderColor:h,headerCategoryHeight:u}=e;return'\n \n ")})(t),o=this.config.styles.cards;return i+(e=>{let{backgroundColor:t,borderColor:i,titleColor:o,descriptionColor:n,buttonColor:s,buttonTextColor:r,unreadMarkerColor:a}=e;return'\n \n ")})({backgroundColor:o.backgroundColor,borderColor:o.borderColor,titleColor:o.titleColor,descriptionColor:o.descriptionColor,buttonColor:o.buttonColor,buttonTextColor:o.buttonTextColor,unreadMarkerColor:o.unreadMarkerColor})}}const Ut=e=>{e.inbox_preview?ue.inbox.incomingMessagesForPreview=e.inbox_notifs:ue.inbox.incomingMessages=e},Ft=e=>{Ht(),ue.inbox=new zt({logger:e}),document.body.appendChild(ue.inbox)},qt=e=>{const t=he.readFromLSorCookie(V)||{};if(Object.keys(t).length>0&&Object.keys(t)[0].includes("_")){const i={};return i[e]=t,he.saveToLSorCookie(V,i),i}return t},Vt=()=>{const e=JSON.parse(decodeURIComponent(he.read(b)));if(!oe(e))return{};const t=qt(e);return t.hasOwnProperty(e)?t[e]:{}},Wt=e=>{const t=JSON.parse(decodeURIComponent(he.read(b)));if(!oe(t))return;const i={...qt(t),[t]:e};he.saveToLSorCookie(V,i)},Kt=e=>new Promise(((t,i)=>{if("complete"===document.readyState)Ft(e),t();else{const i=he.readFromLSorCookie(q)||{},o=()=>{null===ue.inbox&&Ft(e),t()};window.addEventListener("load",(()=>{if(document.getElementById(i.inboxSelector))o();else{let n=0;if(n<20){const s=setInterval((()=>{document.getElementById(i.inboxSelector)?(o(),clearInterval(s),t()):n>=20&&(clearInterval(s),e.debug("Failed to add inbox")),n++}),500)}}}))}})),Ht=()=>{void 0===customElements.get("ct-web-inbox")&&(customElements.define("ct-web-inbox",zt),customElements.define("ct-inbox-message",Nt))},Gt=(e,t,i)=>{const o=document.scrollingElement.scrollLeft,n=document.scrollingElement.scrollTop,s=window.innerWidth+o,r=window.innerHeight+n,a=e.rect||e.target.getBoundingClientRect(),l=a.x+o,d=a.y+n,c=a.left+o,h=a.right+o,u=a.top+n,p=a.bottom,g=a.height,v=a.width;let f,b,m=!1;const y=16;if(p+t<=r){const e=r-(p+t);b=e>=y?p+y:p+e}else if(u-t>=n){const e=u-t;b=e>=y?u-t-y:u-t-e}else m=!0,b=d+g/2-t/2,br&&(b=r-t);if(m){const e=h+i;if(e<=s){f=h+(e+y<=s?y:s-e)}else{const e=c-i;f=e-(e-y>=o?y:e-o)}}else f=l+v/2-i/2,fs&&(f=h-i>=o?h-i:s-i);return{xPos:f,yPos:b}},Jt=e=>{const t=Date.now();let i=Math.floor((t-e)/6e4);return i<5?"Just now":i<60?"".concat(i," minute").concat(i>1?"s":""," ago"):(i=Math.floor(i/60),i<24?"".concat(i," hour").concat(i>1?"s":""," ago"):(i=Math.floor(i/24),"".concat(i," day").concat(i>1?"s":""," ago")))},Zt=()=>Object.keys(he.readFromLSorCookie(q)||{}).length>0,$t='\n\n\n',Yt='\n\n\n',Qt="https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css";let Xt;function ei(e,t,i){document.body.innerHTML="",Xt=document.createElement("div"),Xt.id="overlayDiv",Xt.style.position="relative",Xt.style.display="flex",document.body.appendChild(Xt);var o;(function(e,t,i,o){return new Promise(((n,s)=>{var r=document.createElement("script");r.type="module",r.src=e,r.onload=function(){"function"==typeof window.Overlay?(window.Overlay("#overlayDiv",t,i,o),n()):s(new Error("ContentLayout not found in overlay.js"))},r.onerror=function(e){s(e)},document.head.appendChild(r)}))})("https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js",e,t,i).then((()=>{console.log("Overlay script loaded successfully.")})).catch((e=>{console.error("Error loading overlay script:",e)})),(o=document.createElement("link")).rel="stylesheet",o.type="text/css",o.href=Qt,document.head.appendChild(o),function(){const e={kitId:"eqj6nom",scriptTimeout:3e3,async:!0},t=document.documentElement,i=setTimeout((function(){t.className=t.className.replace(/\bwf-loading\b/g,"")+" wf-inactive"}),e.scriptTimeout),o=document.createElement("script");let n=!1;const s=document.getElementsByTagName("script")[0];let r;t.className+=" wf-loading",o.src="https://use.typekit.net/"+e.kitId+".js",o.async=!0,o.onload=o.onreadystatechange=function(){if(r=this.readyState,!(n||r&&"complete"!==r&&"loaded"!==r)){n=!0,clearTimeout(i);try{Typekit.load(e)}catch(e){}}},s.parentNode.insertBefore(o,s)}()}const ti=(e,t)=>{const i=t?e.details[0]:e.display.details[0],o=Object.keys(i)[0],n=i[o];if(o===window.location.href.split("?")[0])for(const i in n){const o=document.querySelector(i);if(o)n[i].html?o.outerHTML=n[i].html:ii(e,n[i]),t||window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot});else{let o=0;const s=setInterval((()=>{const r=document.querySelector(i);r?(n[i].html?r.outerHTML=n[i].html:ii(e,n[i]),t||window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot}),clearInterval(s)):(o++,o>=20&&(console.log("No element present on DOM with selector '".concat(i,"'.")),clearInterval(s)))}),500)}}};function ii(e,t){const i={};i.msgId=e.wzrk_id,e.wzrk_pivot&&(i.pivotId=e.wzrk_pivot),null!=t.json&&(i.json=t.json);const o=new CustomEvent("CT_web_native_display_buider",{detail:i});document.dispatchEvent(o)}const oi=e=>{const t=e.indexOf("\n `\n return html.replace(/(<\\s*\\/\\s*body)/, `${script}\\n$1`)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n const displayObj = targetingMsgJson.display\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = WIZ_IFRAME_INTENT\n let html = targetingMsgJson.msgContent.html\n if (displayObj['custom-editor'] && !displayObj['bee-editor'] && displayObj['custom-html-sandbox']) { // sandbox the iframe only for custom html\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox allow-forms' // allow popup to open url in new page\n html = ctEventhandler(html)\n }\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (targetingMsgJson.display['custom-editor'] && !targetingMsgJson.display['bee-editor'] && targetingMsgJson.display['custom-html-sandbox']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n let contentDiv\n iframe.onload = () => {\n if (targetingMsgJson.display['custom-editor'] && !targetingMsgJson.display['bee-editor'] && targetingMsgJson.display['custom-html-sandbox']) {\n window.addEventListener('message', event => {\n switch (event?.data?.action) {\n case GET_NOTIFICATION_DATA:\n window.clevertap.renderNotificationClicked(event.data.value)\n break\n case EVENT:\n window.clevertap.event.push(event.data.value)\n break\n case PROFILE:\n window.clevertap.profile.push(event.data.value)\n break\n case OUL:\n window.clevertap.onUserLogin.push(event.data.value)\n break\n case CLOSE_INTERSTITIAL_POPUP:\n setTimeout(() => {\n const interstitialWrapper = window.document.getElementById('intentPreview')\n const interstitialOverlay = window.document.getElementById('intentOpacityDiv')\n interstitialOverlay && interstitialOverlay.remove()\n interstitialWrapper && interstitialWrapper.remove()\n }, 0)\n break\n default:\n // Handle unknown action\n break\n }\n })\n contentDiv = ''\n } else {\n contentDiv = document.getElementById(WIZ_IFRAME_INTENT).contentDocument.getElementById('contentDiv')\n }\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n this.#logger.error('Error subscribing: ' + error)\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { initialiseCTBuilder, renderVisualBuilder } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token) {\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n #handleMessageEvent (event) {\n if (event.data && event.data.message) {\n if (event.data.message === 'Dashboard' && event.data.url) {\n initialiseCTBuilder(event.data.url, event.data.variant ?? null, event.data.details ?? {})\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n }\n }\n\n pageChanged () {\n const search = window.location.search\n const parentWindow = window.opener\n\n if (search === '?ctBuilder') {\n // open in visual builder mode\n console.log('open in visual builder mode')\n window.addEventListener('message', this.#handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('builder', '*')\n }\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', this.#handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('preview', '*')\n }\n return\n }\n\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","constructor","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","dataPostPEURL","dataPostURL","recorderURL","emailURL","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","WIZ_IFRAME","WIZ_IFRAME_INTENT","ADJUST_IFRAME_HEIGHT","UPDATE_HEIGHT","GET_NOTIFICATION","EVENT","PROFILE","OUL","CLOSE_BOX_POPUP","CLOSE_BANNER_POPUP","GET_NOTIFICATION_DATA","CLOSE_INTERSTITIAL_POPUP","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","save","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","read","data","getItem","parse","e","remove","removeItem","removeCookie","name","domain","cookieStr","document","cookie","createCookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","readCookie","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","saveToLSorCookie","property","location","hostname","$ct","globalCache","readFromLSorCookie","trim","err","createBroadCookie","broadDomain","domainParts","testBroadDomain","testCookieName","tempCookie","getMetaProp","metaObj","setMetaProp","wzrkMetaObj","getAndClearMetaProp","setInstantDeleteFlagInK","k","flag","backupEvent","reqNo","backupArr","q","debug","removeBackup","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","get","item","saveCacheToLS","set","allKeys","objToArray","index","temp","getKey","getSecondLastKey","keysArr","getLastKey","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","s","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","sessionObj","getSessionCookieObject","kIdFromLS","guidFromLRUCache","lastK","lastGUID","unregisterTokenForGuid","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","_processOldValues","getDetails","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","fireRequest","skipARP","sendOULFlag","getDelayFrequency","account","randomDelay","random","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","ProfileHandler","profilesArr","getAttribute","propName","_handleIncrementDecrementValue","command","tz","profile","addSystemDataToObject","addFlags","compressedData","saveAndFireRequest","_handleMultiValueSet","arrayVal","array","toLowerCase","sendMultiValueData","_handleMultiValueAdd","propKey","propVal","_handleMultiValueRemove","_handleMultiValueDelete","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","clear","addToK","ids","g","kId","anonymousUser","foundInCache","gFromCache","Identity","cookieName","loginArr","pop","processProfile","CTWebPersonalisationBanner","HTMLElement","_details","shadow","attachShadow","mode","details","renderBanner","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","target","renderCarousel","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","button","setInterval","sliderTime","goTo","prev","cur","CTWebPopupImageOnly","_session","popup","container","resizeObserver","renderImageOnlyPopup","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","Message","config","message","wrapper","snackBar","renderMessage","createEl","part","_el","msg","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","raiseClickedEvent","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","contains","setBadgeStyle","msgCount","incomingMessages","msgs","updateInboxMessages","incomingMessagesForPreview","previewMsgs","now","buildUIForMessages","updateUnviewedBadgeCounter","connectedCallback","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","addMsgsToInboxFromLS","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","deleteMsgsFromUI","getInboxMessages","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","top","right","getBoundingClientRect","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","inbox_notifs","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","OVERLAY_PATH","CSS_PATH","initialiseCTBuilder","variant","onContentLoad","position","overlayPath","loadOverlayScript","then","catch","loadCSS","loadTypeKit","link","rel","head","script","src","onload","Overlay","Error","onerror","kitId","scriptTimeout","docElement","documentElement","timeoutId","className","typeKitScript","scriptLoaded","firstScript","scriptReadyState","onreadystatechange","Typekit","load","renderVisualBuilder","targetingMsgJson","siteUrl","selectors","selector","element","querySelector","outerHTML","dispatchJsonData","intervalId","retryElement","inaObj","json","kvPairsEvent","CustomEvent","dispatchEvent","ctEventhandler","ctScript","insertPosition","join","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","onclick","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","sandbox","pointerCss","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","closeCampaign","Event","appendScriptForCustomEvent","srcdoc","handleMessage","heightAdjust","boxWrapper","bannerWrapper","margin","onUserLogin","handleIframeLoad","contentWindow","postMessage","contentDocument","scrollHeight","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","interstitialWrapper","interstitialOverlay","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","getTotalVisits","visitCount","getLastVisit","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","info","debugPE","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","getTimeElapsed","sessionStart","getPageCount","seqNo","requestTime","RequestManager","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","post","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","_enableWebPush","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","skipDialog","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","getValue","getdefaultValue","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","addValueChangedCallback","removeValueChangedCallback","clearStartFlag","VariableStore","syncVariables","onSyncSuccess","onSyncFailure","meta","tk","r","status","fetchVariables","onFetchCallback","addVariablesChangedCallback","callback","addOneTimeVariablesChangedCallback","removeVariablesChangedCallback","removeOneTimeVariablesChangedCallback","callBack","CleverTap","spa","isSpa","bind","enablePersonalization","_isPersonalisationActive","ReqestManager","privacy","notifications","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","handleDecrementValue","setMultiValuesForKey","addMultiValueForKey","addMultiValuesForKey","removeMultiValueForKey","removeMultiValuesForKey","removeValueForKey","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","sendLocationData","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","elements","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","parentWindow","opener","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","setOffline","arg","defineVariable","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;EAAO,MAAMA,aAAa,GAAG,oBAAtB;EACA,MAAMC,eAAe,GAAG,QAAxB;EACA,MAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;ECAQ,MAAMC,OAAN,CAAc;EAO3BC,EAAAA,WAAW,GAAsE;EAAA,QAApE;EAAEC,MAAAA;EAAF,KAAoE,uEAA3D,EAA2D;EAAA,QAAvDC,MAAuD,uEAA9C,EAA8C;EAAA,QAA1CC,YAA0C,uEAA3BP,aAA2B;EAAA,QAAZQ,KAAY,uEAAJ,EAAI;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,aALvE;EAKuE;EAAA;EAAA;EAAA,aAJjER;EAIiE;EAAA;EAAA;EAAA,aAHjE;EAGiE;EAAA;EAAA;EAAA,aAFxE;EAEwE;EAC/E,SAAKK,EAAL,GAAUA,EAAV;;EACA,QAAIC,MAAJ,EAAY;EACV,WAAKA,MAAL,GAAcA,MAAd;EACD;;EACD,QAAIC,YAAJ,EAAkB;EAChB,WAAKA,YAAL,GAAoBA,YAApB;EACD;;EACD,QAAIC,KAAJ,EAAW;EACT,WAAKA,KAAL,GAAaA,KAAb;EACD;EACF;;EAED,MAAIH,EAAJ,GAAU;EACR,uCAAO,IAAP;EACD;;EAED,MAAIA,EAAJ,CAAQI,SAAR,EAAmB;EACjB,gEAAkBA,SAAlB;EACD;;EAED,MAAIH,MAAJ,GAAc;EACZ,uCAAO,IAAP;EACD;;EAED,MAAIA,MAAJ,CAAYA,MAAZ,EAAoB;EAClB,0DAAeA,MAAf;EACD;;EAED,MAAII,YAAJ,GAAoB;EAClB,uCAAO,IAAP;EACD;;EAED,MAAIA,YAAJ,CAAkBA,YAAlB,EAAgC;EAC9B,sEAAqBA,YAArB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,OAA5B,qEAAuC,IAAvC,yBAA6C/S,KAAK,CAAC3c,IAAN,CAAW6Z,OAAxD,qEAAmE,EAAnE,CAAnB;EACD,KAFD,MAEO,IAAI8C,KAAK,CAAC3c,IAAN,CAAW8f,OAAX,KAAuB,SAA3B,EAAsC;EAC3C2R,MAAAA,mBAAmB,CAAC9U,KAAK,CAAC3c,IAAP,EAAa,IAAb,CAAnB;EACD;EACF;EACF;;+CAuGe;EACd,MAAIqP,WAAW,GAAG,0DAAchY,WAAhC;;EACA,MAAI2I,IAAI,GAAG,EAAX;EACAA,EAAAA,IAAI,GAAG,0DAAcqX,qBAAd,CAAoCrX,IAApC,EAA0C7C,SAA1C,CAAP;EACAkS,EAAAA,WAAW,GAAGzD,QAAQ,CAACyD,WAAD,EAAc,MAAd,EAAsBhW,QAAtB,CAAtB;EACAgW,EAAAA,WAAW,GAAGzD,QAAQ,CAACyD,WAAD,EAAc,GAAd,EAAmB3C,YAAY,CAAC7M,IAAI,CAACC,SAAL,CAAeE,IAAf,CAAD,8BAAuB,IAAvB,wBAA/B,CAAtB;;EAEA,4DAAcwX,kBAAd,CAAiCnI,WAAjC,EAA8CpN,GAAG,CAACgC,YAAlD;EACD;;yDAEoB;EACnB,SAAQ,OAAOrC,MAAM,CAACorC,MAAd,KAAyB,WAAzB,IAAwCprC,MAAM,CAACorC,MAAP,CAAcC,IAAd,KAAuB,YAAvE;EACD;;yDAMmBjtC,MAAM;EACxB,MAAI,KAAKomC,wBAAL,EAAJ,EAAqC;EACnCpmC,IAAAA,IAAI,CAAC8+B,KAAL,GAAa,IAAb;EACD;EACF;;QC3xBGpvB,SAAS,GAAG,IAAIw9B,SAAJ,CAActrC,MAAM,CAAC8N,SAArB;EAElB9N,MAAM,CAAC8N,SAAP,GAAmB9N,MAAM,CAAC+N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/modules/visualBuilder/builder_constants.js","src/modules/visualBuilder/pageBuilder.js","src/util/clevertap-handler.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/notification.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\nexport const WIZ_IFRAME = 'wiz-iframe'\nexport const WIZ_IFRAME_INTENT = 'wiz-iframe-intent'\nexport const ADJUST_IFRAME_HEIGHT = 'adjustIFrameHeight'\nexport const UPDATE_HEIGHT = 'update height'\nexport const GET_NOTIFICATION = 'getnotif'\nexport const EVENT = 'Event'\nexport const PROFILE = 'Profile'\nexport const OUL = 'OUL'\nexport const CLOSE_BOX_POPUP = 'closeBoxPopUp'\nexport const CLOSE_BANNER_POPUP = 'closeBannerPopUp'\nexport const GET_NOTIFICATION_DATA = 'getnotifData'\nexport const CLOSE_INTERSTITIAL_POPUP = 'closeInterstitialPopUp'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {}\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n // Initialize array\n var array = []\n\n // Check if globalProfileMap is null, initialize if needed\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n // Check if the value to be set is either string or number\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = $ct.globalProfileMap[propKey]\n array.push(typeof propVal === 'number' ? propVal : propVal.toLowerCase())\n } else {\n $ct.globalProfileMap[propKey] = propVal\n }\n } else {\n // Check if propVal is an array\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = Array.isArray($ct.globalProfileMap[propKey]) ? $ct.globalProfileMap[propKey] : [$ct.globalProfileMap[propKey]]\n }\n\n // Check for case-sensitive inputs and filter the same ones\n for (var i = 0; i < propVal.length; i++) {\n if (typeof propVal[i] === 'number' && !array.includes(propVal[i])) {\n array.push(propVal[i])\n } else if (typeof propVal[i] === 'string' && !array.includes(propVal[i].toLowerCase())) {\n array.push(propVal[i].toLowerCase())\n } else if ((typeof propVal[i] === 'number' && array.includes(propVal[i])) || (typeof propVal[i] === 'string' && array.includes(propVal[i].toLowerCase()))) {\n console.error('Values already included')\n } else {\n console.error('Array supports only string or number type values')\n }\n }\n\n // Update globalProfileMap with the array\n $ct.globalProfileMap[propKey] = array\n }\n\n // Save to local storage or cookie\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Call the sendMultiValueData function\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n var index = $ct.globalProfileMap[propKey].indexOf(propVal)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n } else {\n for (var k = 0; k < propVal.length; k++) {\n var idx = $ct.globalProfileMap[propKey].indexOf(propVal[k])\n if (idx !== -1) {\n $ct.globalProfileMap[propKey].splice(idx, 1)\n }\n }\n }\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n // console.log('Raise notification clicked event for ', item)\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","export const OVERLAY_PATH = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js'\nexport const CSS_PATH = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css'\n","import { CSS_PATH, OVERLAY_PATH } from './builder_constants'\n\n/**\n * Initializes the Clevertap builder.\n * @param {string} url - The URL to initialize the builder.\n * @param {string} variant - The variant of the builder.\n * @param {Object} details - The details object.\n */\nexport const initialiseCTBuilder = (url, variant, details) => {\n document.addEventListener('DOMContentLoaded', () => onContentLoad(url, variant, details))\n}\n\nlet container\n/**\n * Handles content load for Clevertap builder.\n */\nfunction onContentLoad (url, variant, details) {\n document.body.innerHTML = ''\n container = document.createElement('div')\n container.id = 'overlayDiv'\n container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form\n container.style.display = 'flex'\n document.body.appendChild(container)\n const overlayPath = OVERLAY_PATH\n loadOverlayScript(overlayPath, url, variant, details)\n .then(() => {\n console.log('Overlay script loaded successfully.')\n })\n .catch((error) => {\n console.error('Error loading overlay script:', error)\n })\n loadCSS()\n loadTypeKit()\n}\n\n/**\n * Loads CSS file.\n */\nfunction loadCSS () {\n var link = document.createElement('link')\n link.rel = 'stylesheet'\n link.type = 'text/css'\n link.href = CSS_PATH\n document.head.appendChild(link)\n}\n\n/**\n * Loads the overlay script.\n * @param {string} overlayPath - The path to overlay script.\n * @param {string} url - The URL.\n * @param {string} variant - The variant.\n * @param {Object} details - The details object.\n * @returns {Promise} A promise.\n */\nfunction loadOverlayScript (overlayPath, url, variant, details) {\n return new Promise((resolve, reject) => {\n var script = document.createElement('script')\n script.type = 'module'\n script.src = overlayPath\n script.onload = function () {\n if (typeof window.Overlay === 'function') {\n window.Overlay('#overlayDiv', url, variant, details)\n resolve()\n } else {\n reject(new Error('ContentLayout not found in overlay.js'))\n }\n }\n script.onerror = function (error) {\n reject(error)\n }\n document.head.appendChild(script)\n })\n}\n\n/**\n * Loads TypeKit script.\n */\nfunction loadTypeKit () {\n const config = {\n kitId: 'eqj6nom',\n scriptTimeout: 3000,\n async: true\n }\n\n const docElement = document.documentElement\n const timeoutId = setTimeout(function () {\n docElement.className = docElement.className.replace(/\\bwf-loading\\b/g, '') + ' wf-inactive'\n }, config.scriptTimeout)\n const typeKitScript = document.createElement('script')\n let scriptLoaded = false\n const firstScript = document.getElementsByTagName('script')[0]\n let scriptReadyState\n\n docElement.className += ' wf-loading'\n typeKitScript.src = 'https://use.typekit.net/' + config.kitId + '.js'\n typeKitScript.async = true\n typeKitScript.onload = typeKitScript.onreadystatechange = function () {\n scriptReadyState = this.readyState\n if (scriptLoaded || (scriptReadyState && scriptReadyState !== 'complete' && scriptReadyState !== 'loaded')) return\n scriptLoaded = true\n clearTimeout(timeoutId)\n try {\n // eslint-disable-next-line no-undef\n Typekit.load(config)\n } catch (e) {}\n }\n\n firstScript.parentNode.insertBefore(typeKitScript, firstScript)\n}\n\n/**\n * Renders the visual builder.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {boolean} isPreview - Indicates if it's a preview.\n */\nexport const renderVisualBuilder = (targetingMsgJson, isPreview) => {\n const details = isPreview ? targetingMsgJson.details[0] : targetingMsgJson.display.details[0]\n const siteUrl = Object.keys(details)[0]\n const selectors = details[siteUrl]\n\n if (siteUrl === window.location.href.split('?')[0]) {\n for (const selector in selectors) {\n const element = document.querySelector(selector)\n if (element) {\n if (selectors[selector].html) {\n element.outerHTML = selectors[selector].html\n } else {\n // Update json data\n dispatchJsonData(targetingMsgJson, selectors[selector])\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n } else {\n let count = 0\n const intervalId = setInterval(() => {\n const retryElement = document.querySelector(selector)\n if (retryElement) {\n if (selectors[selector].html) {\n retryElement.outerHTML = selectors[selector].html\n } else {\n // Update json data\n dispatchJsonData(targetingMsgJson, selectors[selector])\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n clearInterval(intervalId)\n } else {\n count++\n if (count >= 20) {\n console.log(`No element present on DOM with selector '${selector}'.`)\n clearInterval(intervalId)\n }\n }\n }, 500)\n }\n }\n }\n}\n\n/**\n * Dispatches JSON data.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {Object} selector - The selector object.\n */\nfunction dispatchJsonData (targetingMsgJson, selector) {\n const inaObj = {}\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (selector.json != null) {\n inaObj.json = selector.json\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display_buider', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n}\n","// clevertap-handler.js\n\nconst ctEventhandler = (html) => {\n const ctScript = `\n var clevertap = {\n event: {\n push: (eventName) => {\n window.parent.postMessage({\n action: 'Event',\n value: eventName\n },'*');\n }\n },\n profile: {\n push: (eventName) => {\n window.parent.postMessage({\n action: 'Profile',\n value: eventName\n },'*');\n }\n },\n onUserLogin: {\n push: (eventName) => {\n window.parent.postMessage({\n action: 'OUL',\n value: eventName\n },'*');\n }\n },\n closeBoxPopUp: () => {\n window.parent.postMessage({\n action: 'closeBoxPopUp',\n value: 'closeBoxPopUp'\n },'*');\n },\n closeBannerPopUp: () => {\n window.parent.postMessage({\n action: 'closeBannerPopUp',\n value: 'closeBannerPopUp'\n },'*');\n },\n closeInterstitialPopUp: () => {\n window.parent.postMessage({\n action: 'closeInterstitialPopUp',\n value: 'closeInterstitialPopUp'\n },'*');\n }\n }\n `\n const insertPosition = html.indexOf('\n `\n return html.replace(/(<\\s*\\/\\s*body)/, `${script}\\n$1`)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n const displayObj = targetingMsgJson.display\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = WIZ_IFRAME_INTENT\n let html = targetingMsgJson.msgContent.html\n if (displayObj['custom-editor'] && !displayObj['bee-editor'] && displayObj['custom-html-sandbox']) { // sandbox the iframe only for custom html\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox allow-forms' // allow popup to open url in new page\n html = ctEventhandler(html)\n }\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (targetingMsgJson.display['custom-editor'] && !targetingMsgJson.display['bee-editor'] && targetingMsgJson.display['custom-html-sandbox']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n let contentDiv\n iframe.onload = () => {\n if (targetingMsgJson.display['custom-editor'] && !targetingMsgJson.display['bee-editor'] && targetingMsgJson.display['custom-html-sandbox']) {\n window.addEventListener('message', event => {\n switch (event?.data?.action) {\n case GET_NOTIFICATION_DATA:\n window.clevertap.renderNotificationClicked(event.data.value)\n break\n case EVENT:\n window.clevertap.event.push(event.data.value)\n break\n case PROFILE:\n window.clevertap.profile.push(event.data.value)\n break\n case OUL:\n window.clevertap.onUserLogin.push(event.data.value)\n break\n case CLOSE_INTERSTITIAL_POPUP:\n setTimeout(() => {\n const interstitialWrapper = window.document.getElementById('intentPreview')\n const interstitialOverlay = window.document.getElementById('intentOpacityDiv')\n interstitialOverlay && interstitialOverlay.remove()\n interstitialWrapper && interstitialWrapper.remove()\n }, 0)\n break\n default:\n // Handle unknown action\n break\n }\n })\n contentDiv = ''\n } else {\n contentDiv = document.getElementById(WIZ_IFRAME_INTENT).contentDocument.getElementById('contentDiv')\n }\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n this.#logger.error('Error subscribing: ' + error)\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { initialiseCTBuilder, renderVisualBuilder } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token) {\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n #handleMessageEvent (event) {\n if (event.data && event.data.message) {\n if (event.data.message === 'Dashboard' && event.data.url) {\n initialiseCTBuilder(event.data.url, event.data.variant ?? null, event.data.details ?? {})\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n }\n }\n\n pageChanged () {\n const search = window.location.search\n const parentWindow = window.opener\n\n if (search === '?ctBuilder') {\n // open in visual builder mode\n this.#logger.debug('open in visual builder mode')\n window.addEventListener('message', this.#handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('builder', '*')\n }\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', this.#handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('preview', '*')\n }\n return\n }\n\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","constructor","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","dataPostPEURL","dataPostURL","recorderURL","emailURL","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","WIZ_IFRAME","WIZ_IFRAME_INTENT","ADJUST_IFRAME_HEIGHT","UPDATE_HEIGHT","GET_NOTIFICATION","EVENT","PROFILE","OUL","CLOSE_BOX_POPUP","CLOSE_BANNER_POPUP","GET_NOTIFICATION_DATA","CLOSE_INTERSTITIAL_POPUP","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","save","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","read","data","getItem","parse","e","remove","removeItem","removeCookie","name","domain","cookieStr","document","cookie","createCookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","readCookie","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","saveToLSorCookie","property","location","hostname","$ct","globalCache","readFromLSorCookie","trim","err","createBroadCookie","broadDomain","domainParts","testBroadDomain","testCookieName","tempCookie","getMetaProp","metaObj","setMetaProp","wzrkMetaObj","getAndClearMetaProp","setInstantDeleteFlagInK","k","flag","backupEvent","reqNo","backupArr","q","debug","removeBackup","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","get","item","saveCacheToLS","set","allKeys","objToArray","index","temp","getKey","getSecondLastKey","keysArr","getLastKey","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","s","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","sessionObj","getSessionCookieObject","kIdFromLS","guidFromLRUCache","lastK","lastGUID","unregisterTokenForGuid","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","_processOldValues","getDetails","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","fireRequest","skipARP","sendOULFlag","getDelayFrequency","account","randomDelay","random","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","ProfileHandler","profilesArr","getAttribute","propName","_handleIncrementDecrementValue","command","tz","profile","addSystemDataToObject","addFlags","compressedData","saveAndFireRequest","_handleMultiValueSet","arrayVal","array","toLowerCase","sendMultiValueData","_handleMultiValueAdd","propKey","propVal","_handleMultiValueRemove","_handleMultiValueDelete","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","clear","addToK","ids","g","kId","anonymousUser","foundInCache","gFromCache","Identity","cookieName","loginArr","pop","processProfile","CTWebPersonalisationBanner","HTMLElement","_details","shadow","attachShadow","mode","details","renderBanner","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","target","renderCarousel","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","button","setInterval","sliderTime","goTo","prev","cur","CTWebPopupImageOnly","_session","popup","container","resizeObserver","renderImageOnlyPopup","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","Message","config","message","wrapper","snackBar","renderMessage","createEl","part","_el","msg","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","raiseClickedEvent","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","contains","setBadgeStyle","msgCount","incomingMessages","msgs","updateInboxMessages","incomingMessagesForPreview","previewMsgs","now","buildUIForMessages","updateUnviewedBadgeCounter","connectedCallback","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","addMsgsToInboxFromLS","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","deleteMsgsFromUI","getInboxMessages","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","top","right","getBoundingClientRect","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","inbox_notifs","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","OVERLAY_PATH","CSS_PATH","initialiseCTBuilder","variant","onContentLoad","position","overlayPath","loadOverlayScript","then","catch","loadCSS","loadTypeKit","link","rel","head","script","src","onload","Overlay","Error","onerror","kitId","scriptTimeout","docElement","documentElement","timeoutId","className","typeKitScript","scriptLoaded","firstScript","scriptReadyState","onreadystatechange","Typekit","load","renderVisualBuilder","targetingMsgJson","siteUrl","selectors","selector","element","querySelector","outerHTML","dispatchJsonData","intervalId","retryElement","inaObj","json","kvPairsEvent","CustomEvent","dispatchEvent","ctEventhandler","ctScript","insertPosition","join","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","onclick","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","sandbox","pointerCss","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","closeCampaign","Event","appendScriptForCustomEvent","srcdoc","handleMessage","heightAdjust","boxWrapper","bannerWrapper","margin","onUserLogin","handleIframeLoad","contentWindow","postMessage","contentDocument","scrollHeight","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","interstitialWrapper","interstitialOverlay","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","getTotalVisits","visitCount","getLastVisit","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","info","debugPE","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","getTimeElapsed","sessionStart","getPageCount","seqNo","requestTime","RequestManager","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","post","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","_enableWebPush","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","skipDialog","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","getValue","getdefaultValue","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","addValueChangedCallback","removeValueChangedCallback","clearStartFlag","VariableStore","syncVariables","onSyncSuccess","onSyncFailure","meta","tk","r","status","fetchVariables","onFetchCallback","addVariablesChangedCallback","callback","addOneTimeVariablesChangedCallback","removeVariablesChangedCallback","removeOneTimeVariablesChangedCallback","callBack","CleverTap","spa","isSpa","bind","enablePersonalization","_isPersonalisationActive","ReqestManager","privacy","notifications","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","handleDecrementValue","setMultiValuesForKey","addMultiValueForKey","addMultiValuesForKey","removeMultiValueForKey","removeMultiValuesForKey","removeValueForKey","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","sendLocationData","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","elements","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","parentWindow","opener","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","setOffline","arg","defineVariable","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;EAAO,MAAMA,aAAa,GAAG,oBAAtB;EACA,MAAMC,eAAe,GAAG,QAAxB;EACA,MAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;ECAQ,MAAMC,OAAN,CAAc;EAO3BC,EAAAA,WAAW,GAAsE;EAAA,QAApE;EAAEC,MAAAA;EAAF,KAAoE,uEAA3D,EAA2D;EAAA,QAAvDC,MAAuD,uEAA9C,EAA8C;EAAA,QAA1CC,YAA0C,uEAA3BP,aAA2B;EAAA,QAAZQ,KAAY,uEAAJ,EAAI;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,aALvE;EAKuE;EAAA;EAAA;EAAA,aAJjER;EAIiE;EAAA;EAAA;EAAA,a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CAAeE,IAAf,CAAD,8BAAuB,IAAvB,wBAA/B,CAAtB;;EAEA,4DAAcwX,kBAAd,CAAiCnI,WAAjC,EAA8CpN,GAAG,CAACgC,YAAlD;EACD;;yDAEoB;EACnB,SAAQ,OAAOrC,MAAM,CAACorC,MAAd,KAAyB,WAAzB,IAAwCprC,MAAM,CAACorC,MAAP,CAAcC,IAAd,KAAuB,YAAvE;EACD;;yDAMmBjtC,MAAM;EACxB,MAAI,KAAKomC,wBAAL,EAAJ,EAAqC;EACnCpmC,IAAAA,IAAI,CAAC8+B,KAAL,GAAa,IAAb;EACD;EACF;;QC3xBGpvB,SAAS,GAAG,IAAIw9B,SAAJ,CAActrC,MAAM,CAAC8N,SAArB;EAElB9N,MAAM,CAAC8N,SAAP,GAAmB9N,MAAM,CAAC+N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file diff --git a/clevertap.min.js b/clevertap.min.js index 7ed91725..e61db3d6 100644 --- a/clevertap.min.js +++ b/clevertap.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).clevertap=t()}(this,(function(){"use strict";var e=0;function t(t){return"__private_"+e+++"_"+t}function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}const o="clevertap-prod.com",n="https:";var s=t("accountId"),r=t("region"),a=t("targetDomain"),l=t("dcSdkversion"),d=t("token");class c{constructor(){let{id:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";Object.defineProperty(this,s,{writable:!0,value:void 0}),Object.defineProperty(this,r,{writable:!0,value:""}),Object.defineProperty(this,a,{writable:!0,value:o}),Object.defineProperty(this,l,{writable:!0,value:""}),Object.defineProperty(this,d,{writable:!0,value:""}),this.id=e,t&&(this.region=t),i&&(this.targetDomain=i),n&&(this.token=n)}get id(){return i(this,s)[s]}set id(e){i(this,s)[s]=e}get region(){return i(this,r)[r]}set region(e){i(this,r)[r]=e}get dcSDKVersion(){return i(this,l)[l]}set dcSDKVersion(e){i(this,l)[l]=e}get targetDomain(){return i(this,a)[a]}set targetDomain(e){i(this,a)[a]=e}get token(){return i(this,d)[d]}set token(e){i(this,d)[d]=e}get finalTargetDomain(){return this.region?"".concat(this.region,".").concat(this.targetDomain):this.targetDomain===o?"".concat("eu1",".").concat(this.targetDomain):this.targetDomain}get dataPostPEURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/defineVars")}get dataPostURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/a?t=96")}get recorderURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/r?r=1")}get emailURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/e?r=1")}}const h=new RegExp("^\\s+|\\.|:|\\$|'|\"|\\\\|\\s+$","g"),u=new RegExp("^\\s+|'|\"|\\\\|\\s+$","g"),p=new RegExp("'","g"),g="clear",v="Charged ID",f="WZRK_CHARGED_ID",b="WZRK_G",m="WZRK_K",y="WZRK_CAMP",w="WZRK_CAMP_G",C="WZRK_EV",k="WZRK_META",x="WZRK_PR",P="WZRK_ARP",I="WZRK_L",S="global",O="optOut",_="useIP",E="WZRK_X",A="push",M=31536e3,L="wzrk_",T="wzrk_id",R="Notification Viewed",j="Notification Clicked",D="WZRK_FPU",B="WZRK_PSD",N="$incr",z="$add",U="$remove",F="$delete",q="WZRK_INBOX_CONFIG",V="WZRK_INBOX",W=1e3,K="wzrk_fetch",H="wiz-iframe",G="wiz-iframe-intent",J="Event",Z="Profile",$=["Stayed","UTM Visited","App Launched","Notification Sent",R,j],Y=e=>"string"==typeof e||e instanceof String,Q=e=>"[object Object]"===Object.prototype.toString.call(e),X=e=>"object"==typeof e&&e instanceof Date,ee=e=>{for(const t in e)if(e.hasOwnProperty(t))return!1;return!0},te=e=>!isNaN(parseFloat(e))&&isFinite(e),ie=e=>/^-?[\d.]+(?:e-?\d+)?$/.test(e)&&"number"==typeof e,oe=e=>null!=e&&"undefined"!==e,ne=(e,t)=>{if("object"!=typeof e){let i;return Y(e)?(i=se(e,u),i.length>1024&&(i=i.substring(0,1024),t.reportError(521,i+"... length exceeded 1024 chars. Trimmed."))):i=e,i}for(const i in e)if(e.hasOwnProperty(i)){const o=ne(e[i],t);let n;n=se(i,h),n.length>1024&&(n=n.substring(0,1024),t.reportError(520,n+"... length exceeded 1024 chars. Trimmed.")),delete e[i],e[n]=o}return e},se=(e,t)=>e.replace(t,""),re=()=>{const e=new Date;return e.getFullYear()+""+e.getMonth()+e.getDay()},ae=()=>Math.floor((new Date).getTime()/1e3),le=e=>"$D_"+Math.round(e.getTime()/1e3),de=e=>{if(ce(e))return"$D_"+e},ce=e=>{const t=/^(\d{4})(\d{2})(\d{2})$/.exec(e);if(null==t)return!1;const i=t[3],o=t[2]-1,n=t[1],s=new Date(n,o,i);return s.getDate()==i&&s.getMonth()==o&&s.getFullYear()==n};class he{static save(e,t){return!(!e||!t)&&(this._isLocalStorageSupported()?(localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),!0):void 0)}static read(e){if(!e)return!1;let t=null;if(this._isLocalStorageSupported()&&(t=localStorage.getItem(e)),null!=t)try{t=JSON.parse(t)}catch(e){}return t}static remove(e){return!!e&&(this._isLocalStorageSupported()?(localStorage.removeItem(e),!0):void 0)}static removeCookie(e,t){let i=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";t&&(i=i+" domain="+t+"; path=/"),document.cookie=i}static createCookie(e,t,i,o){let n="",s="";if(i){const e=new Date;e.setTime(e.getTime()+1e3*i),n="; expires="+e.toGMTString()}o&&(s="; domain="+o),t=encodeURIComponent(t),document.cookie=e+"="+t+n+s+"; path=/"}static readCookie(e){const t=e+"=",i=document.cookie.split(";");for(let e=0;e=0;o--){if(a=0===o?r[o]+a:"."+r[o]+a,this.readCookie(e)){var n="test_"+e+o;if(this.createCookie(n,t,10,a),!this.readCookie(n))continue;this.removeCookie(n,a)}this.createCookie(e,t,i,a);if(this.readCookie(e)==t){s=a,ue.broadDomain=s;break}}}else this.createCookie(e,t,i,s)}else this.createCookie(e,t,i,o)}static getMetaProp(e){const t=this.readFromLSorCookie(k);if(null!=t)return t[e]}static setMetaProp(e,t){if(this._isLocalStorageSupported()){let i=this.readFromLSorCookie(k);null==i&&(i={}),void 0===t?delete i[e]:i[e]=t,this.saveToLSorCookie(k,i)}}static getAndClearMetaProp(e){const t=this.getMetaProp(e);return this.setMetaProp(e,void 0),t}static setInstantDeleteFlagInK(){let e=this.readFromLSorCookie(m);null==e&&(e={}),e.flag=!0,this.saveToLSorCookie(m,e)}static backupEvent(e,t,i){let o=this.readFromLSorCookie(I);void 0===o&&(o={}),o[t]={q:e},this.saveToLSorCookie(I,o),i.debug("stored in ".concat(I," reqNo : ").concat(t," -> ").concat(e))}static removeBackup(e,t){const i=this.readFromLSorCookie(I);null!=i&&void 0!==i[e]&&(t.debug("del event: ".concat(e," data-> ").concat(i[e].q)),delete i[e],this.saveToLSorCookie(I,i))}}const ue={globalCache:{gcookie:null,REQ_N:0,RESP_N:0},LRU_CACHE:null,globalProfileMap:void 0,globalEventsMap:void 0,blockRequest:!1,isOptInRequest:!1,broadDomain:null,webPushEnabled:null,campaignDivMap:{},currentSessionId:null,wiz_counter:0,notifApi:{notifEnabledFromApi:!1},unsubGroups:[],updatedCategoryLong:null,inbox:null,isPrivacyArrPushed:!1,privacyArray:[],offline:!1,location:null,dismissSpamControl:!1,globalUnsubscribe:!0,flutterVersion:null,variableStore:{}};var pe=t("keyOrder"),ge=t("deleteFromObject");class ve{constructor(e){Object.defineProperty(this,ge,{value:fe}),Object.defineProperty(this,pe,{writable:!0,value:void 0}),this.max=e;let t=he.readFromLSorCookie(E);if(t){const e={};i(this,pe)[pe]=[],t=t.cache;for(const o in t)t.hasOwnProperty(o)&&(e[t[o][0]]=t[o][1],i(this,pe)[pe].push(t[o][0]));this.cache=e}else this.cache={},i(this,pe)[pe]=[]}get(e){const t=this.cache[e];return t&&(this.cache=i(this,ge)[ge](e,this.cache),this.cache[e]=t,i(this,pe)[pe].push(e)),this.saveCacheToLS(this.cache),t}set(e,t){const o=this.cache[e],n=i(this,pe)[pe];null!=o?this.cache=i(this,ge)[ge](e,this.cache):n.length===this.max&&(this.cache=i(this,ge)[ge](n[0],this.cache)),this.cache[e]=t,i(this,pe)[pe][i(this,pe)[pe]-1]!==e&&i(this,pe)[pe].push(e),this.saveCacheToLS(this.cache)}saveCacheToLS(e){const t=[],o=i(this,pe)[pe];for(const i in o)if(o.hasOwnProperty(i)){const n=[];n.push(o[i]),n.push(e[o[i]]),t.push(n)}he.saveToLSorCookie(E,{cache:t})}getKey(e){if(null===e)return null;const t=i(this,pe)[pe];for(const i in t)if(t.hasOwnProperty(i)&&this.cache[t[i]]===e)return t[i];return null}getSecondLastKey(){const e=i(this,pe)[pe];return null!=e&&e.length>1?e[e.length-2]:-1}getLastKey(){const e=i(this,pe)[pe].length;if(e)return i(this,pe)[pe][e-1]}}var fe=function(e,t){const o=JSON.parse(JSON.stringify(i(this,pe)[pe])),n={};let s;for(const i in o)o.hasOwnProperty(i)&&(o[i]!==e?n[o[i]]=t[o[i]]:s=i);return o.splice(s,1),i(this,pe)[pe]=JSON.parse(JSON.stringify(o)),n},be=t("logger"),me=t("request"),ye=t("device"),we=t("session");class Ce{constructor(e){let{logger:t,request:o,device:n,session:s}=e;Object.defineProperty(this,be,{writable:!0,value:void 0}),Object.defineProperty(this,me,{writable:!0,value:void 0}),Object.defineProperty(this,ye,{writable:!0,value:void 0}),Object.defineProperty(this,we,{writable:!0,value:void 0}),i(this,be)[be]=t,i(this,me)[me]=o,i(this,ye)[ye]=n,i(this,we)[we]=s}s(e,t,o,n,s){let r=!1,a=!1;if(window.isOULInProgress&&(o||"undefined"!==n&&n===window.oulReqN)&&(window.isOULInProgress=!1,r=!0),void 0===n&&(n=0),he.removeBackup(n,i(this,be)[be]),n>ue.globalCache.REQ_N)return;if(oe(i(this,ye)[ye].gcookie)||e&&(a=!0),!oe(i(this,ye)[ye].gcookie)||o||"boolean"==typeof s){const n=i(this,we)[we].getSessionCookieObject();if(window.isOULInProgress||n.s&&t{if(Q(e)){for(var t in e)if(e.hasOwnProperty(t)){if(Q(e[t])||Array.isArray(e[t]))return!1;X(e[t])&&(e[t]=le(e[t]))}return!0}return!1},Ne=(e,t)=>{if(Q(e)){for(var i in e)if(e.hasOwnProperty(i))if("Items"===i){if(!Array.isArray(e[i]))return!1;for(var o in e[i].length>50&&t.reportError(522,"Charged Items exceed 50 limit. Actual count: "+e[i].length),e[i])if(e[i].hasOwnProperty(o)&&(!Q(e[i][o])||!Be(e[i][o])))return!1}else{if(Q(e[i])||Array.isArray(e[i]))return!1;X(e[i])&&(e[i]=le(e[i]))}if(Y(e[v])||ie(e[v])){const i=e[v]+"";if(void 0===De&&(De=he.readFromLSorCookie(f)),void 0!==De&&De.trim()===i.trim())return t.error("Duplicate charged Id - Dropped"+e),!1;De=i,he.saveToLSorCookie(f,i)}return!0}return!1};var ze=t("logger"),Ue=t("oldValues"),Fe=t("request"),qe=t("isPersonalisationActive"),Ve=t("processEventArray");class We extends Array{constructor(e,t){let{logger:o,request:n,isPersonalisationActive:s}=e;super(),Object.defineProperty(this,Ve,{value:Ke}),Object.defineProperty(this,ze,{writable:!0,value:void 0}),Object.defineProperty(this,Ue,{writable:!0,value:void 0}),Object.defineProperty(this,Fe,{writable:!0,value:void 0}),Object.defineProperty(this,qe,{writable:!0,value:void 0}),i(this,ze)[ze]=o,i(this,Ue)[Ue]=t,i(this,Fe)[Fe]=n,i(this,qe)[qe]=s}push(){for(var e=arguments.length,t=new Array(e),o=0;o0;){var t=e.shift();if(!Y(t)){i(this,ze)[ze].error(Oe);continue}if(t.length>1024&&(t=t.substring(0,1024),i(this,ze)[ze].reportError(510,t+"... length exceeded 1024 chars. Trimmed.")),$.includes(t)){i(this,ze)[ze].reportError(513,t+" is a restricted system event. It cannot be used as an event name.");continue}const o={type:"event"};if(o.evtName=se(t,h),0!==e.length){const n=e.shift();if(Q(n)){if("Charged"===t){if(!Ne(n,i(this,ze)[ze])){i(this,ze)[ze].reportError(511,"Charged event structure invalid. Not sent.");continue}}else if(!Be(n)){i(this,ze)[ze].reportError(512,t+" event structure invalid. Not sent.");continue}o.evtData=n}else e.unshift(n)}i(this,Fe)[Fe].processEvent(o)}};const He=e=>{const t={},i=e.indexOf("?");if(i>1){const o=e.substring(i+1);let n;const s=/\+/g,r=/([^&=]+)=?([^&]*)/g,a=function(e){let t=e.replace(s," ");try{t=decodeURIComponent(t)}catch(e){}return t};for(n=r.exec(o);n;)t[a(n[1])]=a(n[2]),n=r.exec(o)}return t},Ge=(e,t,i)=>e+"&"+t+"="+encodeURIComponent(i),Je=()=>window.location.hostname,Ze=(e,t)=>(t&&"function"==typeof t.debug&&t.debug("dobj:"+e),Ye(e)),$e=(()=>{let e="",t=0;for(t=0;t<=25;t++)e+=String.fromCharCode(t+65);for(t=0;t<=25;t++)e+=String.fromCharCode(t+97);for(t=0;t<10;t++)e+=t;return e+"+/="})(),Ye=e=>{if(null==e)return"";var t,i,o,n,s,r,a,l="",d=0;for(e=(e=>{if(null==e)return"";let t,i,o,n={},s={},r="",a="",l="",d=2,c=3,h=2,u="",p=0,g=0,v=String.fromCharCode;for(o=0;o>=1}else{for(i=1,t=0;t>=1}d--,0==d&&(d=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;d--,0==d&&(d=Math.pow(2,h),h++),n[a]=c++,l=String(r)}if(""!==l){if(Object.prototype.hasOwnProperty.call(s,l)){if(l.charCodeAt(0)<256){for(t=0;t>=1}else{for(i=1,t=0;t>=1}d--,0==d&&(d=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;d--,0==d&&(d=Math.pow(2,h),h++)}for(i=2,t=0;t>=1;for(;;){if(p<<=1,15==g){u+=v(p);break}g++}return u})(e);d<2*e.length;)d%2==0?(t=e.charCodeAt(d/2)>>8,i=255&e.charCodeAt(d/2),o=d/2+1>8:NaN):(t=255&e.charCodeAt((d-1)/2),(d+1)/2>8,o=255&e.charCodeAt((d+1)/2)):i=o=NaN),d+=3,n=t>>2,s=(3&t)<<4|i>>4,r=(15&i)<<2|o>>6,a=63&o,isNaN(i)?r=a=64:isNaN(o)&&(a=64),l=l+$e.charAt(n)+$e.charAt(s)+$e.charAt(r)+$e.charAt(a);return l};var Qe=t("fireRequest"),Xe=t("dropRequestDueToOptOut"),et=t("addUseIPToRequest"),tt=t("addARPToRequest");class it{constructor(){this.networkRetryCount=0,this.minDelayFrequency=0}static fireRequest(e,t,o,n){i(this,Qe)[Qe](e,1,t,o,n)}getDelayFrequency(){if(this.logger.debug("Network retry #"+this.networkRetryCount),this.networkRetryCount<10)return this.logger.debug(this.account.id,"Failure count is "+this.networkRetryCount+". Setting delay frequency to 1s"),this.minDelayFrequency=W,this.minDelayFrequency;if(null==this.account.region)return this.logger.debug(this.account.id,"Setting delay frequency to 1s"),W;{const e=1e3*(Math.floor(10*Math.random())+1);return this.minDelayFrequency+=e,this.minDelayFrequency<6e5?(this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency):(this.minDelayFrequency=W,this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency)}}}it.logger=void 0,it.device=void 0,it.account=void 0,Object.defineProperty(it,Qe,{value:function(e,t,o,n,s){var r,a;if(i(this,Xe)[Xe]())return void this.logger.debug("req dropped due to optout cookie: "+this.device.gcookie);if(oe(this.device.gcookie)||(ue.blockRequest=!0),s&&s===K)!oe(this.device.gcookie)&&ue.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(this.networkRetryCount)),i(this,Qe)[Qe](e,void 0,o,n)}),this.getDelayFrequency());else if(!oe(this.device.gcookie)&&ue.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(t)),i(this,Qe)[Qe](e,t+1,o,n)}),50);if(n?window.isOULInProgress=!0:(oe(this.device.gcookie)&&(e=Ge(e,"gc",this.device.gcookie)),e=i(this,tt)[tt](e,o)),e=Ge(e,"tries",t),e=i(this,et)[et](e),e=Ge(e,"r",(new Date).getTime()),(null===(r=window.clevertap)||void 0===r?void 0:r.hasOwnProperty("plugin"))||(null===(a=window.wizrocket)||void 0===a?void 0:a.hasOwnProperty("plugin"))){const t=window.clevertap.plugin||window.wizrocket.plugin;e=Ge(e,"ct_pl",t)}-1!==e.indexOf("chrome-extension:")&&(e=e.replace("chrome-extension:","https:"));for(var l=document.getElementsByClassName("ct-jp-cb");l[0]&&l[0].parentNode;)l[0].parentNode.removeChild(l[0]);const d=document.createElement("script");d.setAttribute("type","text/javascript"),d.setAttribute("src",e),d.setAttribute("class","ct-jp-cb"),d.setAttribute("rel","nofollow"),d.async=!0,document.getElementsByTagName("head")[0].appendChild(d),this.logger.debug("req snt -> url: "+e)}}),Object.defineProperty(it,Xe,{value:function(){return!ue.isOptInRequest&&oe(this.device.gcookie)&&Y(this.device.gcookie)?":OO"===this.device.gcookie.slice(-3):(ue.isOptInRequest=!1,!1)}}),Object.defineProperty(it,et,{value:function(e){var t=he.getMetaProp(_);return"boolean"!=typeof t&&(t=!1),Ge(e,_,t?"true":"false")}}),Object.defineProperty(it,tt,{value:function(e,t){if(!0===t){const t={skipResARP:!0};return Ge(e,"arp",Ze(JSON.stringify(t),this.logger))}return he._isLocalStorageSupported()&&void 0!==localStorage.getItem(P)&&null!==localStorage.getItem(P)?Ge(e,"arp",Ze(JSON.stringify(he.readFromLSorCookie(P)),this.logger)):e}});const ot=()=>{let e={};if(he._isLocalStorageSupported()){let t=he.read(y);null!=t?(t=JSON.parse(decodeURIComponent(t).replace(p,'"')),t.hasOwnProperty("global")?e.wp=t:e=t):e={}}return e},nt=e=>{if(he._isLocalStorageSupported()){const t={...ot(),...e},i=JSON.stringify(t);he.save(y,encodeURIComponent(i)),st()}},st=()=>{if(he._isLocalStorageSupported()){let i=he.read(b);if(oe(i))try{i=JSON.parse(decodeURIComponent(he.read(b)));const o=he.read(w)?JSON.parse(decodeURIComponent(he.read(w))):{};if(i&&he._isLocalStorageSupported()){var e={},t=ot();Object.keys(t).forEach((n=>{const s=i in o&&Object.keys(o[i]).length&&o[i][n]?o[i][n]:{},r=t[n].global,a=re(),l=t[n][a];if(void 0!==r){const e=Object.keys(r);for(const t in e){let i=[];if(e.hasOwnProperty(t)){let o=0,n=0;const a=e[t];if("tc"===a)continue;void 0!==l&&void 0!==l[a]&&(o=l[a]),void 0!==r&&void 0!==r[a]&&(n=r[a]),i=[a,o,n],s[a]=i}}}e={...e,[n]:s}})),o[i]=e,he.save(w,encodeURIComponent(JSON.stringify(o)))}}catch(e){console.error("Invalid clevertap Id "+e)}}},rt=()=>{const e=JSON.parse(decodeURIComponent(he.read(b)));let t={};if(he._isLocalStorageSupported()){let i={};t=ot();const o=he.read(w),n=o?decodeURIComponent(o):null,s=n?JSON.parse(n):null,r=e&&null!=o&&s&&s[e]&&s[e].wp?Object.values(s[e].wp):[],a=e&&null!=o&&s&&s[e]&&s[e].wi?Object.values(s[e].wi):[],l=re();let d=0,c=0;return t.wp&&t.wp[l]&&"undefined"!==t.wp[l].tc&&(d=t.wp[l].tc),t.wi&&t.wi[l]&&"undefined"!==t.wi[l].tc&&(c=t.wi[l].tc),i={wmp:d,wimp:c,tlc:r,witlc:a},i}},at=(e,t)=>{let{logger:i}=t,o=!1;if(Q(e))for(const t in e)if(e.hasOwnProperty(t)){o=!0;let n=e[t];if(null==n){delete e[t];continue}"Gender"!==t||n.match(/^M$|^F$/)||(o=!1,i.error(_e)),"Employed"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Ee)),"Married"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Ae)),"Education"!==t||n.match(/^School$|^College$|^Graduate$/)||(o=!1,i.error(Me)),"Age"===t&&null!=n&&(te(n)?e.Age=+n:(o=!1,i.error(Le))),"DOB"===t?(/^\$D_/.test(n)&&11===(n+"").length||X(n)||(o=!1,i.error(Te)),X(n)&&(e[t]=le(n))):X(n)&&(e[t]=le(n)),"Phone"!==t||ee(n)||(n.length>8&&"+"===n.charAt(0)?(n=n.substring(1,n.length),te(n)?e.Phone=+n:(o=!1,i.error(je+". Removed."))):(o=!1,i.error(je+". Removed."))),o||delete e[t]}return o},lt=e=>{const t={};t.Name=e.name,null!=e.id&&(t.FBID=e.id+""),"male"===e.gender?t.Gender="M":"female"===e.gender?t.Gender="F":t.Gender="O";null!=e.relationship_status&&(t.Married="N","Married"===e.relationship_status&&(t.Married="Y"));const i=function(e){if(null!=e){let t="",i="";for(let o=0;o0?"Y":"N",null!=e.email&&(t.Email=e.email),null!=e.birthday){const i=e.birthday.split("/");t.DOB=de(i[2]+i[0]+i[1])}return t},dt=(e,t)=>{let{logger:i}=t;const o={};if(null!=e.displayName&&(o.Name=e.displayName),null!=e.id&&(o.GPID=e.id+""),null!=e.gender&&("male"===e.gender?o.Gender="M":"female"===e.gender?o.Gender="F":"other"===e.gender&&(o.Gender="O")),null!=e.image&&!1===e.image.isDefault&&(o.Photo=e.image.url.split("?sz")[0]),null!=e.emails)for(let t=0;t{if(he._isLocalStorageSupported()){if(null==ue.globalProfileMap&&(ue.globalProfileMap=he.readFromLSorCookie(x),null==ue.globalProfileMap&&(ue.globalProfileMap={})),null!=e._custom){const t=e._custom;for(const i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);delete e._custom}for(const i in e)if(e.hasOwnProperty(i)){if(ue.globalProfileMap.hasOwnProperty(i)&&!t)continue;ue.globalProfileMap[i]=e[i]}null!=ue.globalProfileMap._custom&&delete ue.globalProfileMap._custom,he.saveToLSorCookie(x,ue.globalProfileMap)}},ht=(e,t,i)=>{if(null!=e&&"-1"!==e&&he._isLocalStorageSupported()){const t=ot();let o=t.wp[i];null==o&&(o={},t[i]=o),o[e]="dnd",nt(t)}if(null!=ue.campaignDivMap){const t=ue.campaignDivMap[e];null!=t&&(document.getElementById(t).style.display="none","intentPreview"===t&&null!=document.getElementById("intentOpacityDiv")&&(document.getElementById("intentOpacityDiv").style.display="none"))}};var ut=t("logger"),pt=t("request"),gt=t("account"),vt=t("oldValues"),ft=t("isPersonalisationActive"),bt=t("processProfileArray");class mt extends Array{constructor(e,t){let{logger:o,request:n,account:s,isPersonalisationActive:r}=e;super(),Object.defineProperty(this,bt,{value:yt}),Object.defineProperty(this,ut,{writable:!0,value:void 0}),Object.defineProperty(this,pt,{writable:!0,value:void 0}),Object.defineProperty(this,gt,{writable:!0,value:void 0}),Object.defineProperty(this,vt,{writable:!0,value:void 0}),Object.defineProperty(this,ft,{writable:!0,value:void 0}),i(this,ut)[ut]=o,i(this,pt)[pt]=n,i(this,gt)[gt]=s,i(this,vt)[vt]=t,i(this,ft)[ft]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o0)for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];let n,s={};if(null!=o.Site){if(n=o.Site,ee(n)||!at(n,{logger:i(this,ut)[ut]}))return}else if(null!=o.Facebook){const e=o.Facebook;ee(e)||e.error||(n=lt(e))}else if(null!=o["Google Plus"]){const e=o["Google Plus"];ee(e)||e.error||(n=dt(e,{logger:i(this,ut)[ut]}))}if(null!=n&&!ee(n)){s.type="profile",null==n.tz&&(n.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),s.profile=n,ct(n,!0),s=i(this,pt)[pt].addSystemDataToObject(s,void 0),i(this,pt)[pt].addFlags(s);const e=Ze(JSON.stringify(s),i(this,ut)[ut]);let t=i(this,gt)[gt].dataPostURL;t=Ge(t,"type",A),t=Ge(t,"d",e),i(this,pt)[pt].saveAndFireRequest(t,ue.blockRequest)}}},wt=t("request"),Ct=t("logger"),kt=t("account"),xt=t("session"),Pt=t("oldValues"),It=t("device"),St=t("processOUL"),Ot=t("handleCookieFromCache"),_t=t("deleteUser"),Et=t("processLoginArray");class At extends Array{constructor(e,t){let{request:o,account:n,session:s,logger:r,device:a}=e;super(),Object.defineProperty(this,Et,{value:Rt}),Object.defineProperty(this,_t,{value:Tt}),Object.defineProperty(this,Ot,{value:Lt}),Object.defineProperty(this,St,{value:Mt}),Object.defineProperty(this,wt,{writable:!0,value:void 0}),Object.defineProperty(this,Ct,{writable:!0,value:void 0}),Object.defineProperty(this,kt,{writable:!0,value:void 0}),Object.defineProperty(this,xt,{writable:!0,value:void 0}),Object.defineProperty(this,Pt,{writable:!0,value:void 0}),Object.defineProperty(this,It,{writable:!0,value:void 0}),i(this,wt)[wt]=o,i(this,kt)[kt]=n,i(this,xt)[xt]=s,i(this,Ct)[Ct]=r,i(this,Pt)[Pt]=t,i(this,It)[It]=a}clear(){i(this,Ct)[Ct].debug("clear called. Reset flag has been set."),i(this,_t)[_t](),he.setMetaProp(g,!0)}push(){for(var e=arguments.length,t=new Array(e),o=0;o{let o=he.readFromLSorCookie(m);const n=he.readFromLSorCookie(b);let s;if(null==o)o={},s=e;else{s=o.id;let r=!1,a=!1;if(null==s&&(s=e[0],r=!0),null==ue.LRU_CACHE&&he._isLocalStorageSupported()&&(ue.LRU_CACHE=new ve(100)),r)null!=n&&(ue.LRU_CACHE.set(s,n),ue.blockRequest=!1);else for(const t in e)if(e.hasOwnProperty(t)){const i=e[t];if(ue.LRU_CACHE.cache[i]){s=i,a=!0;break}}if(a){s!==ue.LRU_CACHE.getLastKey()?i(this,Ot)[Ot]():(t=!1,he.saveToLSorCookie(D,t));const e=ue.LRU_CACHE.get(s);ue.LRU_CACHE.set(s,e),he.saveToLSorCookie(b,e),i(this,It)[It].gcookie=e;const o=ue.LRU_CACHE.getSecondLastKey();if(he.readFromLSorCookie(D)&&-1!==o){const e=ue.LRU_CACHE.cache[o];i(this,wt)[wt].unregisterTokenForGuid(e)}}else r?null!=n&&(i(this,It)[It].gcookie=n,he.saveToLSorCookie(b,n),t=!1):this.clear(),he.saveToLSorCookie(D,!1),s=e[0]}o.id=s,he.saveToLSorCookie(m,o)};if(Array.isArray(e)&&e.length>0)for(const n in e)if(e.hasOwnProperty(n)){const s=e[n];let r,a={};if(null!=s.Site){if(r=s.Site,ee(r)||!at(r,{logger:i(this,Ct)[Ct]}))return}else if(null!=s.Facebook){const e=s.Facebook;ee(e)||e.error||(r=lt(e))}else if(null!=s["Google Plus"]){const e=s["Google Plus"];ee(e)&&!e.error&&(r=dt(e,{logger:i(this,Ct)[Ct]}))}if(null!=r&&!ee(r)){a.type="profile",null==r.tz&&(r.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),a.profile=r;const e=[];he._isLocalStorageSupported()&&(r.Identity&&e.push(r.Identity),r.Email&&e.push(r.Email),r.GPID&&e.push("GP:"+r.GPID),r.FBID&&e.push("FB:"+r.FBID),e.length>0&&o(e)),ct(r,!0),a=i(this,wt)[wt].addSystemDataToObject(a,void 0),i(this,wt)[wt].addFlags(a),t&&(a.isOUL=!0);const n=Ze(JSON.stringify(a),i(this,Ct)[Ct]);let s=i(this,kt)[kt].dataPostURL;s=Ge(s,"type",A),s=Ge(s,"d",n),i(this,wt)[wt].saveAndFireRequest(s,ue.blockRequest,t)}}},Lt=function(){ue.blockRequest=!1,console.debug("Block request is false"),he._isLocalStorageSupported()&&(delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),he.removeCookie(y,Je()),he.removeCookie(i(this,xt)[xt].cookieName,ue.broadDomain),he.removeCookie(P,ue.broadDomain),i(this,xt)[xt].setSessionCookieObject("")},Tt=function(){ue.blockRequest=!0,i(this,Ct)[Ct].debug("Block request is true"),ue.globalCache={gcookie:null,REQ_N:0,RESP_N:0},he._isLocalStorageSupported()&&(delete localStorage.WZRK_G,delete localStorage.WZRK_K,delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),he.removeCookie(b,ue.broadDomain),he.removeCookie(y,Je()),he.removeCookie(m,Je()),he.removeCookie(i(this,xt)[xt].cookieName,ue.broadDomain),he.removeCookie(P,ue.broadDomain),i(this,It)[It].gcookie=null,i(this,xt)[xt].setSessionCookieObject("")},Rt=function(e){if(Array.isArray(e)&&e.length>0){const t=e.pop();if(null!=t&&Q(t)&&(null!=t.Site&&Object.keys(t.Site).length>0||null!=t.Facebook&&Object.keys(t.Facebook).length>0||null!=t["Google Plus"]&&Object.keys(t["Google Plus"]).length>0)){he.setInstantDeleteFlagInK();try{i(this,St)[St]([t])}catch(e){i(this,Ct)[Ct].debug(e)}}else i(this,Ct)[Ct].error("Profile object is in incorrect format")}};class jt extends HTMLElement{constructor(){super(),this._details=null,this.shadow=null,this.shadow=this.attachShadow({mode:"open"})}get details(){return this._details||""}set details(e){null===this._details&&(this._details=e,this.renderBanner())}renderBanner(){this.shadow.innerHTML=this.getBannerContent(),!1!==this.trackClick&&this.addEventListener("click",(()=>{const e=this.details.onClick;e&&(this.details.window?window.open(e,"_blank"):window.parent.location.href=e),window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId})}getBannerContent(){return'\n \n \n ")}}class Dt extends HTMLElement{constructor(){super(),this._target=null,this._carousel=null,this.shadow=null,this.slides=0,this.previouslySelectedItem=-1,this.selectedItem=1,this.autoSlide=null,this.stopAutoSlideTimeout=null,this.shadow=this.attachShadow({mode:"open"}),void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",jt)}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderCarousel())}get details(){return this.target.display.details}get display(){return this.target.display}renderCarousel(){this.slides=this.details.length,this.shadow.innerHTML=this.getStyles();const e=this.getCarouselContent();this.display.showNavBtns&&e.insertAdjacentHTML("beforeend",this.display.navBtnsHtml),this.display.showNavArrows&&(e.insertAdjacentHTML("beforeend",this.display.leftNavArrowHtml),e.insertAdjacentHTML("beforeend",this.display.rightNavArrowHtml)),this._carousel=e,this.shadow.appendChild(e),this.setupClick(),this.updateSelectedItem(),this.startAutoSlide(),this.setupOnHover(),window.clevertap.renderNotificationViewed({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot})}setupClick(){this._carousel.addEventListener("click",(e=>{const t=e.target.id;if(t.startsWith("carousel__button")){const e=+t.split("-")[1];e!==this.selectedItem&&(this.previouslySelectedItem=this.selectedItem,this.selectedItem=e,this.updateSelectedItem(),this.startAutoSlide())}else if(t.startsWith("carousel__arrow"))t.endsWith("right")?this.goToNext():this.goToPrev(),this.startAutoSlide();else if(t.indexOf("-")>-1){const e=+t.split("-")[1],i=e-1;window.parent.clevertap&&window.clevertap.renderNotificationClicked({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot,wzrk_slideNo:e});const o=this.details[i].onClick;""!==o&&(this.details[i].window?window.open(o,"_blank"):window.location.href=o)}}))}setupOnHover(){this._carousel.addEventListener("mouseenter",(e=>{this.stopAutoSlideTimeout=setTimeout((()=>{this.autoSlide=clearInterval(this.autoSlide)}),500)})),this._carousel.addEventListener("mouseleave",(e=>{clearTimeout(this.stopAutoSlideTimeout),void 0===this.autoSlide&&this.startAutoSlide()}))}getCarouselContent(){const e=document.createElement("div");return e.setAttribute("class","carousel"),this.details.forEach(((t,i)=>{const o=document.createElement("ct-web-personalisation-banner");o.classList.add("carousel__item"),o.trackClick=!1,o.setAttribute("id","carousel__item-".concat(i+1)),o.details=t,e.appendChild(o)})),e}getStyles(){var e,t;return"\n \n ")}updateSelectedItem(){if(-1!==this.previouslySelectedItem){const e=this.shadow.getElementById("carousel__item-".concat(this.previouslySelectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.previouslySelectedItem));e.classList.remove("carousel__item--selected"),t&&t.classList.remove("carousel__button--selected")}const e=this.shadow.getElementById("carousel__item-".concat(this.selectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.selectedItem));e.classList.add("carousel__item--selected"),t&&t.classList.add("carousel__button--selected")}startAutoSlide(){clearInterval(this.autoSlide),this.autoSlide=setInterval((()=>{this.goToNext()}),this.display.sliderTime?1e3*this.display.sliderTime:3e3)}goToNext(){this.goTo(this.selectedItem,(this.selectedItem+1)%this.slides)}goToPrev(){this.goTo(this.selectedItem,this.selectedItem-1)}goTo(e,t){this.previouslySelectedItem=e,this.selectedItem=t,0===t&&(this.selectedItem=this.slides),this.updateSelectedItem()}}class Bt extends HTMLElement{constructor(){super(),this._target=null,this._session=null,this.shadow=null,this.popup=null,this.container=null,this.resizeObserver=null,this.shadow=this.attachShadow({mode:"open"})}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderImageOnlyPopup())}get session(){return this._session||""}set session(e){this._session=e}get msgId(){return this.target.wzrk_id}get pivotId(){return this.target.wzrk_pivot}get onClickUrl(){return this.target.display.onClickUrl}renderImageOnlyPopup(){const e=this.target.wzrk_id.split("_")[0],t=this.session.sessionId;this.shadow.innerHTML=this.getImageOnlyPopupContent(),this.popup=this.shadowRoot.getElementById("imageOnlyPopup"),this.container=this.shadowRoot.getElementById("container"),this.closeIcon=this.shadowRoot.getElementById("close"),this.popup.addEventListener("load",this.updateImageAndContainerWidth()),this.resizeObserver=new ResizeObserver((()=>this.handleResize(this.popup,this.container))),this.resizeObserver.observe(this.popup),this.closeIcon.addEventListener("click",(()=>{if(this.resizeObserver.unobserve(this.popup),document.getElementById("wzrkImageOnlyDiv").style.display="none",this.remove(),null!=e&&"-1"!==e&&he._isLocalStorageSupported()){const i=ot();let o=i.wp[t];null==o&&(o={},i[t]=o),o[e]="dnd",nt(i)}})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId}),this.onClickUrl&&this.popup.addEventListener("click",(()=>{this.target.display.window?window.open(this.onClickUrl,"_blank"):window.parent.location.href=this.onClickUrl,window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})}))}handleResize(e,t){const i=this.getRenderedImageWidth(e);t.style.setProperty("width","".concat(i,"px"))}getImageOnlyPopupContent(){return"\n ".concat(this.target.msgContent.css,"\n ").concat(this.target.msgContent.html,"\n ")}updateImageAndContainerWidth(){return()=>{const e=this.getRenderedImageWidth(this.popup);this.popup.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("height","auto"),this.container.style.setProperty("position","fixed"),this.popup.style.setProperty("visibility","visible"),this.closeIcon.style.setProperty("visibility","visible"),document.getElementById("wzrkImageOnlyDiv").style.visibility="visible"}}getRenderedImageWidth(e){const t=e.naturalWidth/e.naturalHeight;return e.height*t}}class Nt extends HTMLElement{constructor(e,t){super(),this.wrapper=null,this.snackBar=null,this.shadow=this.attachShadow({mode:"open"}),this.config=e,this.message=t,this.renderMessage(t)}get pivotId(){return this.message.wzrk_pivot}get campaignId(){return this.message.wzrk_id}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}renderMessage(e){switch(this.wrapper=this.createEl("div","messageWrapper"),e.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":{const t=this.prepareBasicMessage(e.msg[0]);this.wrapper.appendChild(t)}}const t=this.createEl("div","timeStamp");if(t.innerHTML="".concat(Jt(e.id.split("_")[1]),""),!e.viewed){const e=this.createEl("span","unreadMarker");t.appendChild(e)}this.wrapper.appendChild(t),this.shadow.appendChild(this.wrapper)}prepareBasicMessage(e){const t=this.createEl("div","message");if(e.imageUrl){const i=this.addImage(e.imageUrl,"mainImg");t.appendChild(i)}const i=this.createEl("div","iconTitleDescWrapper");if(e.iconUrl){const t=this.addImage(e.iconUrl,"iconImg");i.appendChild(t)}const o=this.createEl("div","titleDescWrapper");if(e.title){const t=this.createEl("div","title");t.innerText=e.title,o.appendChild(t)}if(e.description){const t=this.createEl("div","description");t.innerText=e.description,o.appendChild(t)}if((e.title||e.description)&&i.appendChild(o),(e.iconUrl||e.title||e.description)&&t.appendChild(i),e.buttons&&e.buttons.length){const i=this.addButtons(e.buttons);t.appendChild(i)}return t}addButtons(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.createEl("div","buttonsContainer");let i=!1;return e.forEach(((e,o)=>{const n=this.createEl("button","button-".concat(o),"button");n.innerText=e.text,o>0&&(n.style.cssText+="margin-left: 2px;"),"copy"===e.action&&(i=!0),t.appendChild(n)})),i&&this.addSnackbar(t),t}addSnackbar(e){this.snackBar=this.createEl("div","snackbar-".concat(this.campaignId),"snackbar"),this.snackBar.innerHTML=Yt;const t=this.createEl("span","snackbar-msg-".concat(this.campaignId),"snackbar-msg");t.innerText="Copied to clipboard",this.snackBar.appendChild(t),e.appendChild(this.snackBar)}addImage(e,t){const i=this.createEl("div","".concat(t,"Container")),o=this.createEl("img",t);return o.setAttribute("src",e),o.setAttribute("loading","lazy"),i.appendChild(o),i}raiseClickedEvent(e,t){switch(this.message.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":this.raiseClickedForBasicTemplates(e,t)}}raiseClickedForBasicTemplates(e,t){const i=this.message.msg[0],o={msgId:this.campaignId,pivotId:this.pivotId};if("BUTTON"===e.tagName){const t=e.id.split("-")[1],n=i.buttons[t];o.kv={wzrk_c2a:n.text},"url"===n.action?n.openUrlInNewTab?window.open(n.url,"_blank"):window.location=n.url:"copy"===n.action&&(window.focus(),navigator.clipboard.writeText(n.clipboardText),this.snackBar.style.setProperty("display","flex","important"),setTimeout((()=>{this.snackBar.style.setProperty("display","none","important")}),2e3))}else"CT-INBOX-MESSAGE"===e.tagName&&i.onClickUrl&&(i.openUrlInNewTab?window.open(i.onClickUrl,"_blank"):window.location=i.onClickUrl);t?console.log("Notifiction clicked event will be raised at run time with payload ::",o):window.clevertap.renderNotificationClicked(o)}}class zt extends HTMLElement{constructor(e){super(),this.isInboxOpen=!1,this.isInboxFromFlutter=!1,this.selectedCategory=null,this.unviewedMessages={},this.unviewedCounter=0,this.isPreview=!1,this.inboxConfigForPreview={},this.inboxSelector=null,this.inbox=null,this.emptyInboxMsg=null,this.inboxCard=null,this.unviewedBadge=null,this.observer=null,this.selectedCategoryRef=null,this.addClickListenerOnDocument=(()=>e=>{if(e.composedPath().includes(this.inbox)){const t=e.path||e.composedPath&&e.composedPath();if(t.length){const e=t[0].id;if("closeInbox"===e)this.toggleInbox();else if(e.startsWith("category-"))this.prevCategoryRef=this.selectedCategoryRef,this.selectedCategoryRef=t[0],this.updateActiveCategory(t[0].innerText);else{const e=t.filter((e=>{var t;return(null===(t=e.id)||void 0===t?void 0:t.startsWith("button-"))||"CT-INBOX-MESSAGE"===e.tagName}));if(e.length){e[e.length-1].raiseClickedEvent(e[0],this.isPreview)}}}}else(this.inboxSelector.contains(e.target)||this.isInboxOpen)&&(this.isInboxFromFlutter?this.isInboxFromFlutter=!1:this.toggleInbox(e))})(),this.setBadgeStyle=e=>{null!==this.unviewedBadge&&(this.unviewedBadge.innerText=e>9?"9+":e,this.unviewedBadge.style.display=e>0?"flex":"none")},this.logger=e,this.shadow=this.attachShadow({mode:"open"})}get incomingMessages(){return[]}set incomingMessages(e){void 0===e&&(e=[]),e.length>0&&this.inbox&&this.updateInboxMessages(e)}get incomingMessagesForPreview(){return[]}set incomingMessagesForPreview(e){void 0===e&&(e=[]);const t={};e.length>0&&this.inbox&&(this.isPreview=!0,this.unviewedCounter=0,e.forEach((e=>{const i="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=i,t[i]=e,this.unviewedMessages[i]=e,this.unviewedCounter++})),this.buildUIForMessages(t),this.updateUnviewedBadgeCounter())}connectedCallback(){this.init()}init(){this.config=this.isPreview?this.inboxConfigForPreview:he.readFromLSorCookie(q)||{},0!==Object.keys(this.config).length&&(this.inboxSelector=document.getElementById(this.config.inboxSelector),null!==this.inboxSelector&&(this.config.styles.notificationsBadge?this.addUnviewedBadge():this.unviewedBadge&&this.unviewedBadge.remove(),this.createinbox(),document.removeEventListener("click",this.addClickListenerOnDocument),document.addEventListener("click",this.addClickListenerOnDocument),this.config.categories.length&&this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadow.innerHTML=this.getInboxStyles(),this.shadow.appendChild(this.inbox)))}addMsgsToInboxFromLS(){const e=this.deleteExpiredAndGetUnexpiredMsgs(!1),t=e?Object.keys(e):[];0!==t.length&&(t.forEach((t=>{e[t].viewed||(this.unviewedMessages[t]=e[t],this.unviewedCounter++)})),this.buildUIForMessages(e),this.updateUnviewedBadgeCounter())}deleteExpiredAndGetUnexpiredMsgs(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Vt();const i=Math.floor(Date.now()/1e3);for(const o in t)if(t[o].wzrk_ttl&&t[o].wzrk_ttl>0&&t[o].wzrk_ttl0&&(t=Object.values(t).sort(((e,t)=>t.date-e.date)).reduce(((e,t)=>(e[t.id]=t,e)),{})),Wt(t),t}updateInboxMessages(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.deleteExpiredAndGetUnexpiredMsgs(),i=Date.now(),o={};e.forEach(((e,n)=>{const s="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=s,e.date=i-n,e.viewed=0,t[s]=e,o[s]=e,this.unviewedMessages[s]=e,this.unviewedCounter++})),Wt(t),this.buildUIForMessages(o),this.updateUnviewedBadgeCounter()}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}addUnviewedBadge(){this.unviewedBadge||(this.unviewedBadge=this.createEl("div","unviewedBadge"),this.unviewedBadge.style.cssText="display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ".concat(this.config.styles.notificationsBadge.backgroundColor,"; font-size: 12px; color: ").concat(this.config.styles.notificationsBadge.textColor,"; font-weight: bold; align-items: center; justify-content: center;"),document.body.appendChild(this.unviewedBadge)),this.updateUnviewedBadgePosition(),window.addEventListener("resize",(()=>{this.updateUnviewedBadgePosition()}))}updateUnviewedBadgePosition(){const{top:e,right:t}=this.inboxSelector.getBoundingClientRect();this.unviewedBadge.style.top="".concat(e-8,"px"),this.unviewedBadge.style.left="".concat(t-8,"px")}createinbox(){this.inbox=this.createEl("div","inbox");const e=this.createEl("div","header"),t=this.createEl("div","headerTitle");t.innerText=this.config.title;const i=this.createEl("div","closeInbox");if(i.innerHTML="×",e.appendChild(t),e.appendChild(i),this.inbox.appendChild(e),this.config.categories.length){const e=this.createCategories();this.inbox.appendChild(e)}this.inboxCard=this.createEl("div","inboxCard"),this.inbox.appendChild(this.inboxCard),this.emptyInboxMsg=this.createEl("div","emptyInboxMsg"),this.emptyInboxMsg.innerText="All messages will be displayed here.",this.inboxCard.appendChild(this.emptyInboxMsg);const o={root:this.inboxCard,rootMargin:"0px",threshold:.5};this.observer=new IntersectionObserver(((e,t)=>{this.handleMessageViewed(e)}),o),this.addMsgsToInboxFromLS()}createCategories(){const e=this.createEl("div","categoriesContainer"),t=this.createEl("div","leftArrow");t.innerHTML=$t,t.children[0].style="transform: rotate(180deg)",t.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(-70,0)})),e.appendChild(t);const i=this.createEl("div","categoriesWrapper");["All",...this.config.categories].forEach(((e,t)=>{const o=this.createEl("div","category-".concat(t),"category");o.innerText=e,0===t&&(this.selectedCategoryRef=o),i.appendChild(o)})),e.appendChild(i);const o=this.createEl("div","rightArrow");o.innerHTML=$t,o.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(70,0)})),e.appendChild(o);const n={root:e,threshold:.9},s=i.children[0],r=i.children[this.config.categories.length];new IntersectionObserver((e=>{this.categoryObserverCb(t,e[0].intersectionRatio>=.9)}),n).observe(s);return new IntersectionObserver((e=>{this.categoryObserverCb(o,e[0].intersectionRatio>=.9)}),n).observe(r),e}categoryObserverCb(e,t){e&&(e.style.display=t?"none":"flex")}updateActiveCategory(e){this.selectedCategory=e,this.inboxCard.scrollTop=0;let t=0;this.prevCategoryRef&&this.prevCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef.setAttribute("selected","true"),this.inboxCard.childNodes.forEach((e=>{"emptyInboxMsg"!==e.getAttribute("id")&&(e.style.display="All"===this.selectedCategory||e.getAttribute("category")===this.selectedCategory?"block":"none","block"===e.style.display&&t++)})),0===t?(this.emptyInboxMsg.innerText="".concat(e," messages will be displayed here."),this.emptyInboxMsg.style.display="block"):this.emptyInboxMsg.style.display="none"}buildUIForMessages(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!this.isPreview&&this.updateTSForRenderedMsgs(),this.inboxCard.scrollTop=0;const i=null!==(e=this.config.maxMsgsInInbox)&&void 0!==e?e:15,o=this.inboxCard.firstChild,n=Object.values(t).sort(((e,t)=>t.date-e.date)).map((e=>e.id));for(const e of n){const i=new Nt(this.config,t[e]);i.setAttribute("id",t[e].id),i.setAttribute("pivot",t[e].wzrk_pivot),i.setAttribute("part","ct-inbox-message"),this.config.categories.length>0?(i.setAttribute("category",t[e].tags[0]||""),i.style.display="All"===this.selectedCategory||t[e].category===this.selectedCategory?"block":"none"):i.style.display="block",this.inboxCard.insertBefore(i,o),this.observer.observe(i)}let s=this.inboxCard.querySelectorAll("ct-inbox-message").length;for(;s>i;){const e=this.inboxCard.querySelectorAll("ct-inbox-message");e.length>0&&e[e.length-1].remove(),s--}const r=this.inboxCard.querySelectorAll('ct-inbox-message[style*="display: block"]').length;this.emptyInboxMsg.style.display=r?"none":"block"}handleMessageViewed(e){const t=!this.isPreview;this.isInboxOpen&&e.forEach((e=>{e.isIntersecting&&this.unviewedMessages.hasOwnProperty(e.target.id)&&0===e.target.message.viewed&&(e.target.message.viewed=1,t?(window.clevertap.renderNotificationViewed({msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.updateMessageInLS(e.target.id,{...e.target.message,viewed:1}),setTimeout((()=>{e.target.shadowRoot.getElementById("unreadMarker").style.display="none"}),1e3)):console.log("Notifiction viewed event will be raised at run time with payload ::",{msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.unviewedCounter--,this.updateUnviewedBadgeCounter(),delete this.unviewedMessages[e.target.id])}))}updateMessageInLS(e,t){if(!this.isPreview){const i=Vt();i[e]=t,Wt(i)}}toggleInbox(e){this.isInboxOpen=!this.isInboxOpen,this.isInboxFromFlutter=!!(null==e?void 0:e.rect),this.isInboxOpen?(this.inboxCard.scrollTop=0,!this.isPreview&&this.deleteExpiredAndGetUnexpiredMsgs(),this.inbox.style.display="block",this.inbox.style.zIndex="2147483647",this.config.categories.length&&(this.selectedCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef=this.shadowRoot.getElementById("category-0"),this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadowRoot.getElementById("categoriesWrapper").scrollLeft-=this.shadowRoot.getElementById("categoriesWrapper").scrollWidth),this.setInboxPosition(e)):this.inbox.style.display="none"}setInboxPosition(e){const t=window.outerWidth,i=getComputedStyle(ue.inbox),o=i.getPropertyValue("--inbox-top"),n=i.getPropertyValue("--inbox-bottom"),s=i.getPropertyValue("--inbox-left"),r=i.getPropertyValue("--inbox-right");if(t>481&&!(o||n||s||r)){const t=Gt(e,this.inbox.clientHeight,this.inbox.clientWidth),i=t.xPos,o=t.yPos;this.inbox.style.top=o+"px",this.inbox.style.left=i+"px"}}updateUnviewedBadgeCounter(){if(this.isPreview)return void this.setBadgeStyle(this.unviewedCounter);let e=0;this.inboxCard.querySelectorAll("ct-inbox-message").forEach((t=>{const i=Vt();i[t.id]&&0===i[t.id].viewed&&e++})),this.setBadgeStyle(e)}updateTSForRenderedMsgs(){this.inboxCard.querySelectorAll("ct-inbox-message").forEach((e=>{const t=e.id.split("_")[1];e.shadow.getElementById("timeStamp").firstChild.innerText=Jt(t)}))}getInboxStyles(){const e=this.config.categories.length?64:16,t={panelBackgroundColor:this.config.styles.panelBackgroundColor,panelBorderColor:this.config.styles.panelBorderColor,headerBackgroundColor:this.config.styles.header.backgroundColor,headerTitleColor:this.config.styles.header.titleColor,closeIconColor:this.config.styles.closeIconColor,categoriesTabColor:this.config.styles.categories.tabColor,categoriesTitleColor:this.config.styles.categories.titleColor,selectedCategoryTabColor:this.config.styles.categories.selectedTab.tabColor,selectedCategoryTitleColor:this.config.styles.categories.selectedTab.titleColor,headerCategoryHeight:36+e};this.config.styles.categories.borderColor&&(t.categoriesBorderColor=this.config.styles.categories.borderColor),this.config.styles.categories.selectedTab.borderColor&&(t.selectedCategoryBorderColor=this.config.styles.categories.selectedTab.borderColor);const i=(e=>{let{panelBackgroundColor:t,panelBorderColor:i,headerBackgroundColor:o,headerTitleColor:n,closeIconColor:s,categoriesTabColor:r,categoriesTitleColor:a,categoriesBorderColor:l,selectedCategoryTabColor:d,selectedCategoryTitleColor:c,selectedCategoryBorderColor:h,headerCategoryHeight:u}=e;return'\n \n ")})(t),o=this.config.styles.cards;return i+(e=>{let{backgroundColor:t,borderColor:i,titleColor:o,descriptionColor:n,buttonColor:s,buttonTextColor:r,unreadMarkerColor:a}=e;return'\n \n ")})({backgroundColor:o.backgroundColor,borderColor:o.borderColor,titleColor:o.titleColor,descriptionColor:o.descriptionColor,buttonColor:o.buttonColor,buttonTextColor:o.buttonTextColor,unreadMarkerColor:o.unreadMarkerColor})}}const Ut=e=>{e.inbox_preview?ue.inbox.incomingMessagesForPreview=e.inbox_notifs:ue.inbox.incomingMessages=e},Ft=e=>{Ht(),ue.inbox=new zt({logger:e}),document.body.appendChild(ue.inbox)},qt=e=>{const t=he.readFromLSorCookie(V)||{};if(Object.keys(t).length>0&&Object.keys(t)[0].includes("_")){const i={};return i[e]=t,he.saveToLSorCookie(V,i),i}return t},Vt=()=>{const e=JSON.parse(decodeURIComponent(he.read(b)));if(!oe(e))return{};const t=qt(e);return t.hasOwnProperty(e)?t[e]:{}},Wt=e=>{const t=JSON.parse(decodeURIComponent(he.read(b)));if(!oe(t))return;const i={...qt(t),[t]:e};he.saveToLSorCookie(V,i)},Kt=e=>new Promise(((t,i)=>{if("complete"===document.readyState)Ft(e),t();else{const i=he.readFromLSorCookie(q)||{},o=()=>{null===ue.inbox&&Ft(e),t()};window.addEventListener("load",(()=>{if(document.getElementById(i.inboxSelector))o();else{let n=0;if(n<20){const s=setInterval((()=>{document.getElementById(i.inboxSelector)?(o(),clearInterval(s),t()):n>=20&&(clearInterval(s),e.debug("Failed to add inbox")),n++}),500)}}}))}})),Ht=()=>{void 0===customElements.get("ct-web-inbox")&&(customElements.define("ct-web-inbox",zt),customElements.define("ct-inbox-message",Nt))},Gt=(e,t,i)=>{const o=document.scrollingElement.scrollLeft,n=document.scrollingElement.scrollTop,s=window.innerWidth+o,r=window.innerHeight+n,a=e.rect||e.target.getBoundingClientRect(),l=a.x+o,d=a.y+n,c=a.left+o,h=a.right+o,u=a.top+n,p=a.bottom,g=a.height,v=a.width;let f,b,m=!1;const y=16;if(p+t<=r){const e=r-(p+t);b=e>=y?p+y:p+e}else if(u-t>=n){const e=u-t;b=e>=y?u-t-y:u-t-e}else m=!0,b=d+g/2-t/2,br&&(b=r-t);if(m){const e=h+i;if(e<=s){f=h+(e+y<=s?y:s-e)}else{const e=c-i;f=e-(e-y>=o?y:e-o)}}else f=l+v/2-i/2,fs&&(f=h-i>=o?h-i:s-i);return{xPos:f,yPos:b}},Jt=e=>{const t=Date.now();let i=Math.floor((t-e)/6e4);return i<5?"Just now":i<60?"".concat(i," minute").concat(i>1?"s":""," ago"):(i=Math.floor(i/60),i<24?"".concat(i," hour").concat(i>1?"s":""," ago"):(i=Math.floor(i/24),"".concat(i," day").concat(i>1?"s":""," ago")))},Zt=()=>Object.keys(he.readFromLSorCookie(q)||{}).length>0,$t='\n\n\n',Yt='\n\n\n',Qt="https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js",Xt="https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css",ei=(e,t,i)=>{document.addEventListener("DOMContentLoaded",(()=>function(e,t,i){document.body.innerHTML="",ti=document.createElement("div"),ti.id="overlayDiv",ti.style.position="relative",ti.style.display="flex",document.body.appendChild(ti);(function(e,t,i,o){return new Promise(((n,s)=>{var r=document.createElement("script");r.type="module",r.src=e,r.onload=function(){"function"==typeof window.Overlay?(window.Overlay("#overlayDiv",t,i,o),n()):s(new Error("ContentLayout not found in overlay.js"))},r.onerror=function(e){s(e)},document.head.appendChild(r)}))})(Qt,e,t,i).then((()=>{console.log("Overlay script loaded successfully.")})).catch((e=>{console.error("Error loading overlay script:",e)})),o=document.createElement("link"),o.rel="stylesheet",o.type="text/css",o.href=Xt,document.head.appendChild(o),function(){const e={kitId:"eqj6nom",scriptTimeout:3e3,async:!0},t=document.documentElement,i=setTimeout((function(){t.className=t.className.replace(/\bwf-loading\b/g,"")+" wf-inactive"}),e.scriptTimeout),o=document.createElement("script");let n=!1;const s=document.getElementsByTagName("script")[0];let r;t.className+=" wf-loading",o.src="https://use.typekit.net/"+e.kitId+".js",o.async=!0,o.onload=o.onreadystatechange=function(){if(r=this.readyState,!(n||r&&"complete"!==r&&"loaded"!==r)){n=!0,clearTimeout(i);try{Typekit.load(e)}catch(e){}}},s.parentNode.insertBefore(o,s)}();var o}(e,t,i)))};let ti;const ii=(e,t)=>{const i=t?e.details[0]:e.display.details[0],o=Object.keys(i)[0],n=i[o];if(o===window.location.href.split("?")[0])for(const i in n){const o=document.querySelector(i);if(o)n[i].html?o.outerHTML=n[i].html:oi(e,n[i]),t||window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot});else{let o=0;const s=setInterval((()=>{const r=document.querySelector(i);r?(n[i].html?r.outerHTML=n[i].html:oi(e,n[i]),t||window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot}),clearInterval(s)):(o++,o>=20&&(console.log("No element present on DOM with selector '".concat(i,"'.")),clearInterval(s)))}),500)}}};function oi(e,t){const i={};i.msgId=e.wzrk_id,e.wzrk_pivot&&(i.pivotId=e.wzrk_pivot),null!=t.json&&(i.json=t.json);const o=new CustomEvent("CT_web_native_display_buider",{detail:i});document.dispatchEvent(o)}const ni=e=>{const t=e.indexOf("\n `\n return html.replace(/(<\\s*\\/\\s*body)/, `${script}\\n$1`)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n const displayObj = targetingMsgJson.display\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = WIZ_IFRAME_INTENT\n let html = targetingMsgJson.msgContent.html\n if (displayObj['custom-editor'] && !displayObj['bee-editor'] && displayObj['custom-html-sandbox']) { // sandbox the iframe only for custom html\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox allow-forms' // allow popup to open url in new page\n html = ctEventhandler(html)\n }\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (targetingMsgJson.display['custom-editor'] && !targetingMsgJson.display['bee-editor'] && targetingMsgJson.display['custom-html-sandbox']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n let contentDiv\n iframe.onload = () => {\n if (targetingMsgJson.display['custom-editor'] && !targetingMsgJson.display['bee-editor'] && targetingMsgJson.display['custom-html-sandbox']) {\n window.addEventListener('message', event => {\n switch (event?.data?.action) {\n case GET_NOTIFICATION_DATA:\n window.clevertap.renderNotificationClicked(event.data.value)\n break\n case EVENT:\n window.clevertap.event.push(event.data.value)\n break\n case PROFILE:\n window.clevertap.profile.push(event.data.value)\n break\n case OUL:\n window.clevertap.onUserLogin.push(event.data.value)\n break\n case CLOSE_INTERSTITIAL_POPUP:\n setTimeout(() => {\n const interstitialWrapper = window.document.getElementById('intentPreview')\n const interstitialOverlay = window.document.getElementById('intentOpacityDiv')\n interstitialOverlay && interstitialOverlay.remove()\n interstitialWrapper && interstitialWrapper.remove()\n }, 0)\n break\n default:\n // Handle unknown action\n break\n }\n })\n contentDiv = ''\n } else {\n contentDiv = document.getElementById(WIZ_IFRAME_INTENT).contentDocument.getElementById('contentDiv')\n }\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n this.#logger.error('Error subscribing: ' + error)\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { initialiseCTBuilder, renderVisualBuilder } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token) {\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n #handleMessageEvent (event) {\n if (event.data && event.data.message) {\n if (event.data.message === 'Dashboard' && event.data.url) {\n initialiseCTBuilder(event.data.url, event.data.variant ?? null, event.data.details ?? {})\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n }\n }\n\n pageChanged () {\n const search = window.location.search\n const parentWindow = window.opener\n\n if (search === '?ctBuilder') {\n // open in visual builder mode\n this.#logger.debug('open in visual builder mode')\n window.addEventListener('message', this.#handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('builder', '*')\n }\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', this.#handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('preview', '*')\n }\n return\n }\n\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","constructor","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","dataPostPEURL","dataPostURL","recorderURL","emailURL","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","WIZ_IFRAME","WIZ_IFRAME_INTENT","ADJUST_IFRAME_HEIGHT","UPDATE_HEIGHT","GET_NOTIFICATION","EVENT","PROFILE","OUL","CLOSE_BOX_POPUP","CLOSE_BANNER_POPUP","GET_NOTIFICATION_DATA","CLOSE_INTERSTITIAL_POPUP","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","save","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","read","data","getItem","parse","e","remove","removeItem","removeCookie","name","domain","cookieStr","document","cookie","createCookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","readCookie","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","saveToLSorCookie","property","location","hostname","$ct","globalCache","readFromLSorCookie","trim","err","createBroadCookie","broadDomain","domainParts","testBroadDomain","testCookieName","tempCookie","getMetaProp","metaObj","setMetaProp","wzrkMetaObj","getAndClearMetaProp","setInstantDeleteFlagInK","k","flag","backupEvent","reqNo","backupArr","q","debug","removeBackup","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","get","item","saveCacheToLS","set","allKeys","objToArray","index","temp","getKey","getSecondLastKey","keysArr","getLastKey","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","s","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","sessionObj","getSessionCookieObject","kIdFromLS","guidFromLRUCache","lastK","lastGUID","unregisterTokenForGuid","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","_processOldValues","getDetails","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","fireRequest","skipARP","sendOULFlag","getDelayFrequency","account","randomDelay","random","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","ProfileHandler","profilesArr","getAttribute","propName","_handleIncrementDecrementValue","command","tz","profile","addSystemDataToObject","addFlags","compressedData","saveAndFireRequest","_handleMultiValueSet","arrayVal","array","toLowerCase","sendMultiValueData","_handleMultiValueAdd","propKey","propVal","_handleMultiValueRemove","_handleMultiValueDelete","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","clear","addToK","ids","g","kId","anonymousUser","foundInCache","gFromCache","Identity","cookieName","loginArr","pop","processProfile","CTWebPersonalisationBanner","HTMLElement","_details","shadow","attachShadow","mode","details","renderBanner","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","target","renderCarousel","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","button","setInterval","sliderTime","goTo","prev","cur","CTWebPopupImageOnly","_session","popup","container","resizeObserver","renderImageOnlyPopup","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","Message","config","message","wrapper","snackBar","renderMessage","createEl","part","_el","msg","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","raiseClickedEvent","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","contains","setBadgeStyle","msgCount","incomingMessages","msgs","updateInboxMessages","incomingMessagesForPreview","previewMsgs","now","buildUIForMessages","updateUnviewedBadgeCounter","connectedCallback","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","addMsgsToInboxFromLS","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","deleteMsgsFromUI","getInboxMessages","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","top","right","getBoundingClientRect","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","inbox_notifs","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","OVERLAY_PATH","CSS_PATH","initialiseCTBuilder","variant","onContentLoad","position","overlayPath","loadOverlayScript","then","catch","loadCSS","loadTypeKit","link","rel","head","script","src","onload","Overlay","Error","onerror","kitId","scriptTimeout","docElement","documentElement","timeoutId","className","typeKitScript","scriptLoaded","firstScript","scriptReadyState","onreadystatechange","Typekit","load","renderVisualBuilder","targetingMsgJson","siteUrl","selectors","selector","element","querySelector","outerHTML","dispatchJsonData","intervalId","retryElement","inaObj","json","kvPairsEvent","CustomEvent","dispatchEvent","ctEventhandler","ctScript","insertPosition","join","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","onclick","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","sandbox","pointerCss","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","closeCampaign","Event","appendScriptForCustomEvent","srcdoc","handleMessage","heightAdjust","boxWrapper","bannerWrapper","margin","onUserLogin","handleIframeLoad","contentWindow","postMessage","contentDocument","scrollHeight","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","interstitialWrapper","interstitialOverlay","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","getTotalVisits","visitCount","getLastVisit","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","info","debugPE","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","getTimeElapsed","sessionStart","getPageCount","seqNo","requestTime","RequestManager","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","post","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","_enableWebPush","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","skipDialog","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","getValue","getdefaultValue","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","addValueChangedCallback","removeValueChangedCallback","clearStartFlag","VariableStore","syncVariables","onSyncSuccess","onSyncFailure","meta","tk","r","status","fetchVariables","onFetchCallback","addVariablesChangedCallback","callback","addOneTimeVariablesChangedCallback","removeVariablesChangedCallback","removeOneTimeVariablesChangedCallback","callBack","CleverTap","spa","isSpa","bind","enablePersonalization","_isPersonalisationActive","ReqestManager","privacy","notifications","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","handleDecrementValue","setMultiValuesForKey","addMultiValueForKey","addMultiValuesForKey","removeMultiValueForKey","removeMultiValuesForKey","removeValueForKey","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","sendLocationData","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","elements","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","parentWindow","opener","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","setOffline","arg","defineVariable","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;EAAO,MAAMA,aAAa,GAAG,oBAAtB;EACA,MAAMC,eAAe,GAAG,QAAxB;EACA,MAAMC,cAAc,GAAG,KAAvB;;;;;;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AIqP,WAAW,GAAG,0DAAchY,WAAhC;;EACA,MAAI2I,IAAI,GAAG,EAAX;EACAA,EAAAA,IAAI,GAAG,0DAAcqX,qBAAd,CAAoCrX,IAApC,EAA0C7C,SAA1C,CAAP;EACAkS,EAAAA,WAAW,GAAGzD,QAAQ,CAACyD,WAAD,EAAc,MAAd,EAAsBhW,QAAtB,CAAtB;EACAgW,EAAAA,WAAW,GAAGzD,QAAQ,CAACyD,WAAD,EAAc,GAAd,EAAmB3C,YAAY,CAAC7M,IAAI,CAACC,SAAL,CAAeE,IAAf,CAAD,8BAAuB,IAAvB,wBAA/B,CAAtB;;EAEA,4DAAcwX,kBAAd,CAAiCnI,WAAjC,EAA8CpN,GAAG,CAACgC,YAAlD;EACD;;yDAEoB;EACnB,SAAQ,OAAOrC,MAAM,CAACorC,MAAd,KAAyB,WAAzB,IAAwCprC,MAAM,CAACorC,MAAP,CAAcC,IAAd,KAAuB,YAAvE;EACD;;yDAMmBjtC,MAAM;EACxB,MAAI,KAAKomC,wBAAL,EAAJ,EAAqC;EACnCpmC,IAAAA,IAAI,CAAC8+B,KAAL,GAAa,IAAb;EACD;EACF;;QC3xBGpvB,SAAS,GAAG,IAAIw9B,SAAJ,CAActrC,MAAM,CAAC8N,SAArB;EAElB9N,MAAM,CAAC8N,SAAP,GAAmB9N,MAAM,CAAC+N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/modules/visualBuilder/builder_constants.js","src/modules/visualBuilder/pageBuilder.js","src/util/clevertap-handler.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/notification.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\nexport const WIZ_IFRAME = 'wiz-iframe'\nexport const WIZ_IFRAME_INTENT = 'wiz-iframe-intent'\nexport const ADJUST_IFRAME_HEIGHT = 'adjustIFrameHeight'\nexport const UPDATE_HEIGHT = 'update height'\nexport const GET_NOTIFICATION = 'getnotif'\nexport const EVENT = 'Event'\nexport const PROFILE = 'Profile'\nexport const OUL = 'OUL'\nexport const CLOSE_BOX_POPUP = 'closeBoxPopUp'\nexport const CLOSE_BANNER_POPUP = 'closeBannerPopUp'\nexport const GET_NOTIFICATION_DATA = 'getnotifData'\nexport const CLOSE_INTERSTITIAL_POPUP = 'closeInterstitialPopUp'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {}\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n // Initialize array\n var array = []\n\n // Check if globalProfileMap is null, initialize if needed\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n // Check if the value to be set is either string or number\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = $ct.globalProfileMap[propKey]\n array.push(typeof propVal === 'number' ? propVal : propVal.toLowerCase())\n } else {\n $ct.globalProfileMap[propKey] = propVal\n }\n } else {\n // Check if propVal is an array\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = Array.isArray($ct.globalProfileMap[propKey]) ? $ct.globalProfileMap[propKey] : [$ct.globalProfileMap[propKey]]\n }\n\n // Check for case-sensitive inputs and filter the same ones\n for (var i = 0; i < propVal.length; i++) {\n if (typeof propVal[i] === 'number' && !array.includes(propVal[i])) {\n array.push(propVal[i])\n } else if (typeof propVal[i] === 'string' && !array.includes(propVal[i].toLowerCase())) {\n array.push(propVal[i].toLowerCase())\n } else if ((typeof propVal[i] === 'number' && array.includes(propVal[i])) || (typeof propVal[i] === 'string' && array.includes(propVal[i].toLowerCase()))) {\n console.error('Values already included')\n } else {\n console.error('Array supports only string or number type values')\n }\n }\n\n // Update globalProfileMap with the array\n $ct.globalProfileMap[propKey] = array\n }\n\n // Save to local storage or cookie\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Call the sendMultiValueData function\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n var index = $ct.globalProfileMap[propKey].indexOf(propVal)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n } else {\n for (var k = 0; k < propVal.length; k++) {\n var idx = $ct.globalProfileMap[propKey].indexOf(propVal[k])\n if (idx !== -1) {\n $ct.globalProfileMap[propKey].splice(idx, 1)\n }\n }\n }\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n // console.log('Raise notification clicked event for ', item)\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","export const OVERLAY_PATH = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js'\nexport const CSS_PATH = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css'\n","import { CSS_PATH, OVERLAY_PATH } from './builder_constants'\n\n/**\n * Initializes the Clevertap builder.\n * @param {string} url - The URL to initialize the builder.\n * @param {string} variant - The variant of the builder.\n * @param {Object} details - The details object.\n */\nexport const initialiseCTBuilder = (url, variant, details) => {\n document.addEventListener('DOMContentLoaded', () => onContentLoad(url, variant, details))\n}\n\nlet container\n/**\n * Handles content load for Clevertap builder.\n */\nfunction onContentLoad (url, variant, details) {\n document.body.innerHTML = ''\n container = document.createElement('div')\n container.id = 'overlayDiv'\n container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form\n container.style.display = 'flex'\n document.body.appendChild(container)\n const overlayPath = OVERLAY_PATH\n loadOverlayScript(overlayPath, url, variant, details)\n .then(() => {\n console.log('Overlay script loaded successfully.')\n })\n .catch((error) => {\n console.error('Error loading overlay script:', error)\n })\n loadCSS()\n loadTypeKit()\n}\n\n/**\n * Loads CSS file.\n */\nfunction loadCSS () {\n var link = document.createElement('link')\n link.rel = 'stylesheet'\n link.type = 'text/css'\n link.href = CSS_PATH\n document.head.appendChild(link)\n}\n\n/**\n * Loads the overlay script.\n * @param {string} overlayPath - The path to overlay script.\n * @param {string} url - The URL.\n * @param {string} variant - The variant.\n * @param {Object} details - The details object.\n * @returns {Promise} A promise.\n */\nfunction loadOverlayScript (overlayPath, url, variant, details) {\n return new Promise((resolve, reject) => {\n var script = document.createElement('script')\n script.type = 'module'\n script.src = overlayPath\n script.onload = function () {\n if (typeof window.Overlay === 'function') {\n window.Overlay({ id: '#overlayDiv', url, variant, details })\n resolve()\n } else {\n reject(new Error('ContentLayout not found in overlay.js'))\n }\n }\n script.onerror = function (error) {\n reject(error)\n }\n document.head.appendChild(script)\n })\n}\n\n/**\n * Loads TypeKit script.\n */\nfunction loadTypeKit () {\n const config = {\n kitId: 'eqj6nom',\n scriptTimeout: 3000,\n async: true\n }\n\n const docElement = document.documentElement\n const timeoutId = setTimeout(function () {\n docElement.className = docElement.className.replace(/\\bwf-loading\\b/g, '') + ' wf-inactive'\n }, config.scriptTimeout)\n const typeKitScript = document.createElement('script')\n let scriptLoaded = false\n const firstScript = document.getElementsByTagName('script')[0]\n let scriptReadyState\n\n docElement.className += ' wf-loading'\n typeKitScript.src = 'https://use.typekit.net/' + config.kitId + '.js'\n typeKitScript.async = true\n typeKitScript.onload = typeKitScript.onreadystatechange = function () {\n scriptReadyState = this.readyState\n if (scriptLoaded || (scriptReadyState && scriptReadyState !== 'complete' && scriptReadyState !== 'loaded')) return\n scriptLoaded = true\n clearTimeout(timeoutId)\n try {\n // eslint-disable-next-line no-undef\n Typekit.load(config)\n } catch (e) {}\n }\n\n firstScript.parentNode.insertBefore(typeKitScript, firstScript)\n}\n\n/**\n * Renders the visual builder.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {boolean} isPreview - Indicates if it's a preview.\n */\nexport const renderVisualBuilder = (targetingMsgJson, isPreview) => {\n const details = isPreview ? targetingMsgJson.details[0] : targetingMsgJson.display.details[0]\n const siteUrl = Object.keys(details)[0]\n const selectors = details[siteUrl]\n\n if (siteUrl === window.location.href.split('?')[0]) {\n for (const selector in selectors) {\n const element = document.querySelector(selector)\n if (element) {\n if (selectors[selector].html) {\n element.outerHTML = selectors[selector].html\n } else {\n // Update json data\n dispatchJsonData(targetingMsgJson, selectors[selector])\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n } else {\n let count = 0\n const intervalId = setInterval(() => {\n const retryElement = document.querySelector(selector)\n if (retryElement) {\n if (selectors[selector].html) {\n retryElement.outerHTML = selectors[selector].html\n } else {\n // Update json data\n dispatchJsonData(targetingMsgJson, selectors[selector])\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n clearInterval(intervalId)\n } else {\n count++\n if (count >= 20) {\n console.log(`No element present on DOM with selector '${selector}'.`)\n clearInterval(intervalId)\n }\n }\n }, 500)\n }\n }\n }\n}\n\n/**\n * Dispatches JSON data.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {Object} selector - The selector object.\n */\nfunction dispatchJsonData (targetingMsgJson, selector) {\n const inaObj = {}\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (selector.json != null) {\n inaObj.json = selector.json\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display_buider', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n}\n","// clevertap-handler.js\n\nconst ctEventhandler = (html) => {\n const ctScript = `\n var clevertap = {\n event: {\n push: (eventName) => {\n window.parent.postMessage({\n action: 'Event',\n value: eventName\n },'*');\n }\n },\n profile: {\n push: (eventName) => {\n window.parent.postMessage({\n action: 'Profile',\n value: eventName\n },'*');\n }\n },\n onUserLogin: {\n push: (eventName) => {\n window.parent.postMessage({\n action: 'OUL',\n value: eventName\n },'*');\n }\n },\n closeBoxPopUp: () => {\n window.parent.postMessage({\n action: 'closeBoxPopUp',\n value: 'closeBoxPopUp'\n },'*');\n },\n closeBannerPopUp: () => {\n window.parent.postMessage({\n action: 'closeBannerPopUp',\n value: 'closeBannerPopUp'\n },'*');\n },\n closeInterstitialPopUp: () => {\n window.parent.postMessage({\n action: 'closeInterstitialPopUp',\n value: 'closeInterstitialPopUp'\n },'*');\n }\n }\n `\n const insertPosition = html.indexOf('\n `\n return html.replace(/(<\\s*\\/\\s*body)/, `${script}\\n$1`)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n const displayObj = targetingMsgJson.display\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = WIZ_IFRAME_INTENT\n let html = targetingMsgJson.msgContent.html\n if (displayObj['custom-editor'] && !displayObj['bee-editor'] && displayObj['custom-html-sandbox']) { // sandbox the iframe only for custom html\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox allow-forms' // allow popup to open url in new page\n html = ctEventhandler(html)\n }\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (targetingMsgJson.display['custom-editor'] && !targetingMsgJson.display['bee-editor'] && targetingMsgJson.display['custom-html-sandbox']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n let contentDiv\n iframe.onload = () => {\n if (targetingMsgJson.display['custom-editor'] && !targetingMsgJson.display['bee-editor'] && targetingMsgJson.display['custom-html-sandbox']) {\n window.addEventListener('message', event => {\n switch (event?.data?.action) {\n case GET_NOTIFICATION_DATA:\n window.clevertap.renderNotificationClicked(event.data.value)\n break\n case EVENT:\n window.clevertap.event.push(event.data.value)\n break\n case PROFILE:\n window.clevertap.profile.push(event.data.value)\n break\n case OUL:\n window.clevertap.onUserLogin.push(event.data.value)\n break\n case CLOSE_INTERSTITIAL_POPUP:\n setTimeout(() => {\n const interstitialWrapper = window.document.getElementById('intentPreview')\n const interstitialOverlay = window.document.getElementById('intentOpacityDiv')\n interstitialOverlay && interstitialOverlay.remove()\n interstitialWrapper && interstitialWrapper.remove()\n }, 0)\n break\n default:\n // Handle unknown action\n break\n }\n })\n contentDiv = ''\n } else {\n contentDiv = document.getElementById(WIZ_IFRAME_INTENT).contentDocument.getElementById('contentDiv')\n }\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n this.#logger.error('Error subscribing: ' + error)\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { initialiseCTBuilder, renderVisualBuilder } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token) {\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n #handleMessageEvent (event) {\n if (event.data && event.data.message) {\n if (event.data.message === 'Dashboard' && event.data.url) {\n initialiseCTBuilder(event.data.url, event.data.variant ?? null, event.data.details ?? {})\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n }\n }\n\n pageChanged () {\n const search = window.location.search\n const parentWindow = window.opener\n\n if (search === '?ctBuilder') {\n // open in visual builder mode\n this.#logger.debug('open in visual builder mode')\n window.addEventListener('message', this.#handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('builder', '*')\n }\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', this.#handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('preview', '*')\n }\n return\n }\n\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","constructor","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","dataPostPEURL","dataPostURL","recorderURL","emailURL","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","WIZ_IFRAME","WIZ_IFRAME_INTENT","ADJUST_IFRAME_HEIGHT","UPDATE_HEIGHT","GET_NOTIFICATION","EVENT","PROFILE","OUL","CLOSE_BOX_POPUP","CLOSE_BANNER_POPUP","GET_NOTIFICATION_DATA","CLOSE_INTERSTITIAL_POPUP","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","save","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","read","data","getItem","parse","e","remove","removeItem","removeCookie","name","domain","cookieStr","document","cookie","createCookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","readCookie","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","saveToLSorCookie","property","location","hostname","$ct","globalCache","readFromLSorCookie","trim","err","createBroadCookie","broadDomain","domainParts","testBroadDomain","testCookieName","tempCookie","getMetaProp","metaObj","setMetaProp","wzrkMetaObj","getAndClearMetaProp","setInstantDeleteFlagInK","k","flag","backupEvent","reqNo","backupArr","q","debug","removeBackup","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","get","item","saveCacheToLS","set","allKeys","objToArray","index","temp","getKey","getSecondLastKey","keysArr","getLastKey","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","s","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","sessionObj","getSessionCookieObject","kIdFromLS","guidFromLRUCache","lastK","lastGUID","unregisterTokenForGuid","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","_processOldValues","getDetails","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","fireRequest","skipARP","sendOULFlag","getDelayFrequency","account","randomDelay","random","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","ProfileHandler","profilesArr","getAttribute","propName","_handleIncrementDecrementValue","command","tz","profile","addSystemDataToObject","addFlags","compressedData","saveAndFireRequest","_handleMultiValueSet","arrayVal","array","toLowerCase","sendMultiValueData","_handleMultiValueAdd","propKey","propVal","_handleMultiValueRemove","_handleMultiValueDelete","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","clear","addToK","ids","g","kId","anonymousUser","foundInCache","gFromCache","Identity","cookieName","loginArr","pop","processProfile","CTWebPersonalisationBanner","HTMLElement","_details","shadow","attachShadow","mode","details","renderBanner","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","target","renderCarousel","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","button","setInterval","sliderTime","goTo","prev","cur","CTWebPopupImageOnly","_session","popup","container","resizeObserver","renderImageOnlyPopup","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","Message","config","message","wrapper","snackBar","renderMessage","createEl","part","_el","msg","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","raiseClickedEvent","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","contains","setBadgeStyle","msgCount","incomingMessages","msgs","updateInboxMessages","incomingMessagesForPreview","previewMsgs","now","buildUIForMessages","updateUnviewedBadgeCounter","connectedCallback","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","addMsgsToInboxFromLS","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","deleteMsgsFromUI","getInboxMessages","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","top","right","getBoundingClientRect","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","inbox_notifs","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","OVERLAY_PATH","CSS_PATH","initialiseCTBuilder","variant","onContentLoad","position","overlayPath","loadOverlayScript","then","catch","loadCSS","loadTypeKit","link","rel","head","script","src","onload","Overlay","Error","onerror","kitId","scriptTimeout","docElement","documentElement","timeoutId","className","typeKitScript","scriptLoaded","firstScript","scriptReadyState","onreadystatechange","Typekit","load","renderVisualBuilder","targetingMsgJson","siteUrl","selectors","selector","element","querySelector","outerHTML","dispatchJsonData","intervalId","retryElement","inaObj","json","kvPairsEvent","CustomEvent","dispatchEvent","ctEventhandler","ctScript","insertPosition","join","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","onclick","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","sandbox","pointerCss","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","closeCampaign","Event","appendScriptForCustomEvent","srcdoc","handleMessage","heightAdjust","boxWrapper","bannerWrapper","margin","onUserLogin","handleIframeLoad","contentWindow","postMessage","contentDocument","scrollHeight","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","interstitialWrapper","interstitialOverlay","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","getTotalVisits","visitCount","getLastVisit","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","info","debugPE","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","getTimeElapsed","sessionStart","getPageCount","seqNo","requestTime","RequestManager","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","post","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","_enableWebPush","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","skipDialog","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","getValue","getdefaultValue","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","addValueChangedCallback","removeValueChangedCallback","clearStartFlag","VariableStore","syncVariables","onSyncSuccess","onSyncFailure","meta","tk","r","status","fetchVariables","onFetchCallback","addVariablesChangedCallback","callback","addOneTimeVariablesChangedCallback","removeVariablesChangedCallback","removeOneTimeVariablesChangedCallback","callBack","CleverTap","spa","isSpa","bind","enablePersonalization","_isPersonalisationActive","ReqestManager","privacy","notifications","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","handleDecrementValue","setMultiValuesForKey","addMultiValueForKey","addMultiValuesForKey","removeMultiValueForKey","removeMultiValuesForKey","removeValueForKey","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","sendLocationData","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","elements","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","parentWindow","opener","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","setOffline","arg","defineVariable","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;EAAO,MAAMA,aAAa,GAAG,oBAAtB;EACA,MAAMC,eAAe,GAAG,QAAxB;EACA,MAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;ECAQ,MAAMC,OAAN,CAAc;EAO3BC,EAAAA,WAAW,GAAsE;EAAA,QAApE;EAAEC,MAAAA;EAAF,KAAoE,uEAA3D,EAA2D;EAAA,QAAvDC,MAAuD,uEAA9C,EAA8C;EAAA,QAA1CC,YAA0C,uEAA3BP,aAA2B;EAAA,QAAZQ,KAAY,uEAAJ,EAAI;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,aALvE;EAKuE;EAAA;EAAA;EAAA,aAJjER;EAIiE;EAAA;EAAA;EAAA,aAHjE;EAGiE;EAAA;EAAA;EAAA,aAFxE;EAEwE;EAC/E,SAAKK,EAAL,GAAUA,EAAV;;EACA,QAAIC,MAAJ,EAAY;EACV,WAAKA,MAAL,GAAcA,MAAd;EACD;;EACD,QAAIC,YAAJ,EAAkB;EAChB,WAAKA,YAAL,GAAoBA,YAApB;EACD;;EACD,QAAIC,KAAJ,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,KAAyB,WAAzB,IAAwCprC,MAAM,CAACorC,MAAP,CAAcC,IAAd,KAAuB,YAAvE;EACD;;yDAMmBjtC,MAAM;EACxB,MAAI,KAAKomC,wBAAL,EAAJ,EAAqC;EACnCpmC,IAAAA,IAAI,CAAC8+B,KAAL,GAAa,IAAb;EACD;EACF;;QC3xBGpvB,SAAS,GAAG,IAAIw9B,SAAJ,CAActrC,MAAM,CAAC8N,SAArB;EAElB9N,MAAM,CAAC8N,SAAP,GAAmB9N,MAAM,CAAC+N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file diff --git a/clevertap.min.js b/clevertap.min.js index e61db3d6..ee1c7780 100644 --- a/clevertap.min.js +++ b/clevertap.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).clevertap=t()}(this,(function(){"use strict";var e=0;function t(t){return"__private_"+e+++"_"+t}function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}const o="clevertap-prod.com",n="https:";var s=t("accountId"),r=t("region"),a=t("targetDomain"),l=t("dcSdkversion"),d=t("token");class c{constructor(){let{id:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";Object.defineProperty(this,s,{writable:!0,value:void 0}),Object.defineProperty(this,r,{writable:!0,value:""}),Object.defineProperty(this,a,{writable:!0,value:o}),Object.defineProperty(this,l,{writable:!0,value:""}),Object.defineProperty(this,d,{writable:!0,value:""}),this.id=e,t&&(this.region=t),i&&(this.targetDomain=i),n&&(this.token=n)}get id(){return i(this,s)[s]}set id(e){i(this,s)[s]=e}get region(){return i(this,r)[r]}set region(e){i(this,r)[r]=e}get dcSDKVersion(){return i(this,l)[l]}set dcSDKVersion(e){i(this,l)[l]=e}get targetDomain(){return i(this,a)[a]}set targetDomain(e){i(this,a)[a]=e}get token(){return i(this,d)[d]}set token(e){i(this,d)[d]=e}get finalTargetDomain(){return this.region?"".concat(this.region,".").concat(this.targetDomain):this.targetDomain===o?"".concat("eu1",".").concat(this.targetDomain):this.targetDomain}get dataPostPEURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/defineVars")}get dataPostURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/a?t=96")}get recorderURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/r?r=1")}get emailURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/e?r=1")}}const h=new RegExp("^\\s+|\\.|:|\\$|'|\"|\\\\|\\s+$","g"),u=new RegExp("^\\s+|'|\"|\\\\|\\s+$","g"),p=new RegExp("'","g"),g="clear",v="Charged ID",f="WZRK_CHARGED_ID",b="WZRK_G",m="WZRK_K",y="WZRK_CAMP",w="WZRK_CAMP_G",C="WZRK_EV",k="WZRK_META",x="WZRK_PR",P="WZRK_ARP",I="WZRK_L",S="global",O="optOut",_="useIP",E="WZRK_X",A="push",M=31536e3,L="wzrk_",T="wzrk_id",R="Notification Viewed",j="Notification Clicked",D="WZRK_FPU",B="WZRK_PSD",N="$incr",z="$add",U="$remove",F="$delete",q="WZRK_INBOX_CONFIG",V="WZRK_INBOX",W=1e3,K="wzrk_fetch",H="wiz-iframe",G="wiz-iframe-intent",J="Event",Z="Profile",$=["Stayed","UTM Visited","App Launched","Notification Sent",R,j],Y=e=>"string"==typeof e||e instanceof String,Q=e=>"[object Object]"===Object.prototype.toString.call(e),X=e=>"object"==typeof e&&e instanceof Date,ee=e=>{for(const t in e)if(e.hasOwnProperty(t))return!1;return!0},te=e=>!isNaN(parseFloat(e))&&isFinite(e),ie=e=>/^-?[\d.]+(?:e-?\d+)?$/.test(e)&&"number"==typeof e,oe=e=>null!=e&&"undefined"!==e,ne=(e,t)=>{if("object"!=typeof e){let i;return Y(e)?(i=se(e,u),i.length>1024&&(i=i.substring(0,1024),t.reportError(521,i+"... length exceeded 1024 chars. Trimmed."))):i=e,i}for(const i in e)if(e.hasOwnProperty(i)){const o=ne(e[i],t);let n;n=se(i,h),n.length>1024&&(n=n.substring(0,1024),t.reportError(520,n+"... length exceeded 1024 chars. Trimmed.")),delete e[i],e[n]=o}return e},se=(e,t)=>e.replace(t,""),re=()=>{const e=new Date;return e.getFullYear()+""+e.getMonth()+e.getDay()},ae=()=>Math.floor((new Date).getTime()/1e3),le=e=>"$D_"+Math.round(e.getTime()/1e3),de=e=>{if(ce(e))return"$D_"+e},ce=e=>{const t=/^(\d{4})(\d{2})(\d{2})$/.exec(e);if(null==t)return!1;const i=t[3],o=t[2]-1,n=t[1],s=new Date(n,o,i);return s.getDate()==i&&s.getMonth()==o&&s.getFullYear()==n};class he{static save(e,t){return!(!e||!t)&&(this._isLocalStorageSupported()?(localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),!0):void 0)}static read(e){if(!e)return!1;let t=null;if(this._isLocalStorageSupported()&&(t=localStorage.getItem(e)),null!=t)try{t=JSON.parse(t)}catch(e){}return t}static remove(e){return!!e&&(this._isLocalStorageSupported()?(localStorage.removeItem(e),!0):void 0)}static removeCookie(e,t){let i=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";t&&(i=i+" domain="+t+"; path=/"),document.cookie=i}static createCookie(e,t,i,o){let n="",s="";if(i){const e=new Date;e.setTime(e.getTime()+1e3*i),n="; expires="+e.toGMTString()}o&&(s="; domain="+o),t=encodeURIComponent(t),document.cookie=e+"="+t+n+s+"; path=/"}static readCookie(e){const t=e+"=",i=document.cookie.split(";");for(let e=0;e=0;o--){if(a=0===o?r[o]+a:"."+r[o]+a,this.readCookie(e)){var n="test_"+e+o;if(this.createCookie(n,t,10,a),!this.readCookie(n))continue;this.removeCookie(n,a)}this.createCookie(e,t,i,a);if(this.readCookie(e)==t){s=a,ue.broadDomain=s;break}}}else this.createCookie(e,t,i,s)}else this.createCookie(e,t,i,o)}static getMetaProp(e){const t=this.readFromLSorCookie(k);if(null!=t)return t[e]}static setMetaProp(e,t){if(this._isLocalStorageSupported()){let i=this.readFromLSorCookie(k);null==i&&(i={}),void 0===t?delete i[e]:i[e]=t,this.saveToLSorCookie(k,i)}}static getAndClearMetaProp(e){const t=this.getMetaProp(e);return this.setMetaProp(e,void 0),t}static setInstantDeleteFlagInK(){let e=this.readFromLSorCookie(m);null==e&&(e={}),e.flag=!0,this.saveToLSorCookie(m,e)}static backupEvent(e,t,i){let o=this.readFromLSorCookie(I);void 0===o&&(o={}),o[t]={q:e},this.saveToLSorCookie(I,o),i.debug("stored in ".concat(I," reqNo : ").concat(t," -> ").concat(e))}static removeBackup(e,t){const i=this.readFromLSorCookie(I);null!=i&&void 0!==i[e]&&(t.debug("del event: ".concat(e," data-> ").concat(i[e].q)),delete i[e],this.saveToLSorCookie(I,i))}}const ue={globalCache:{gcookie:null,REQ_N:0,RESP_N:0},LRU_CACHE:null,globalProfileMap:void 0,globalEventsMap:void 0,blockRequest:!1,isOptInRequest:!1,broadDomain:null,webPushEnabled:null,campaignDivMap:{},currentSessionId:null,wiz_counter:0,notifApi:{notifEnabledFromApi:!1},unsubGroups:[],updatedCategoryLong:null,inbox:null,isPrivacyArrPushed:!1,privacyArray:[],offline:!1,location:null,dismissSpamControl:!1,globalUnsubscribe:!0,flutterVersion:null,variableStore:{}};var pe=t("keyOrder"),ge=t("deleteFromObject");class ve{constructor(e){Object.defineProperty(this,ge,{value:fe}),Object.defineProperty(this,pe,{writable:!0,value:void 0}),this.max=e;let t=he.readFromLSorCookie(E);if(t){const e={};i(this,pe)[pe]=[],t=t.cache;for(const o in t)t.hasOwnProperty(o)&&(e[t[o][0]]=t[o][1],i(this,pe)[pe].push(t[o][0]));this.cache=e}else this.cache={},i(this,pe)[pe]=[]}get(e){const t=this.cache[e];return t&&(this.cache=i(this,ge)[ge](e,this.cache),this.cache[e]=t,i(this,pe)[pe].push(e)),this.saveCacheToLS(this.cache),t}set(e,t){const o=this.cache[e],n=i(this,pe)[pe];null!=o?this.cache=i(this,ge)[ge](e,this.cache):n.length===this.max&&(this.cache=i(this,ge)[ge](n[0],this.cache)),this.cache[e]=t,i(this,pe)[pe][i(this,pe)[pe]-1]!==e&&i(this,pe)[pe].push(e),this.saveCacheToLS(this.cache)}saveCacheToLS(e){const t=[],o=i(this,pe)[pe];for(const i in o)if(o.hasOwnProperty(i)){const n=[];n.push(o[i]),n.push(e[o[i]]),t.push(n)}he.saveToLSorCookie(E,{cache:t})}getKey(e){if(null===e)return null;const t=i(this,pe)[pe];for(const i in t)if(t.hasOwnProperty(i)&&this.cache[t[i]]===e)return t[i];return null}getSecondLastKey(){const e=i(this,pe)[pe];return null!=e&&e.length>1?e[e.length-2]:-1}getLastKey(){const e=i(this,pe)[pe].length;if(e)return i(this,pe)[pe][e-1]}}var fe=function(e,t){const o=JSON.parse(JSON.stringify(i(this,pe)[pe])),n={};let s;for(const i in o)o.hasOwnProperty(i)&&(o[i]!==e?n[o[i]]=t[o[i]]:s=i);return o.splice(s,1),i(this,pe)[pe]=JSON.parse(JSON.stringify(o)),n},be=t("logger"),me=t("request"),ye=t("device"),we=t("session");class Ce{constructor(e){let{logger:t,request:o,device:n,session:s}=e;Object.defineProperty(this,be,{writable:!0,value:void 0}),Object.defineProperty(this,me,{writable:!0,value:void 0}),Object.defineProperty(this,ye,{writable:!0,value:void 0}),Object.defineProperty(this,we,{writable:!0,value:void 0}),i(this,be)[be]=t,i(this,me)[me]=o,i(this,ye)[ye]=n,i(this,we)[we]=s}s(e,t,o,n,s){let r=!1,a=!1;if(window.isOULInProgress&&(o||"undefined"!==n&&n===window.oulReqN)&&(window.isOULInProgress=!1,r=!0),void 0===n&&(n=0),he.removeBackup(n,i(this,be)[be]),n>ue.globalCache.REQ_N)return;if(oe(i(this,ye)[ye].gcookie)||e&&(a=!0),!oe(i(this,ye)[ye].gcookie)||o||"boolean"==typeof s){const n=i(this,we)[we].getSessionCookieObject();if(window.isOULInProgress||n.s&&t{if(Q(e)){for(var t in e)if(e.hasOwnProperty(t)){if(Q(e[t])||Array.isArray(e[t]))return!1;X(e[t])&&(e[t]=le(e[t]))}return!0}return!1},Ne=(e,t)=>{if(Q(e)){for(var i in e)if(e.hasOwnProperty(i))if("Items"===i){if(!Array.isArray(e[i]))return!1;for(var o in e[i].length>50&&t.reportError(522,"Charged Items exceed 50 limit. Actual count: "+e[i].length),e[i])if(e[i].hasOwnProperty(o)&&(!Q(e[i][o])||!Be(e[i][o])))return!1}else{if(Q(e[i])||Array.isArray(e[i]))return!1;X(e[i])&&(e[i]=le(e[i]))}if(Y(e[v])||ie(e[v])){const i=e[v]+"";if(void 0===De&&(De=he.readFromLSorCookie(f)),void 0!==De&&De.trim()===i.trim())return t.error("Duplicate charged Id - Dropped"+e),!1;De=i,he.saveToLSorCookie(f,i)}return!0}return!1};var ze=t("logger"),Ue=t("oldValues"),Fe=t("request"),qe=t("isPersonalisationActive"),Ve=t("processEventArray");class We extends Array{constructor(e,t){let{logger:o,request:n,isPersonalisationActive:s}=e;super(),Object.defineProperty(this,Ve,{value:Ke}),Object.defineProperty(this,ze,{writable:!0,value:void 0}),Object.defineProperty(this,Ue,{writable:!0,value:void 0}),Object.defineProperty(this,Fe,{writable:!0,value:void 0}),Object.defineProperty(this,qe,{writable:!0,value:void 0}),i(this,ze)[ze]=o,i(this,Ue)[Ue]=t,i(this,Fe)[Fe]=n,i(this,qe)[qe]=s}push(){for(var e=arguments.length,t=new Array(e),o=0;o0;){var t=e.shift();if(!Y(t)){i(this,ze)[ze].error(Oe);continue}if(t.length>1024&&(t=t.substring(0,1024),i(this,ze)[ze].reportError(510,t+"... length exceeded 1024 chars. Trimmed.")),$.includes(t)){i(this,ze)[ze].reportError(513,t+" is a restricted system event. It cannot be used as an event name.");continue}const o={type:"event"};if(o.evtName=se(t,h),0!==e.length){const n=e.shift();if(Q(n)){if("Charged"===t){if(!Ne(n,i(this,ze)[ze])){i(this,ze)[ze].reportError(511,"Charged event structure invalid. Not sent.");continue}}else if(!Be(n)){i(this,ze)[ze].reportError(512,t+" event structure invalid. Not sent.");continue}o.evtData=n}else e.unshift(n)}i(this,Fe)[Fe].processEvent(o)}};const He=e=>{const t={},i=e.indexOf("?");if(i>1){const o=e.substring(i+1);let n;const s=/\+/g,r=/([^&=]+)=?([^&]*)/g,a=function(e){let t=e.replace(s," ");try{t=decodeURIComponent(t)}catch(e){}return t};for(n=r.exec(o);n;)t[a(n[1])]=a(n[2]),n=r.exec(o)}return t},Ge=(e,t,i)=>e+"&"+t+"="+encodeURIComponent(i),Je=()=>window.location.hostname,Ze=(e,t)=>(t&&"function"==typeof t.debug&&t.debug("dobj:"+e),Ye(e)),$e=(()=>{let e="",t=0;for(t=0;t<=25;t++)e+=String.fromCharCode(t+65);for(t=0;t<=25;t++)e+=String.fromCharCode(t+97);for(t=0;t<10;t++)e+=t;return e+"+/="})(),Ye=e=>{if(null==e)return"";var t,i,o,n,s,r,a,l="",d=0;for(e=(e=>{if(null==e)return"";let t,i,o,n={},s={},r="",a="",l="",d=2,c=3,h=2,u="",p=0,g=0,v=String.fromCharCode;for(o=0;o>=1}else{for(i=1,t=0;t>=1}d--,0==d&&(d=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;d--,0==d&&(d=Math.pow(2,h),h++),n[a]=c++,l=String(r)}if(""!==l){if(Object.prototype.hasOwnProperty.call(s,l)){if(l.charCodeAt(0)<256){for(t=0;t>=1}else{for(i=1,t=0;t>=1}d--,0==d&&(d=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;d--,0==d&&(d=Math.pow(2,h),h++)}for(i=2,t=0;t>=1;for(;;){if(p<<=1,15==g){u+=v(p);break}g++}return u})(e);d<2*e.length;)d%2==0?(t=e.charCodeAt(d/2)>>8,i=255&e.charCodeAt(d/2),o=d/2+1>8:NaN):(t=255&e.charCodeAt((d-1)/2),(d+1)/2>8,o=255&e.charCodeAt((d+1)/2)):i=o=NaN),d+=3,n=t>>2,s=(3&t)<<4|i>>4,r=(15&i)<<2|o>>6,a=63&o,isNaN(i)?r=a=64:isNaN(o)&&(a=64),l=l+$e.charAt(n)+$e.charAt(s)+$e.charAt(r)+$e.charAt(a);return l};var Qe=t("fireRequest"),Xe=t("dropRequestDueToOptOut"),et=t("addUseIPToRequest"),tt=t("addARPToRequest");class it{constructor(){this.networkRetryCount=0,this.minDelayFrequency=0}static fireRequest(e,t,o,n){i(this,Qe)[Qe](e,1,t,o,n)}getDelayFrequency(){if(this.logger.debug("Network retry #"+this.networkRetryCount),this.networkRetryCount<10)return this.logger.debug(this.account.id,"Failure count is "+this.networkRetryCount+". Setting delay frequency to 1s"),this.minDelayFrequency=W,this.minDelayFrequency;if(null==this.account.region)return this.logger.debug(this.account.id,"Setting delay frequency to 1s"),W;{const e=1e3*(Math.floor(10*Math.random())+1);return this.minDelayFrequency+=e,this.minDelayFrequency<6e5?(this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency):(this.minDelayFrequency=W,this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency)}}}it.logger=void 0,it.device=void 0,it.account=void 0,Object.defineProperty(it,Qe,{value:function(e,t,o,n,s){var r,a;if(i(this,Xe)[Xe]())return void this.logger.debug("req dropped due to optout cookie: "+this.device.gcookie);if(oe(this.device.gcookie)||(ue.blockRequest=!0),s&&s===K)!oe(this.device.gcookie)&&ue.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(this.networkRetryCount)),i(this,Qe)[Qe](e,void 0,o,n)}),this.getDelayFrequency());else if(!oe(this.device.gcookie)&&ue.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(t)),i(this,Qe)[Qe](e,t+1,o,n)}),50);if(n?window.isOULInProgress=!0:(oe(this.device.gcookie)&&(e=Ge(e,"gc",this.device.gcookie)),e=i(this,tt)[tt](e,o)),e=Ge(e,"tries",t),e=i(this,et)[et](e),e=Ge(e,"r",(new Date).getTime()),(null===(r=window.clevertap)||void 0===r?void 0:r.hasOwnProperty("plugin"))||(null===(a=window.wizrocket)||void 0===a?void 0:a.hasOwnProperty("plugin"))){const t=window.clevertap.plugin||window.wizrocket.plugin;e=Ge(e,"ct_pl",t)}-1!==e.indexOf("chrome-extension:")&&(e=e.replace("chrome-extension:","https:"));for(var l=document.getElementsByClassName("ct-jp-cb");l[0]&&l[0].parentNode;)l[0].parentNode.removeChild(l[0]);const d=document.createElement("script");d.setAttribute("type","text/javascript"),d.setAttribute("src",e),d.setAttribute("class","ct-jp-cb"),d.setAttribute("rel","nofollow"),d.async=!0,document.getElementsByTagName("head")[0].appendChild(d),this.logger.debug("req snt -> url: "+e)}}),Object.defineProperty(it,Xe,{value:function(){return!ue.isOptInRequest&&oe(this.device.gcookie)&&Y(this.device.gcookie)?":OO"===this.device.gcookie.slice(-3):(ue.isOptInRequest=!1,!1)}}),Object.defineProperty(it,et,{value:function(e){var t=he.getMetaProp(_);return"boolean"!=typeof t&&(t=!1),Ge(e,_,t?"true":"false")}}),Object.defineProperty(it,tt,{value:function(e,t){if(!0===t){const t={skipResARP:!0};return Ge(e,"arp",Ze(JSON.stringify(t),this.logger))}return he._isLocalStorageSupported()&&void 0!==localStorage.getItem(P)&&null!==localStorage.getItem(P)?Ge(e,"arp",Ze(JSON.stringify(he.readFromLSorCookie(P)),this.logger)):e}});const ot=()=>{let e={};if(he._isLocalStorageSupported()){let t=he.read(y);null!=t?(t=JSON.parse(decodeURIComponent(t).replace(p,'"')),t.hasOwnProperty("global")?e.wp=t:e=t):e={}}return e},nt=e=>{if(he._isLocalStorageSupported()){const t={...ot(),...e},i=JSON.stringify(t);he.save(y,encodeURIComponent(i)),st()}},st=()=>{if(he._isLocalStorageSupported()){let i=he.read(b);if(oe(i))try{i=JSON.parse(decodeURIComponent(he.read(b)));const o=he.read(w)?JSON.parse(decodeURIComponent(he.read(w))):{};if(i&&he._isLocalStorageSupported()){var e={},t=ot();Object.keys(t).forEach((n=>{const s=i in o&&Object.keys(o[i]).length&&o[i][n]?o[i][n]:{},r=t[n].global,a=re(),l=t[n][a];if(void 0!==r){const e=Object.keys(r);for(const t in e){let i=[];if(e.hasOwnProperty(t)){let o=0,n=0;const a=e[t];if("tc"===a)continue;void 0!==l&&void 0!==l[a]&&(o=l[a]),void 0!==r&&void 0!==r[a]&&(n=r[a]),i=[a,o,n],s[a]=i}}}e={...e,[n]:s}})),o[i]=e,he.save(w,encodeURIComponent(JSON.stringify(o)))}}catch(e){console.error("Invalid clevertap Id "+e)}}},rt=()=>{const e=JSON.parse(decodeURIComponent(he.read(b)));let t={};if(he._isLocalStorageSupported()){let i={};t=ot();const o=he.read(w),n=o?decodeURIComponent(o):null,s=n?JSON.parse(n):null,r=e&&null!=o&&s&&s[e]&&s[e].wp?Object.values(s[e].wp):[],a=e&&null!=o&&s&&s[e]&&s[e].wi?Object.values(s[e].wi):[],l=re();let d=0,c=0;return t.wp&&t.wp[l]&&"undefined"!==t.wp[l].tc&&(d=t.wp[l].tc),t.wi&&t.wi[l]&&"undefined"!==t.wi[l].tc&&(c=t.wi[l].tc),i={wmp:d,wimp:c,tlc:r,witlc:a},i}},at=(e,t)=>{let{logger:i}=t,o=!1;if(Q(e))for(const t in e)if(e.hasOwnProperty(t)){o=!0;let n=e[t];if(null==n){delete e[t];continue}"Gender"!==t||n.match(/^M$|^F$/)||(o=!1,i.error(_e)),"Employed"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Ee)),"Married"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Ae)),"Education"!==t||n.match(/^School$|^College$|^Graduate$/)||(o=!1,i.error(Me)),"Age"===t&&null!=n&&(te(n)?e.Age=+n:(o=!1,i.error(Le))),"DOB"===t?(/^\$D_/.test(n)&&11===(n+"").length||X(n)||(o=!1,i.error(Te)),X(n)&&(e[t]=le(n))):X(n)&&(e[t]=le(n)),"Phone"!==t||ee(n)||(n.length>8&&"+"===n.charAt(0)?(n=n.substring(1,n.length),te(n)?e.Phone=+n:(o=!1,i.error(je+". Removed."))):(o=!1,i.error(je+". Removed."))),o||delete e[t]}return o},lt=e=>{const t={};t.Name=e.name,null!=e.id&&(t.FBID=e.id+""),"male"===e.gender?t.Gender="M":"female"===e.gender?t.Gender="F":t.Gender="O";null!=e.relationship_status&&(t.Married="N","Married"===e.relationship_status&&(t.Married="Y"));const i=function(e){if(null!=e){let t="",i="";for(let o=0;o0?"Y":"N",null!=e.email&&(t.Email=e.email),null!=e.birthday){const i=e.birthday.split("/");t.DOB=de(i[2]+i[0]+i[1])}return t},dt=(e,t)=>{let{logger:i}=t;const o={};if(null!=e.displayName&&(o.Name=e.displayName),null!=e.id&&(o.GPID=e.id+""),null!=e.gender&&("male"===e.gender?o.Gender="M":"female"===e.gender?o.Gender="F":"other"===e.gender&&(o.Gender="O")),null!=e.image&&!1===e.image.isDefault&&(o.Photo=e.image.url.split("?sz")[0]),null!=e.emails)for(let t=0;t{if(he._isLocalStorageSupported()){if(null==ue.globalProfileMap&&(ue.globalProfileMap=he.readFromLSorCookie(x),null==ue.globalProfileMap&&(ue.globalProfileMap={})),null!=e._custom){const t=e._custom;for(const i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);delete e._custom}for(const i in e)if(e.hasOwnProperty(i)){if(ue.globalProfileMap.hasOwnProperty(i)&&!t)continue;ue.globalProfileMap[i]=e[i]}null!=ue.globalProfileMap._custom&&delete ue.globalProfileMap._custom,he.saveToLSorCookie(x,ue.globalProfileMap)}},ht=(e,t,i)=>{if(null!=e&&"-1"!==e&&he._isLocalStorageSupported()){const t=ot();let o=t.wp[i];null==o&&(o={},t[i]=o),o[e]="dnd",nt(t)}if(null!=ue.campaignDivMap){const t=ue.campaignDivMap[e];null!=t&&(document.getElementById(t).style.display="none","intentPreview"===t&&null!=document.getElementById("intentOpacityDiv")&&(document.getElementById("intentOpacityDiv").style.display="none"))}};var ut=t("logger"),pt=t("request"),gt=t("account"),vt=t("oldValues"),ft=t("isPersonalisationActive"),bt=t("processProfileArray");class mt extends Array{constructor(e,t){let{logger:o,request:n,account:s,isPersonalisationActive:r}=e;super(),Object.defineProperty(this,bt,{value:yt}),Object.defineProperty(this,ut,{writable:!0,value:void 0}),Object.defineProperty(this,pt,{writable:!0,value:void 0}),Object.defineProperty(this,gt,{writable:!0,value:void 0}),Object.defineProperty(this,vt,{writable:!0,value:void 0}),Object.defineProperty(this,ft,{writable:!0,value:void 0}),i(this,ut)[ut]=o,i(this,pt)[pt]=n,i(this,gt)[gt]=s,i(this,vt)[vt]=t,i(this,ft)[ft]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o0)for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];let n,s={};if(null!=o.Site){if(n=o.Site,ee(n)||!at(n,{logger:i(this,ut)[ut]}))return}else if(null!=o.Facebook){const e=o.Facebook;ee(e)||e.error||(n=lt(e))}else if(null!=o["Google Plus"]){const e=o["Google Plus"];ee(e)||e.error||(n=dt(e,{logger:i(this,ut)[ut]}))}if(null!=n&&!ee(n)){s.type="profile",null==n.tz&&(n.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),s.profile=n,ct(n,!0),s=i(this,pt)[pt].addSystemDataToObject(s,void 0),i(this,pt)[pt].addFlags(s);const e=Ze(JSON.stringify(s),i(this,ut)[ut]);let t=i(this,gt)[gt].dataPostURL;t=Ge(t,"type",A),t=Ge(t,"d",e),i(this,pt)[pt].saveAndFireRequest(t,ue.blockRequest)}}},wt=t("request"),Ct=t("logger"),kt=t("account"),xt=t("session"),Pt=t("oldValues"),It=t("device"),St=t("processOUL"),Ot=t("handleCookieFromCache"),_t=t("deleteUser"),Et=t("processLoginArray");class At extends Array{constructor(e,t){let{request:o,account:n,session:s,logger:r,device:a}=e;super(),Object.defineProperty(this,Et,{value:Rt}),Object.defineProperty(this,_t,{value:Tt}),Object.defineProperty(this,Ot,{value:Lt}),Object.defineProperty(this,St,{value:Mt}),Object.defineProperty(this,wt,{writable:!0,value:void 0}),Object.defineProperty(this,Ct,{writable:!0,value:void 0}),Object.defineProperty(this,kt,{writable:!0,value:void 0}),Object.defineProperty(this,xt,{writable:!0,value:void 0}),Object.defineProperty(this,Pt,{writable:!0,value:void 0}),Object.defineProperty(this,It,{writable:!0,value:void 0}),i(this,wt)[wt]=o,i(this,kt)[kt]=n,i(this,xt)[xt]=s,i(this,Ct)[Ct]=r,i(this,Pt)[Pt]=t,i(this,It)[It]=a}clear(){i(this,Ct)[Ct].debug("clear called. Reset flag has been set."),i(this,_t)[_t](),he.setMetaProp(g,!0)}push(){for(var e=arguments.length,t=new Array(e),o=0;o{let o=he.readFromLSorCookie(m);const n=he.readFromLSorCookie(b);let s;if(null==o)o={},s=e;else{s=o.id;let r=!1,a=!1;if(null==s&&(s=e[0],r=!0),null==ue.LRU_CACHE&&he._isLocalStorageSupported()&&(ue.LRU_CACHE=new ve(100)),r)null!=n&&(ue.LRU_CACHE.set(s,n),ue.blockRequest=!1);else for(const t in e)if(e.hasOwnProperty(t)){const i=e[t];if(ue.LRU_CACHE.cache[i]){s=i,a=!0;break}}if(a){s!==ue.LRU_CACHE.getLastKey()?i(this,Ot)[Ot]():(t=!1,he.saveToLSorCookie(D,t));const e=ue.LRU_CACHE.get(s);ue.LRU_CACHE.set(s,e),he.saveToLSorCookie(b,e),i(this,It)[It].gcookie=e;const o=ue.LRU_CACHE.getSecondLastKey();if(he.readFromLSorCookie(D)&&-1!==o){const e=ue.LRU_CACHE.cache[o];i(this,wt)[wt].unregisterTokenForGuid(e)}}else r?null!=n&&(i(this,It)[It].gcookie=n,he.saveToLSorCookie(b,n),t=!1):this.clear(),he.saveToLSorCookie(D,!1),s=e[0]}o.id=s,he.saveToLSorCookie(m,o)};if(Array.isArray(e)&&e.length>0)for(const n in e)if(e.hasOwnProperty(n)){const s=e[n];let r,a={};if(null!=s.Site){if(r=s.Site,ee(r)||!at(r,{logger:i(this,Ct)[Ct]}))return}else if(null!=s.Facebook){const e=s.Facebook;ee(e)||e.error||(r=lt(e))}else if(null!=s["Google Plus"]){const e=s["Google Plus"];ee(e)&&!e.error&&(r=dt(e,{logger:i(this,Ct)[Ct]}))}if(null!=r&&!ee(r)){a.type="profile",null==r.tz&&(r.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),a.profile=r;const e=[];he._isLocalStorageSupported()&&(r.Identity&&e.push(r.Identity),r.Email&&e.push(r.Email),r.GPID&&e.push("GP:"+r.GPID),r.FBID&&e.push("FB:"+r.FBID),e.length>0&&o(e)),ct(r,!0),a=i(this,wt)[wt].addSystemDataToObject(a,void 0),i(this,wt)[wt].addFlags(a),t&&(a.isOUL=!0);const n=Ze(JSON.stringify(a),i(this,Ct)[Ct]);let s=i(this,kt)[kt].dataPostURL;s=Ge(s,"type",A),s=Ge(s,"d",n),i(this,wt)[wt].saveAndFireRequest(s,ue.blockRequest,t)}}},Lt=function(){ue.blockRequest=!1,console.debug("Block request is false"),he._isLocalStorageSupported()&&(delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),he.removeCookie(y,Je()),he.removeCookie(i(this,xt)[xt].cookieName,ue.broadDomain),he.removeCookie(P,ue.broadDomain),i(this,xt)[xt].setSessionCookieObject("")},Tt=function(){ue.blockRequest=!0,i(this,Ct)[Ct].debug("Block request is true"),ue.globalCache={gcookie:null,REQ_N:0,RESP_N:0},he._isLocalStorageSupported()&&(delete localStorage.WZRK_G,delete localStorage.WZRK_K,delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),he.removeCookie(b,ue.broadDomain),he.removeCookie(y,Je()),he.removeCookie(m,Je()),he.removeCookie(i(this,xt)[xt].cookieName,ue.broadDomain),he.removeCookie(P,ue.broadDomain),i(this,It)[It].gcookie=null,i(this,xt)[xt].setSessionCookieObject("")},Rt=function(e){if(Array.isArray(e)&&e.length>0){const t=e.pop();if(null!=t&&Q(t)&&(null!=t.Site&&Object.keys(t.Site).length>0||null!=t.Facebook&&Object.keys(t.Facebook).length>0||null!=t["Google Plus"]&&Object.keys(t["Google Plus"]).length>0)){he.setInstantDeleteFlagInK();try{i(this,St)[St]([t])}catch(e){i(this,Ct)[Ct].debug(e)}}else i(this,Ct)[Ct].error("Profile object is in incorrect format")}};class jt extends HTMLElement{constructor(){super(),this._details=null,this.shadow=null,this.shadow=this.attachShadow({mode:"open"})}get details(){return this._details||""}set details(e){null===this._details&&(this._details=e,this.renderBanner())}renderBanner(){this.shadow.innerHTML=this.getBannerContent(),!1!==this.trackClick&&this.addEventListener("click",(()=>{const e=this.details.onClick;e&&(this.details.window?window.open(e,"_blank"):window.parent.location.href=e),window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId})}getBannerContent(){return'\n \n \n ")}}class Dt extends HTMLElement{constructor(){super(),this._target=null,this._carousel=null,this.shadow=null,this.slides=0,this.previouslySelectedItem=-1,this.selectedItem=1,this.autoSlide=null,this.stopAutoSlideTimeout=null,this.shadow=this.attachShadow({mode:"open"}),void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",jt)}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderCarousel())}get details(){return this.target.display.details}get display(){return this.target.display}renderCarousel(){this.slides=this.details.length,this.shadow.innerHTML=this.getStyles();const e=this.getCarouselContent();this.display.showNavBtns&&e.insertAdjacentHTML("beforeend",this.display.navBtnsHtml),this.display.showNavArrows&&(e.insertAdjacentHTML("beforeend",this.display.leftNavArrowHtml),e.insertAdjacentHTML("beforeend",this.display.rightNavArrowHtml)),this._carousel=e,this.shadow.appendChild(e),this.setupClick(),this.updateSelectedItem(),this.startAutoSlide(),this.setupOnHover(),window.clevertap.renderNotificationViewed({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot})}setupClick(){this._carousel.addEventListener("click",(e=>{const t=e.target.id;if(t.startsWith("carousel__button")){const e=+t.split("-")[1];e!==this.selectedItem&&(this.previouslySelectedItem=this.selectedItem,this.selectedItem=e,this.updateSelectedItem(),this.startAutoSlide())}else if(t.startsWith("carousel__arrow"))t.endsWith("right")?this.goToNext():this.goToPrev(),this.startAutoSlide();else if(t.indexOf("-")>-1){const e=+t.split("-")[1],i=e-1;window.parent.clevertap&&window.clevertap.renderNotificationClicked({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot,wzrk_slideNo:e});const o=this.details[i].onClick;""!==o&&(this.details[i].window?window.open(o,"_blank"):window.location.href=o)}}))}setupOnHover(){this._carousel.addEventListener("mouseenter",(e=>{this.stopAutoSlideTimeout=setTimeout((()=>{this.autoSlide=clearInterval(this.autoSlide)}),500)})),this._carousel.addEventListener("mouseleave",(e=>{clearTimeout(this.stopAutoSlideTimeout),void 0===this.autoSlide&&this.startAutoSlide()}))}getCarouselContent(){const e=document.createElement("div");return e.setAttribute("class","carousel"),this.details.forEach(((t,i)=>{const o=document.createElement("ct-web-personalisation-banner");o.classList.add("carousel__item"),o.trackClick=!1,o.setAttribute("id","carousel__item-".concat(i+1)),o.details=t,e.appendChild(o)})),e}getStyles(){var e,t;return"\n \n ")}updateSelectedItem(){if(-1!==this.previouslySelectedItem){const e=this.shadow.getElementById("carousel__item-".concat(this.previouslySelectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.previouslySelectedItem));e.classList.remove("carousel__item--selected"),t&&t.classList.remove("carousel__button--selected")}const e=this.shadow.getElementById("carousel__item-".concat(this.selectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.selectedItem));e.classList.add("carousel__item--selected"),t&&t.classList.add("carousel__button--selected")}startAutoSlide(){clearInterval(this.autoSlide),this.autoSlide=setInterval((()=>{this.goToNext()}),this.display.sliderTime?1e3*this.display.sliderTime:3e3)}goToNext(){this.goTo(this.selectedItem,(this.selectedItem+1)%this.slides)}goToPrev(){this.goTo(this.selectedItem,this.selectedItem-1)}goTo(e,t){this.previouslySelectedItem=e,this.selectedItem=t,0===t&&(this.selectedItem=this.slides),this.updateSelectedItem()}}class Bt extends HTMLElement{constructor(){super(),this._target=null,this._session=null,this.shadow=null,this.popup=null,this.container=null,this.resizeObserver=null,this.shadow=this.attachShadow({mode:"open"})}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderImageOnlyPopup())}get session(){return this._session||""}set session(e){this._session=e}get msgId(){return this.target.wzrk_id}get pivotId(){return this.target.wzrk_pivot}get onClickUrl(){return this.target.display.onClickUrl}renderImageOnlyPopup(){const e=this.target.wzrk_id.split("_")[0],t=this.session.sessionId;this.shadow.innerHTML=this.getImageOnlyPopupContent(),this.popup=this.shadowRoot.getElementById("imageOnlyPopup"),this.container=this.shadowRoot.getElementById("container"),this.closeIcon=this.shadowRoot.getElementById("close"),this.popup.addEventListener("load",this.updateImageAndContainerWidth()),this.resizeObserver=new ResizeObserver((()=>this.handleResize(this.popup,this.container))),this.resizeObserver.observe(this.popup),this.closeIcon.addEventListener("click",(()=>{if(this.resizeObserver.unobserve(this.popup),document.getElementById("wzrkImageOnlyDiv").style.display="none",this.remove(),null!=e&&"-1"!==e&&he._isLocalStorageSupported()){const i=ot();let o=i.wp[t];null==o&&(o={},i[t]=o),o[e]="dnd",nt(i)}})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId}),this.onClickUrl&&this.popup.addEventListener("click",(()=>{this.target.display.window?window.open(this.onClickUrl,"_blank"):window.parent.location.href=this.onClickUrl,window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})}))}handleResize(e,t){const i=this.getRenderedImageWidth(e);t.style.setProperty("width","".concat(i,"px"))}getImageOnlyPopupContent(){return"\n ".concat(this.target.msgContent.css,"\n ").concat(this.target.msgContent.html,"\n ")}updateImageAndContainerWidth(){return()=>{const e=this.getRenderedImageWidth(this.popup);this.popup.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("height","auto"),this.container.style.setProperty("position","fixed"),this.popup.style.setProperty("visibility","visible"),this.closeIcon.style.setProperty("visibility","visible"),document.getElementById("wzrkImageOnlyDiv").style.visibility="visible"}}getRenderedImageWidth(e){const t=e.naturalWidth/e.naturalHeight;return e.height*t}}class Nt extends HTMLElement{constructor(e,t){super(),this.wrapper=null,this.snackBar=null,this.shadow=this.attachShadow({mode:"open"}),this.config=e,this.message=t,this.renderMessage(t)}get pivotId(){return this.message.wzrk_pivot}get campaignId(){return this.message.wzrk_id}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}renderMessage(e){switch(this.wrapper=this.createEl("div","messageWrapper"),e.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":{const t=this.prepareBasicMessage(e.msg[0]);this.wrapper.appendChild(t)}}const t=this.createEl("div","timeStamp");if(t.innerHTML="".concat(Jt(e.id.split("_")[1]),""),!e.viewed){const e=this.createEl("span","unreadMarker");t.appendChild(e)}this.wrapper.appendChild(t),this.shadow.appendChild(this.wrapper)}prepareBasicMessage(e){const t=this.createEl("div","message");if(e.imageUrl){const i=this.addImage(e.imageUrl,"mainImg");t.appendChild(i)}const i=this.createEl("div","iconTitleDescWrapper");if(e.iconUrl){const t=this.addImage(e.iconUrl,"iconImg");i.appendChild(t)}const o=this.createEl("div","titleDescWrapper");if(e.title){const t=this.createEl("div","title");t.innerText=e.title,o.appendChild(t)}if(e.description){const t=this.createEl("div","description");t.innerText=e.description,o.appendChild(t)}if((e.title||e.description)&&i.appendChild(o),(e.iconUrl||e.title||e.description)&&t.appendChild(i),e.buttons&&e.buttons.length){const i=this.addButtons(e.buttons);t.appendChild(i)}return t}addButtons(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.createEl("div","buttonsContainer");let i=!1;return e.forEach(((e,o)=>{const n=this.createEl("button","button-".concat(o),"button");n.innerText=e.text,o>0&&(n.style.cssText+="margin-left: 2px;"),"copy"===e.action&&(i=!0),t.appendChild(n)})),i&&this.addSnackbar(t),t}addSnackbar(e){this.snackBar=this.createEl("div","snackbar-".concat(this.campaignId),"snackbar"),this.snackBar.innerHTML=Yt;const t=this.createEl("span","snackbar-msg-".concat(this.campaignId),"snackbar-msg");t.innerText="Copied to clipboard",this.snackBar.appendChild(t),e.appendChild(this.snackBar)}addImage(e,t){const i=this.createEl("div","".concat(t,"Container")),o=this.createEl("img",t);return o.setAttribute("src",e),o.setAttribute("loading","lazy"),i.appendChild(o),i}raiseClickedEvent(e,t){switch(this.message.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":this.raiseClickedForBasicTemplates(e,t)}}raiseClickedForBasicTemplates(e,t){const i=this.message.msg[0],o={msgId:this.campaignId,pivotId:this.pivotId};if("BUTTON"===e.tagName){const t=e.id.split("-")[1],n=i.buttons[t];o.kv={wzrk_c2a:n.text},"url"===n.action?n.openUrlInNewTab?window.open(n.url,"_blank"):window.location=n.url:"copy"===n.action&&(window.focus(),navigator.clipboard.writeText(n.clipboardText),this.snackBar.style.setProperty("display","flex","important"),setTimeout((()=>{this.snackBar.style.setProperty("display","none","important")}),2e3))}else"CT-INBOX-MESSAGE"===e.tagName&&i.onClickUrl&&(i.openUrlInNewTab?window.open(i.onClickUrl,"_blank"):window.location=i.onClickUrl);t?console.log("Notifiction clicked event will be raised at run time with payload ::",o):window.clevertap.renderNotificationClicked(o)}}class zt extends HTMLElement{constructor(e){super(),this.isInboxOpen=!1,this.isInboxFromFlutter=!1,this.selectedCategory=null,this.unviewedMessages={},this.unviewedCounter=0,this.isPreview=!1,this.inboxConfigForPreview={},this.inboxSelector=null,this.inbox=null,this.emptyInboxMsg=null,this.inboxCard=null,this.unviewedBadge=null,this.observer=null,this.selectedCategoryRef=null,this.addClickListenerOnDocument=(()=>e=>{if(e.composedPath().includes(this.inbox)){const t=e.path||e.composedPath&&e.composedPath();if(t.length){const e=t[0].id;if("closeInbox"===e)this.toggleInbox();else if(e.startsWith("category-"))this.prevCategoryRef=this.selectedCategoryRef,this.selectedCategoryRef=t[0],this.updateActiveCategory(t[0].innerText);else{const e=t.filter((e=>{var t;return(null===(t=e.id)||void 0===t?void 0:t.startsWith("button-"))||"CT-INBOX-MESSAGE"===e.tagName}));if(e.length){e[e.length-1].raiseClickedEvent(e[0],this.isPreview)}}}}else(this.inboxSelector.contains(e.target)||this.isInboxOpen)&&(this.isInboxFromFlutter?this.isInboxFromFlutter=!1:this.toggleInbox(e))})(),this.setBadgeStyle=e=>{null!==this.unviewedBadge&&(this.unviewedBadge.innerText=e>9?"9+":e,this.unviewedBadge.style.display=e>0?"flex":"none")},this.logger=e,this.shadow=this.attachShadow({mode:"open"})}get incomingMessages(){return[]}set incomingMessages(e){void 0===e&&(e=[]),e.length>0&&this.inbox&&this.updateInboxMessages(e)}get incomingMessagesForPreview(){return[]}set incomingMessagesForPreview(e){void 0===e&&(e=[]);const t={};e.length>0&&this.inbox&&(this.isPreview=!0,this.unviewedCounter=0,e.forEach((e=>{const i="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=i,t[i]=e,this.unviewedMessages[i]=e,this.unviewedCounter++})),this.buildUIForMessages(t),this.updateUnviewedBadgeCounter())}connectedCallback(){this.init()}init(){this.config=this.isPreview?this.inboxConfigForPreview:he.readFromLSorCookie(q)||{},0!==Object.keys(this.config).length&&(this.inboxSelector=document.getElementById(this.config.inboxSelector),null!==this.inboxSelector&&(this.config.styles.notificationsBadge?this.addUnviewedBadge():this.unviewedBadge&&this.unviewedBadge.remove(),this.createinbox(),document.removeEventListener("click",this.addClickListenerOnDocument),document.addEventListener("click",this.addClickListenerOnDocument),this.config.categories.length&&this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadow.innerHTML=this.getInboxStyles(),this.shadow.appendChild(this.inbox)))}addMsgsToInboxFromLS(){const e=this.deleteExpiredAndGetUnexpiredMsgs(!1),t=e?Object.keys(e):[];0!==t.length&&(t.forEach((t=>{e[t].viewed||(this.unviewedMessages[t]=e[t],this.unviewedCounter++)})),this.buildUIForMessages(e),this.updateUnviewedBadgeCounter())}deleteExpiredAndGetUnexpiredMsgs(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Vt();const i=Math.floor(Date.now()/1e3);for(const o in t)if(t[o].wzrk_ttl&&t[o].wzrk_ttl>0&&t[o].wzrk_ttl0&&(t=Object.values(t).sort(((e,t)=>t.date-e.date)).reduce(((e,t)=>(e[t.id]=t,e)),{})),Wt(t),t}updateInboxMessages(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.deleteExpiredAndGetUnexpiredMsgs(),i=Date.now(),o={};e.forEach(((e,n)=>{const s="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=s,e.date=i-n,e.viewed=0,t[s]=e,o[s]=e,this.unviewedMessages[s]=e,this.unviewedCounter++})),Wt(t),this.buildUIForMessages(o),this.updateUnviewedBadgeCounter()}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}addUnviewedBadge(){this.unviewedBadge||(this.unviewedBadge=this.createEl("div","unviewedBadge"),this.unviewedBadge.style.cssText="display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ".concat(this.config.styles.notificationsBadge.backgroundColor,"; font-size: 12px; color: ").concat(this.config.styles.notificationsBadge.textColor,"; font-weight: bold; align-items: center; justify-content: center;"),document.body.appendChild(this.unviewedBadge)),this.updateUnviewedBadgePosition(),window.addEventListener("resize",(()=>{this.updateUnviewedBadgePosition()}))}updateUnviewedBadgePosition(){const{top:e,right:t}=this.inboxSelector.getBoundingClientRect();this.unviewedBadge.style.top="".concat(e-8,"px"),this.unviewedBadge.style.left="".concat(t-8,"px")}createinbox(){this.inbox=this.createEl("div","inbox");const e=this.createEl("div","header"),t=this.createEl("div","headerTitle");t.innerText=this.config.title;const i=this.createEl("div","closeInbox");if(i.innerHTML="×",e.appendChild(t),e.appendChild(i),this.inbox.appendChild(e),this.config.categories.length){const e=this.createCategories();this.inbox.appendChild(e)}this.inboxCard=this.createEl("div","inboxCard"),this.inbox.appendChild(this.inboxCard),this.emptyInboxMsg=this.createEl("div","emptyInboxMsg"),this.emptyInboxMsg.innerText="All messages will be displayed here.",this.inboxCard.appendChild(this.emptyInboxMsg);const o={root:this.inboxCard,rootMargin:"0px",threshold:.5};this.observer=new IntersectionObserver(((e,t)=>{this.handleMessageViewed(e)}),o),this.addMsgsToInboxFromLS()}createCategories(){const e=this.createEl("div","categoriesContainer"),t=this.createEl("div","leftArrow");t.innerHTML=$t,t.children[0].style="transform: rotate(180deg)",t.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(-70,0)})),e.appendChild(t);const i=this.createEl("div","categoriesWrapper");["All",...this.config.categories].forEach(((e,t)=>{const o=this.createEl("div","category-".concat(t),"category");o.innerText=e,0===t&&(this.selectedCategoryRef=o),i.appendChild(o)})),e.appendChild(i);const o=this.createEl("div","rightArrow");o.innerHTML=$t,o.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(70,0)})),e.appendChild(o);const n={root:e,threshold:.9},s=i.children[0],r=i.children[this.config.categories.length];new IntersectionObserver((e=>{this.categoryObserverCb(t,e[0].intersectionRatio>=.9)}),n).observe(s);return new IntersectionObserver((e=>{this.categoryObserverCb(o,e[0].intersectionRatio>=.9)}),n).observe(r),e}categoryObserverCb(e,t){e&&(e.style.display=t?"none":"flex")}updateActiveCategory(e){this.selectedCategory=e,this.inboxCard.scrollTop=0;let t=0;this.prevCategoryRef&&this.prevCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef.setAttribute("selected","true"),this.inboxCard.childNodes.forEach((e=>{"emptyInboxMsg"!==e.getAttribute("id")&&(e.style.display="All"===this.selectedCategory||e.getAttribute("category")===this.selectedCategory?"block":"none","block"===e.style.display&&t++)})),0===t?(this.emptyInboxMsg.innerText="".concat(e," messages will be displayed here."),this.emptyInboxMsg.style.display="block"):this.emptyInboxMsg.style.display="none"}buildUIForMessages(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!this.isPreview&&this.updateTSForRenderedMsgs(),this.inboxCard.scrollTop=0;const i=null!==(e=this.config.maxMsgsInInbox)&&void 0!==e?e:15,o=this.inboxCard.firstChild,n=Object.values(t).sort(((e,t)=>t.date-e.date)).map((e=>e.id));for(const e of n){const i=new Nt(this.config,t[e]);i.setAttribute("id",t[e].id),i.setAttribute("pivot",t[e].wzrk_pivot),i.setAttribute("part","ct-inbox-message"),this.config.categories.length>0?(i.setAttribute("category",t[e].tags[0]||""),i.style.display="All"===this.selectedCategory||t[e].category===this.selectedCategory?"block":"none"):i.style.display="block",this.inboxCard.insertBefore(i,o),this.observer.observe(i)}let s=this.inboxCard.querySelectorAll("ct-inbox-message").length;for(;s>i;){const e=this.inboxCard.querySelectorAll("ct-inbox-message");e.length>0&&e[e.length-1].remove(),s--}const r=this.inboxCard.querySelectorAll('ct-inbox-message[style*="display: block"]').length;this.emptyInboxMsg.style.display=r?"none":"block"}handleMessageViewed(e){const t=!this.isPreview;this.isInboxOpen&&e.forEach((e=>{e.isIntersecting&&this.unviewedMessages.hasOwnProperty(e.target.id)&&0===e.target.message.viewed&&(e.target.message.viewed=1,t?(window.clevertap.renderNotificationViewed({msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.updateMessageInLS(e.target.id,{...e.target.message,viewed:1}),setTimeout((()=>{e.target.shadowRoot.getElementById("unreadMarker").style.display="none"}),1e3)):console.log("Notifiction viewed event will be raised at run time with payload ::",{msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.unviewedCounter--,this.updateUnviewedBadgeCounter(),delete this.unviewedMessages[e.target.id])}))}updateMessageInLS(e,t){if(!this.isPreview){const i=Vt();i[e]=t,Wt(i)}}toggleInbox(e){this.isInboxOpen=!this.isInboxOpen,this.isInboxFromFlutter=!!(null==e?void 0:e.rect),this.isInboxOpen?(this.inboxCard.scrollTop=0,!this.isPreview&&this.deleteExpiredAndGetUnexpiredMsgs(),this.inbox.style.display="block",this.inbox.style.zIndex="2147483647",this.config.categories.length&&(this.selectedCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef=this.shadowRoot.getElementById("category-0"),this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadowRoot.getElementById("categoriesWrapper").scrollLeft-=this.shadowRoot.getElementById("categoriesWrapper").scrollWidth),this.setInboxPosition(e)):this.inbox.style.display="none"}setInboxPosition(e){const t=window.outerWidth,i=getComputedStyle(ue.inbox),o=i.getPropertyValue("--inbox-top"),n=i.getPropertyValue("--inbox-bottom"),s=i.getPropertyValue("--inbox-left"),r=i.getPropertyValue("--inbox-right");if(t>481&&!(o||n||s||r)){const t=Gt(e,this.inbox.clientHeight,this.inbox.clientWidth),i=t.xPos,o=t.yPos;this.inbox.style.top=o+"px",this.inbox.style.left=i+"px"}}updateUnviewedBadgeCounter(){if(this.isPreview)return void this.setBadgeStyle(this.unviewedCounter);let e=0;this.inboxCard.querySelectorAll("ct-inbox-message").forEach((t=>{const i=Vt();i[t.id]&&0===i[t.id].viewed&&e++})),this.setBadgeStyle(e)}updateTSForRenderedMsgs(){this.inboxCard.querySelectorAll("ct-inbox-message").forEach((e=>{const t=e.id.split("_")[1];e.shadow.getElementById("timeStamp").firstChild.innerText=Jt(t)}))}getInboxStyles(){const e=this.config.categories.length?64:16,t={panelBackgroundColor:this.config.styles.panelBackgroundColor,panelBorderColor:this.config.styles.panelBorderColor,headerBackgroundColor:this.config.styles.header.backgroundColor,headerTitleColor:this.config.styles.header.titleColor,closeIconColor:this.config.styles.closeIconColor,categoriesTabColor:this.config.styles.categories.tabColor,categoriesTitleColor:this.config.styles.categories.titleColor,selectedCategoryTabColor:this.config.styles.categories.selectedTab.tabColor,selectedCategoryTitleColor:this.config.styles.categories.selectedTab.titleColor,headerCategoryHeight:36+e};this.config.styles.categories.borderColor&&(t.categoriesBorderColor=this.config.styles.categories.borderColor),this.config.styles.categories.selectedTab.borderColor&&(t.selectedCategoryBorderColor=this.config.styles.categories.selectedTab.borderColor);const i=(e=>{let{panelBackgroundColor:t,panelBorderColor:i,headerBackgroundColor:o,headerTitleColor:n,closeIconColor:s,categoriesTabColor:r,categoriesTitleColor:a,categoriesBorderColor:l,selectedCategoryTabColor:d,selectedCategoryTitleColor:c,selectedCategoryBorderColor:h,headerCategoryHeight:u}=e;return'\n \n ")})(t),o=this.config.styles.cards;return i+(e=>{let{backgroundColor:t,borderColor:i,titleColor:o,descriptionColor:n,buttonColor:s,buttonTextColor:r,unreadMarkerColor:a}=e;return'\n \n ")})({backgroundColor:o.backgroundColor,borderColor:o.borderColor,titleColor:o.titleColor,descriptionColor:o.descriptionColor,buttonColor:o.buttonColor,buttonTextColor:o.buttonTextColor,unreadMarkerColor:o.unreadMarkerColor})}}const Ut=e=>{e.inbox_preview?ue.inbox.incomingMessagesForPreview=e.inbox_notifs:ue.inbox.incomingMessages=e},Ft=e=>{Ht(),ue.inbox=new zt({logger:e}),document.body.appendChild(ue.inbox)},qt=e=>{const t=he.readFromLSorCookie(V)||{};if(Object.keys(t).length>0&&Object.keys(t)[0].includes("_")){const i={};return i[e]=t,he.saveToLSorCookie(V,i),i}return t},Vt=()=>{const e=JSON.parse(decodeURIComponent(he.read(b)));if(!oe(e))return{};const t=qt(e);return t.hasOwnProperty(e)?t[e]:{}},Wt=e=>{const t=JSON.parse(decodeURIComponent(he.read(b)));if(!oe(t))return;const i={...qt(t),[t]:e};he.saveToLSorCookie(V,i)},Kt=e=>new Promise(((t,i)=>{if("complete"===document.readyState)Ft(e),t();else{const i=he.readFromLSorCookie(q)||{},o=()=>{null===ue.inbox&&Ft(e),t()};window.addEventListener("load",(()=>{if(document.getElementById(i.inboxSelector))o();else{let n=0;if(n<20){const s=setInterval((()=>{document.getElementById(i.inboxSelector)?(o(),clearInterval(s),t()):n>=20&&(clearInterval(s),e.debug("Failed to add inbox")),n++}),500)}}}))}})),Ht=()=>{void 0===customElements.get("ct-web-inbox")&&(customElements.define("ct-web-inbox",zt),customElements.define("ct-inbox-message",Nt))},Gt=(e,t,i)=>{const o=document.scrollingElement.scrollLeft,n=document.scrollingElement.scrollTop,s=window.innerWidth+o,r=window.innerHeight+n,a=e.rect||e.target.getBoundingClientRect(),l=a.x+o,d=a.y+n,c=a.left+o,h=a.right+o,u=a.top+n,p=a.bottom,g=a.height,v=a.width;let f,b,m=!1;const y=16;if(p+t<=r){const e=r-(p+t);b=e>=y?p+y:p+e}else if(u-t>=n){const e=u-t;b=e>=y?u-t-y:u-t-e}else m=!0,b=d+g/2-t/2,br&&(b=r-t);if(m){const e=h+i;if(e<=s){f=h+(e+y<=s?y:s-e)}else{const e=c-i;f=e-(e-y>=o?y:e-o)}}else f=l+v/2-i/2,fs&&(f=h-i>=o?h-i:s-i);return{xPos:f,yPos:b}},Jt=e=>{const t=Date.now();let i=Math.floor((t-e)/6e4);return i<5?"Just now":i<60?"".concat(i," minute").concat(i>1?"s":""," ago"):(i=Math.floor(i/60),i<24?"".concat(i," hour").concat(i>1?"s":""," ago"):(i=Math.floor(i/24),"".concat(i," day").concat(i>1?"s":""," ago")))},Zt=()=>Object.keys(he.readFromLSorCookie(q)||{}).length>0,$t='\n\n\n',Yt='\n\n\n',Qt="https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js",Xt="https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css",ei=(e,t,i)=>{document.addEventListener("DOMContentLoaded",(()=>function(e,t,i){document.body.innerHTML="",ti=document.createElement("div"),ti.id="overlayDiv",ti.style.position="relative",ti.style.display="flex",document.body.appendChild(ti);(function(e,t,i,o){return new Promise(((n,s)=>{var r=document.createElement("script");r.type="module",r.src=e,r.onload=function(){"function"==typeof window.Overlay?(window.Overlay("#overlayDiv",t,i,o),n()):s(new Error("ContentLayout not found in overlay.js"))},r.onerror=function(e){s(e)},document.head.appendChild(r)}))})(Qt,e,t,i).then((()=>{console.log("Overlay script loaded successfully.")})).catch((e=>{console.error("Error loading overlay script:",e)})),o=document.createElement("link"),o.rel="stylesheet",o.type="text/css",o.href=Xt,document.head.appendChild(o),function(){const e={kitId:"eqj6nom",scriptTimeout:3e3,async:!0},t=document.documentElement,i=setTimeout((function(){t.className=t.className.replace(/\bwf-loading\b/g,"")+" wf-inactive"}),e.scriptTimeout),o=document.createElement("script");let n=!1;const s=document.getElementsByTagName("script")[0];let r;t.className+=" wf-loading",o.src="https://use.typekit.net/"+e.kitId+".js",o.async=!0,o.onload=o.onreadystatechange=function(){if(r=this.readyState,!(n||r&&"complete"!==r&&"loaded"!==r)){n=!0,clearTimeout(i);try{Typekit.load(e)}catch(e){}}},s.parentNode.insertBefore(o,s)}();var o}(e,t,i)))};let ti;const ii=(e,t)=>{const i=t?e.details[0]:e.display.details[0],o=Object.keys(i)[0],n=i[o];if(o===window.location.href.split("?")[0])for(const i in n){const o=document.querySelector(i);if(o)n[i].html?o.outerHTML=n[i].html:oi(e,n[i]),t||window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot});else{let o=0;const s=setInterval((()=>{const r=document.querySelector(i);r?(n[i].html?r.outerHTML=n[i].html:oi(e,n[i]),t||window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot}),clearInterval(s)):(o++,o>=20&&(console.log("No element present on DOM with selector '".concat(i,"'.")),clearInterval(s)))}),500)}}};function oi(e,t){const i={};i.msgId=e.wzrk_id,e.wzrk_pivot&&(i.pivotId=e.wzrk_pivot),null!=t.json&&(i.json=t.json);const o=new CustomEvent("CT_web_native_display_buider",{detail:i});document.dispatchEvent(o)}const ni=e=>{const t=e.indexOf("\n `\n return html.replace(/(<\\s*\\/\\s*body)/, `${script}\\n$1`)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n const displayObj = targetingMsgJson.display\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = WIZ_IFRAME_INTENT\n let html = targetingMsgJson.msgContent.html\n if (displayObj['custom-editor'] && !displayObj['bee-editor'] && displayObj['custom-html-sandbox']) { // sandbox the iframe only for custom html\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox allow-forms' // allow popup to open url in new page\n html = ctEventhandler(html)\n }\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (targetingMsgJson.display['custom-editor'] && !targetingMsgJson.display['bee-editor'] && targetingMsgJson.display['custom-html-sandbox']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n let contentDiv\n iframe.onload = () => {\n if (targetingMsgJson.display['custom-editor'] && !targetingMsgJson.display['bee-editor'] && targetingMsgJson.display['custom-html-sandbox']) {\n window.addEventListener('message', event => {\n switch (event?.data?.action) {\n case GET_NOTIFICATION_DATA:\n window.clevertap.renderNotificationClicked(event.data.value)\n break\n case EVENT:\n window.clevertap.event.push(event.data.value)\n break\n case PROFILE:\n window.clevertap.profile.push(event.data.value)\n break\n case OUL:\n window.clevertap.onUserLogin.push(event.data.value)\n break\n case CLOSE_INTERSTITIAL_POPUP:\n setTimeout(() => {\n const interstitialWrapper = window.document.getElementById('intentPreview')\n const interstitialOverlay = window.document.getElementById('intentOpacityDiv')\n interstitialOverlay && interstitialOverlay.remove()\n interstitialWrapper && interstitialWrapper.remove()\n }, 0)\n break\n default:\n // Handle unknown action\n break\n }\n })\n contentDiv = ''\n } else {\n contentDiv = document.getElementById(WIZ_IFRAME_INTENT).contentDocument.getElementById('contentDiv')\n }\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n this.#logger.error('Error subscribing: ' + error)\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { initialiseCTBuilder, renderVisualBuilder } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token) {\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n #handleMessageEvent (event) {\n if (event.data && event.data.message) {\n if (event.data.message === 'Dashboard' && event.data.url) {\n initialiseCTBuilder(event.data.url, event.data.variant ?? null, event.data.details ?? {})\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n }\n }\n\n pageChanged () {\n const search = window.location.search\n const parentWindow = window.opener\n\n if (search === '?ctBuilder') {\n // open in visual builder mode\n this.#logger.debug('open in visual builder mode')\n window.addEventListener('message', this.#handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('builder', '*')\n }\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', this.#handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('preview', '*')\n }\n return\n }\n\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","constructor","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","dataPostPEURL","dataPostURL","recorderURL","emailURL","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","WIZ_IFRAME","WIZ_IFRAME_INTENT","ADJUST_IFRAME_HEIGHT","UPDATE_HEIGHT","GET_NOTIFICATION","EVENT","PROFILE","OUL","CLOSE_BOX_POPUP","CLOSE_BANNER_POPUP","GET_NOTIFICATION_DATA","CLOSE_INTERSTITIAL_POPUP","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","save","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","read","data","getItem","parse","e","remove","removeItem","removeCookie","name","domain","cookieStr","document","cookie","createCookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","readCookie","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","saveToLSorCookie","property","location","hostname","$ct","globalCache","readFromLSorCookie","trim","err","createBroadCookie","broadDomain","domainParts","testBroadDomain","testCookieName","tempCookie","getMetaProp","metaObj","setMetaProp","wzrkMetaObj","getAndClearMetaProp","setInstantDeleteFlagInK","k","flag","backupEvent","reqNo","backupArr","q","debug","removeBackup","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","get","item","saveCacheToLS","set","allKeys","objToArray","index","temp","getKey","getSecondLastKey","keysArr","getLastKey","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","s","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","sessionObj","getSessionCookieObject","kIdFromLS","guidFromLRUCache","lastK","lastGUID","unregisterTokenForGuid","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","_processOldValues","getDetails","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","fireRequest","skipARP","sendOULFlag","getDelayFrequency","account","randomDelay","random","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","ProfileHandler","profilesArr","getAttribute","propName","_handleIncrementDecrementValue","command","tz","profile","addSystemDataToObject","addFlags","compressedData","saveAndFireRequest","_handleMultiValueSet","arrayVal","array","toLowerCase","sendMultiValueData","_handleMultiValueAdd","propKey","propVal","_handleMultiValueRemove","_handleMultiValueDelete","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","clear","addToK","ids","g","kId","anonymousUser","foundInCache","gFromCache","Identity","cookieName","loginArr","pop","processProfile","CTWebPersonalisationBanner","HTMLElement","_details","shadow","attachShadow","mode","details","renderBanner","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","target","renderCarousel","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","button","setInterval","sliderTime","goTo","prev","cur","CTWebPopupImageOnly","_session","popup","container","resizeObserver","renderImageOnlyPopup","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","Message","config","message","wrapper","snackBar","renderMessage","createEl","part","_el","msg","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","raiseClickedEvent","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","contains","setBadgeStyle","msgCount","incomingMessages","msgs","updateInboxMessages","incomingMessagesForPreview","previewMsgs","now","buildUIForMessages","updateUnviewedBadgeCounter","connectedCallback","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","addMsgsToInboxFromLS","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","deleteMsgsFromUI","getInboxMessages","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","top","right","getBoundingClientRect","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","inbox_notifs","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","OVERLAY_PATH","CSS_PATH","initialiseCTBuilder","variant","onContentLoad","position","overlayPath","loadOverlayScript","then","catch","loadCSS","loadTypeKit","link","rel","head","script","src","onload","Overlay","Error","onerror","kitId","scriptTimeout","docElement","documentElement","timeoutId","className","typeKitScript","scriptLoaded","firstScript","scriptReadyState","onreadystatechange","Typekit","load","renderVisualBuilder","targetingMsgJson","siteUrl","selectors","selector","element","querySelector","outerHTML","dispatchJsonData","intervalId","retryElement","inaObj","json","kvPairsEvent","CustomEvent","dispatchEvent","ctEventhandler","ctScript","insertPosition","join","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","onclick","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","sandbox","pointerCss","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","closeCampaign","Event","appendScriptForCustomEvent","srcdoc","handleMessage","heightAdjust","boxWrapper","bannerWrapper","margin","onUserLogin","handleIframeLoad","contentWindow","postMessage","contentDocument","scrollHeight","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","interstitialWrapper","interstitialOverlay","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","getTotalVisits","visitCount","getLastVisit","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","info","debugPE","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","getTimeElapsed","sessionStart","getPageCount","seqNo","requestTime","RequestManager","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","post","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","_enableWebPush","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","skipDialog","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","getValue","getdefaultValue","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","addValueChangedCallback","removeValueChangedCallback","clearStartFlag","VariableStore","syncVariables","onSyncSuccess","onSyncFailure","meta","tk","r","status","fetchVariables","onFetchCallback","addVariablesChangedCallback","callback","addOneTimeVariablesChangedCallback","removeVariablesChangedCallback","removeOneTimeVariablesChangedCallback","callBack","CleverTap","spa","isSpa","bind","enablePersonalization","_isPersonalisationActive","ReqestManager","privacy","notifications","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","handleDecrementValue","setMultiValuesForKey","addMultiValueForKey","addMultiValuesForKey","removeMultiValueForKey","removeMultiValuesForKey","removeValueForKey","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","sendLocationData","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","elements","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","parentWindow","opener","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","setOffline","arg","defineVariable","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;EAAO,MAAMA,aAAa,GAAG,oBAAtB;EACA,MAAMC,eAAe,GAAG,QAAxB;EACA,MAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;ECAQ,MAAMC,OAAN,CAAc;EAO3BC,EAAAA,WAAW,GAAsE;EAAA,QAApE;EAAEC,MAAAA;EAAF,KAAoE,uEAA3D,EAA2D;EAAA,QAAvDC,MAAuD,uEAA9C,EAA8C;EAAA,QAA1CC,YAA0C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,EAA0C7C,SAA1C,CAAP;EACAkS,EAAAA,WAAW,GAAGzD,QAAQ,CAACyD,WAAD,EAAc,MAAd,EAAsBhW,QAAtB,CAAtB;EACAgW,EAAAA,WAAW,GAAGzD,QAAQ,CAACyD,WAAD,EAAc,GAAd,EAAmB3C,YAAY,CAAC7M,IAAI,CAACC,SAAL,CAAeE,IAAf,CAAD,8BAAuB,IAAvB,wBAA/B,CAAtB;;EAEA,4DAAcwX,kBAAd,CAAiCnI,WAAjC,EAA8CpN,GAAG,CAACgC,YAAlD;EACD;;yDAEoB;EACnB,SAAQ,OAAOrC,MAAM,CAACorC,MAAd,KAAyB,WAAzB,IAAwCprC,MAAM,CAACorC,MAAP,CAAcC,IAAd,KAAuB,YAAvE;EACD;;yDAMmBjtC,MAAM;EACxB,MAAI,KAAKomC,wBAAL,EAAJ,EAAqC;EACnCpmC,IAAAA,IAAI,CAAC8+B,KAAL,GAAa,IAAb;EACD;EACF;;QC3xBGpvB,SAAS,GAAG,IAAIw9B,SAAJ,CAActrC,MAAM,CAAC8N,SAArB;EAElB9N,MAAM,CAAC8N,SAAP,GAAmB9N,MAAM,CAAC+N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/modules/visualBuilder/builder_constants.js","src/modules/visualBuilder/pageBuilder.js","src/util/clevertap-handler.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/notification.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\nexport const WIZ_IFRAME = 'wiz-iframe'\nexport const WIZ_IFRAME_INTENT = 'wiz-iframe-intent'\nexport const ADJUST_IFRAME_HEIGHT = 'adjustIFrameHeight'\nexport const UPDATE_HEIGHT = 'update height'\nexport const GET_NOTIFICATION = 'getnotif'\nexport const EVENT = 'Event'\nexport const PROFILE = 'Profile'\nexport const OUL = 'OUL'\nexport const CLOSE_BOX_POPUP = 'closeBoxPopUp'\nexport const CLOSE_BANNER_POPUP = 'closeBannerPopUp'\nexport const GET_NOTIFICATION_DATA = 'getnotifData'\nexport const CLOSE_INTERSTITIAL_POPUP = 'closeInterstitialPopUp'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {}\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n // Initialize array\n var array = []\n\n // Check if globalProfileMap is null, initialize if needed\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n // Check if the value to be set is either string or number\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = $ct.globalProfileMap[propKey]\n array.push(typeof propVal === 'number' ? propVal : propVal.toLowerCase())\n } else {\n $ct.globalProfileMap[propKey] = propVal\n }\n } else {\n // Check if propVal is an array\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = Array.isArray($ct.globalProfileMap[propKey]) ? $ct.globalProfileMap[propKey] : [$ct.globalProfileMap[propKey]]\n }\n\n // Check for case-sensitive inputs and filter the same ones\n for (var i = 0; i < propVal.length; i++) {\n if (typeof propVal[i] === 'number' && !array.includes(propVal[i])) {\n array.push(propVal[i])\n } else if (typeof propVal[i] === 'string' && !array.includes(propVal[i].toLowerCase())) {\n array.push(propVal[i].toLowerCase())\n } else if ((typeof propVal[i] === 'number' && array.includes(propVal[i])) || (typeof propVal[i] === 'string' && array.includes(propVal[i].toLowerCase()))) {\n console.error('Values already included')\n } else {\n console.error('Array supports only string or number type values')\n }\n }\n\n // Update globalProfileMap with the array\n $ct.globalProfileMap[propKey] = array\n }\n\n // Save to local storage or cookie\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Call the sendMultiValueData function\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n var index = $ct.globalProfileMap[propKey].indexOf(propVal)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n } else {\n for (var k = 0; k < propVal.length; k++) {\n var idx = $ct.globalProfileMap[propKey].indexOf(propVal[k])\n if (idx !== -1) {\n $ct.globalProfileMap[propKey].splice(idx, 1)\n }\n }\n }\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n // console.log('Raise notification clicked event for ', item)\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","export const OVERLAY_PATH = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js'\nexport const CSS_PATH = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css'\n","import { CSS_PATH, OVERLAY_PATH } from './builder_constants'\n\nexport const handleMessageEvent = (event) => {\n if (event.data && event.data.message) {\n if (event.data.message === 'Dashboard' && event.data.url) {\n initialiseCTBuilder(event.data.url, event.data.variant ?? null, event.data.details ?? {})\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n }\n}\n/**\n * Initializes the Clevertap builder.\n * @param {string} url - The URL to initialize the builder.\n * @param {string} variant - The variant of the builder.\n * @param {Object} details - The details object.\n */\nconst initialiseCTBuilder = (url, variant, details) => {\n document.addEventListener('DOMContentLoaded', () => onContentLoad(url, variant, details))\n}\n\nlet container\n/**\n * Handles content load for Clevertap builder.\n */\nfunction onContentLoad (url, variant, details) {\n document.body.innerHTML = ''\n container = document.createElement('div')\n container.id = 'overlayDiv'\n container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form\n container.style.display = 'flex'\n document.body.appendChild(container)\n const overlayPath = OVERLAY_PATH\n loadOverlayScript(overlayPath, url, variant, details)\n .then(() => {\n console.log('Overlay script loaded successfully.')\n })\n .catch((error) => {\n console.error('Error loading overlay script:', error)\n })\n loadCSS()\n loadTypeKit()\n}\n\n/**\n * Loads CSS file.\n */\nfunction loadCSS () {\n var link = document.createElement('link')\n link.rel = 'stylesheet'\n link.type = 'text/css'\n link.href = CSS_PATH\n document.head.appendChild(link)\n}\n\n/**\n * Loads the overlay script.\n * @param {string} overlayPath - The path to overlay script.\n * @param {string} url - The URL.\n * @param {string} variant - The variant.\n * @param {Object} details - The details object.\n * @returns {Promise} A promise.\n */\nfunction loadOverlayScript (overlayPath, url, variant, details) {\n return new Promise((resolve, reject) => {\n var script = document.createElement('script')\n script.type = 'module'\n script.src = overlayPath\n script.onload = function () {\n if (typeof window.Overlay === 'function') {\n window.Overlay({ id: '#overlayDiv', url, variant, details })\n resolve()\n } else {\n reject(new Error('ContentLayout not found in overlay.js'))\n }\n }\n script.onerror = function (error) {\n reject(error)\n }\n document.head.appendChild(script)\n })\n}\n\n/**\n * Loads TypeKit script.\n */\nfunction loadTypeKit () {\n const config = {\n kitId: 'eqj6nom',\n scriptTimeout: 3000,\n async: true\n }\n\n const docElement = document.documentElement\n const timeoutId = setTimeout(function () {\n docElement.className = docElement.className.replace(/\\bwf-loading\\b/g, '') + ' wf-inactive'\n }, config.scriptTimeout)\n const typeKitScript = document.createElement('script')\n let scriptLoaded = false\n const firstScript = document.getElementsByTagName('script')[0]\n let scriptReadyState\n\n docElement.className += ' wf-loading'\n typeKitScript.src = 'https://use.typekit.net/' + config.kitId + '.js'\n typeKitScript.async = true\n typeKitScript.onload = typeKitScript.onreadystatechange = function () {\n scriptReadyState = this.readyState\n if (scriptLoaded || (scriptReadyState && scriptReadyState !== 'complete' && scriptReadyState !== 'loaded')) return\n scriptLoaded = true\n clearTimeout(timeoutId)\n try {\n // eslint-disable-next-line no-undef\n Typekit.load(config)\n } catch (e) {}\n }\n\n firstScript.parentNode.insertBefore(typeKitScript, firstScript)\n}\n\n/**\n * Renders the visual builder.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {boolean} isPreview - Indicates if it's a preview.\n */\nexport const renderVisualBuilder = (targetingMsgJson, isPreview) => {\n const details = isPreview ? targetingMsgJson.details[0] : targetingMsgJson.display.details[0]\n const siteUrl = Object.keys(details)[0]\n const selectors = details[siteUrl]\n\n if (siteUrl === window.location.href.split('?')[0]) {\n for (const selector in selectors) {\n const element = document.querySelector(selector)\n if (element) {\n if (selectors[selector].html) {\n element.outerHTML = selectors[selector].html\n } else {\n // Update json data\n dispatchJsonData(targetingMsgJson, selectors[selector])\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n } else {\n let count = 0\n const intervalId = setInterval(() => {\n const retryElement = document.querySelector(selector)\n if (retryElement) {\n if (selectors[selector].html) {\n retryElement.outerHTML = selectors[selector].html\n } else {\n // Update json data\n dispatchJsonData(targetingMsgJson, selectors[selector])\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n clearInterval(intervalId)\n } else {\n count++\n if (count >= 20) {\n console.log(`No element present on DOM with selector '${selector}'.`)\n clearInterval(intervalId)\n }\n }\n }, 500)\n }\n }\n }\n}\n\n/**\n * Dispatches JSON data.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {Object} selector - The selector object.\n */\nfunction dispatchJsonData (targetingMsgJson, selector) {\n const inaObj = {}\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (selector.json != null) {\n inaObj.json = selector.json\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display_buider', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n}\n","// clevertap-handler.js\n\nconst ctEventhandler = (html) => {\n const ctScript = `\n var clevertap = {\n event: {\n push: (eventName) => {\n window.parent.postMessage({\n action: 'Event',\n value: eventName\n },'*');\n }\n },\n profile: {\n push: (eventName) => {\n window.parent.postMessage({\n action: 'Profile',\n value: eventName\n },'*');\n }\n },\n onUserLogin: {\n push: (eventName) => {\n window.parent.postMessage({\n action: 'OUL',\n value: eventName\n },'*');\n }\n },\n closeBoxPopUp: () => {\n window.parent.postMessage({\n action: 'closeBoxPopUp',\n value: 'closeBoxPopUp'\n },'*');\n },\n closeBannerPopUp: () => {\n window.parent.postMessage({\n action: 'closeBannerPopUp',\n value: 'closeBannerPopUp'\n },'*');\n },\n closeInterstitialPopUp: () => {\n window.parent.postMessage({\n action: 'closeInterstitialPopUp',\n value: 'closeInterstitialPopUp'\n },'*');\n }\n }\n `\n const insertPosition = html.indexOf('\n `\n return html.replace(/(<\\s*\\/\\s*body)/, `${script}\\n$1`)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n const displayObj = targetingMsgJson.display\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = WIZ_IFRAME_INTENT\n let html = targetingMsgJson.msgContent.html\n if (displayObj['custom-editor'] && !displayObj['bee-editor'] && displayObj['custom-html-sandbox']) { // sandbox the iframe only for custom html\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox allow-forms' // allow popup to open url in new page\n html = ctEventhandler(html)\n }\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (targetingMsgJson.display['custom-editor'] && !targetingMsgJson.display['bee-editor'] && targetingMsgJson.display['custom-html-sandbox']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n let contentDiv\n iframe.onload = () => {\n if (targetingMsgJson.display['custom-editor'] && !targetingMsgJson.display['bee-editor'] && targetingMsgJson.display['custom-html-sandbox']) {\n window.addEventListener('message', event => {\n switch (event?.data?.action) {\n case GET_NOTIFICATION_DATA:\n window.clevertap.renderNotificationClicked(event.data.value)\n break\n case EVENT:\n window.clevertap.event.push(event.data.value)\n break\n case PROFILE:\n window.clevertap.profile.push(event.data.value)\n break\n case OUL:\n window.clevertap.onUserLogin.push(event.data.value)\n break\n case CLOSE_INTERSTITIAL_POPUP:\n setTimeout(() => {\n const interstitialWrapper = window.document.getElementById('intentPreview')\n const interstitialOverlay = window.document.getElementById('intentOpacityDiv')\n interstitialOverlay && interstitialOverlay.remove()\n interstitialWrapper && interstitialWrapper.remove()\n }, 0)\n break\n default:\n // Handle unknown action\n break\n }\n })\n contentDiv = ''\n } else {\n contentDiv = document.getElementById(WIZ_IFRAME_INTENT).contentDocument.getElementById('contentDiv')\n }\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n this.#logger.error('Error subscribing: ' + error)\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { handleMessageEvent } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token) {\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n this.#checkBuilder()\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n #checkBuilder () {\n const search = window.location.search\n const parentWindow = window.opener\n\n if (search === '?ctBuilder') {\n // open in visual builder mode\n this.#logger.debug('open in visual builder mode')\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('builder', '*')\n }\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('preview', '*')\n }\n }\n }\n\n pageChanged () {\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","constructor","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","dataPostPEURL","dataPostURL","recorderURL","emailURL","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","WIZ_IFRAME","WIZ_IFRAME_INTENT","ADJUST_IFRAME_HEIGHT","UPDATE_HEIGHT","GET_NOTIFICATION","EVENT","PROFILE","OUL","CLOSE_BOX_POPUP","CLOSE_BANNER_POPUP","GET_NOTIFICATION_DATA","CLOSE_INTERSTITIAL_POPUP","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","save","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","read","data","getItem","parse","e","remove","removeItem","removeCookie","name","domain","cookieStr","document","cookie","createCookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","readCookie","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","saveToLSorCookie","property","location","hostname","$ct","globalCache","readFromLSorCookie","trim","err","createBroadCookie","broadDomain","domainParts","testBroadDomain","testCookieName","tempCookie","getMetaProp","metaObj","setMetaProp","wzrkMetaObj","getAndClearMetaProp","setInstantDeleteFlagInK","k","flag","backupEvent","reqNo","backupArr","q","debug","removeBackup","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","get","item","saveCacheToLS","set","allKeys","objToArray","index","temp","getKey","getSecondLastKey","keysArr","getLastKey","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","s","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","sessionObj","getSessionCookieObject","kIdFromLS","guidFromLRUCache","lastK","lastGUID","unregisterTokenForGuid","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","_processOldValues","getDetails","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","fireRequest","skipARP","sendOULFlag","getDelayFrequency","account","randomDelay","random","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","ProfileHandler","profilesArr","getAttribute","propName","_handleIncrementDecrementValue","command","tz","profile","addSystemDataToObject","addFlags","compressedData","saveAndFireRequest","_handleMultiValueSet","arrayVal","array","toLowerCase","sendMultiValueData","_handleMultiValueAdd","propKey","propVal","_handleMultiValueRemove","_handleMultiValueDelete","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","clear","addToK","ids","g","kId","anonymousUser","foundInCache","gFromCache","Identity","cookieName","loginArr","pop","processProfile","CTWebPersonalisationBanner","HTMLElement","_details","shadow","attachShadow","mode","details","renderBanner","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","target","renderCarousel","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","button","setInterval","sliderTime","goTo","prev","cur","CTWebPopupImageOnly","_session","popup","container","resizeObserver","renderImageOnlyPopup","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","Message","config","message","wrapper","snackBar","renderMessage","createEl","part","_el","msg","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","raiseClickedEvent","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","contains","setBadgeStyle","msgCount","incomingMessages","msgs","updateInboxMessages","incomingMessagesForPreview","previewMsgs","now","buildUIForMessages","updateUnviewedBadgeCounter","connectedCallback","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","addMsgsToInboxFromLS","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","deleteMsgsFromUI","getInboxMessages","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","top","right","getBoundingClientRect","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","inbox_notifs","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","OVERLAY_PATH","CSS_PATH","handleMessageEvent","initialiseCTBuilder","variant","renderVisualBuilder","onContentLoad","position","overlayPath","loadOverlayScript","then","catch","loadCSS","loadTypeKit","link","rel","head","script","src","onload","Overlay","Error","onerror","kitId","scriptTimeout","docElement","documentElement","timeoutId","className","typeKitScript","scriptLoaded","firstScript","scriptReadyState","onreadystatechange","Typekit","load","targetingMsgJson","siteUrl","selectors","selector","element","querySelector","outerHTML","dispatchJsonData","intervalId","retryElement","inaObj","json","kvPairsEvent","CustomEvent","dispatchEvent","ctEventhandler","ctScript","insertPosition","join","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","onclick","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","sandbox","pointerCss","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","closeCampaign","Event","appendScriptForCustomEvent","srcdoc","handleMessage","heightAdjust","boxWrapper","bannerWrapper","margin","onUserLogin","handleIframeLoad","contentWindow","postMessage","contentDocument","scrollHeight","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","interstitialWrapper","interstitialOverlay","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","getTotalVisits","visitCount","getLastVisit","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","info","debugPE","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","getTimeElapsed","sessionStart","getPageCount","seqNo","requestTime","RequestManager","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","post","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","_enableWebPush","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","skipDialog","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","getValue","getdefaultValue","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","addValueChangedCallback","removeValueChangedCallback","clearStartFlag","VariableStore","syncVariables","onSyncSuccess","onSyncFailure","meta","tk","r","status","fetchVariables","onFetchCallback","addVariablesChangedCallback","callback","addOneTimeVariablesChangedCallback","removeVariablesChangedCallback","removeOneTimeVariablesChangedCallback","callBack","CleverTap","spa","isSpa","bind","enablePersonalization","_isPersonalisationActive","ReqestManager","privacy","notifications","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","handleDecrementValue","setMultiValuesForKey","addMultiValueForKey","addMultiValuesForKey","removeMultiValueForKey","removeMultiValuesForKey","removeValueForKey","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","sendLocationData","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","elements","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","setOffline","arg","defineVariable","timeout","debouncedPageChanged","parentWindow","opener","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;EAAO,MAAMA,aAAa,GAAG,oBAAtB;EACA,MAAMC,eAAe,GAAG,QAAxB;EACA,MAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;ECAQ,MAAMC,OAAN,CAAc;EAO3BC,EAAAA,WAAW,GAAsE;EAAA,QAApE;EAAEC,MAAAA;EAAF,KAAoE,uEAA3D,EAA2D;EAAA,QAAvDC,MAAuD,uEAA9C,EAA8C;EAAA,QAA1CC,YAA0C,uEAA3BP,aAA2B;EAAA,QAAZQ,KAAY,uEAAJ,EAAI;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,aALvE;EAKuE;EAAA;EAAA;EAAA,aAJjER;EAIiE;EAAA;EAAA;EAAA,aAHjE;EAGiE;EAAA;EAAA;EAAA,aAFxE;EAEwE;EAC/E,SAAKK,EAAL,GAAUA,EAAV;;EACA,QAAIC,MAAJ,EAAY;EACV,WAAKA,MAAL,GAAcA,MAAd;EACD;;EACD,QAAIC,YAAJ,EAAkB;EAChB,WAAKA,YAAL,GAAoBA,YAApB;EACD;;EACD,QAAIC,KAAJ,EAAW;EACT,WAAKA,KAAL,GAAaA,KAAb;EACD;EACF;;EAED,MAAIH,EAAJ,GAAU;EACR,uCAAO,IAAP;EACD;;EAED,MAAIA,EAAJ,CAAQI,SAAR,EAAmB;EACjB,gEAAkBA,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AL,EAAJ,EAAqC;EACnCrmC,IAAAA,IAAI,CAAC++B,KAAL,GAAa,IAAb;EACD;EACF;;QCnxBGrvB,SAAS,GAAG,IAAIy9B,SAAJ,CAAcvrC,MAAM,CAAC8N,SAArB;EAElB9N,MAAM,CAAC8N,SAAP,GAAmB9N,MAAM,CAAC+N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file diff --git a/clevertap.min.js b/clevertap.min.js index ee1c7780..6b0f3898 100644 --- a/clevertap.min.js +++ b/clevertap.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).clevertap=t()}(this,(function(){"use strict";var e=0;function t(t){return"__private_"+e+++"_"+t}function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}const o="clevertap-prod.com",n="https:";var s=t("accountId"),r=t("region"),a=t("targetDomain"),l=t("dcSdkversion"),d=t("token");class c{constructor(){let{id:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";Object.defineProperty(this,s,{writable:!0,value:void 0}),Object.defineProperty(this,r,{writable:!0,value:""}),Object.defineProperty(this,a,{writable:!0,value:o}),Object.defineProperty(this,l,{writable:!0,value:""}),Object.defineProperty(this,d,{writable:!0,value:""}),this.id=e,t&&(this.region=t),i&&(this.targetDomain=i),n&&(this.token=n)}get id(){return i(this,s)[s]}set id(e){i(this,s)[s]=e}get region(){return i(this,r)[r]}set region(e){i(this,r)[r]=e}get dcSDKVersion(){return i(this,l)[l]}set dcSDKVersion(e){i(this,l)[l]=e}get targetDomain(){return i(this,a)[a]}set targetDomain(e){i(this,a)[a]=e}get token(){return i(this,d)[d]}set token(e){i(this,d)[d]=e}get finalTargetDomain(){return this.region?"".concat(this.region,".").concat(this.targetDomain):this.targetDomain===o?"".concat("eu1",".").concat(this.targetDomain):this.targetDomain}get dataPostPEURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/defineVars")}get dataPostURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/a?t=96")}get recorderURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/r?r=1")}get emailURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/e?r=1")}}const h=new RegExp("^\\s+|\\.|:|\\$|'|\"|\\\\|\\s+$","g"),u=new RegExp("^\\s+|'|\"|\\\\|\\s+$","g"),p=new RegExp("'","g"),g="clear",v="Charged ID",f="WZRK_CHARGED_ID",b="WZRK_G",m="WZRK_K",y="WZRK_CAMP",w="WZRK_CAMP_G",C="WZRK_EV",k="WZRK_META",x="WZRK_PR",P="WZRK_ARP",I="WZRK_L",S="global",O="optOut",_="useIP",E="WZRK_X",A="push",M=31536e3,L="wzrk_",T="wzrk_id",R="Notification Viewed",j="Notification Clicked",D="WZRK_FPU",B="WZRK_PSD",N="$incr",z="$add",U="$remove",F="$delete",q="WZRK_INBOX_CONFIG",V="WZRK_INBOX",W=1e3,K="wzrk_fetch",H="wiz-iframe",G="wiz-iframe-intent",J="Event",Z="Profile",$=["Stayed","UTM Visited","App Launched","Notification Sent",R,j],Y=e=>"string"==typeof e||e instanceof String,Q=e=>"[object Object]"===Object.prototype.toString.call(e),X=e=>"object"==typeof e&&e instanceof Date,ee=e=>{for(const t in e)if(e.hasOwnProperty(t))return!1;return!0},te=e=>!isNaN(parseFloat(e))&&isFinite(e),ie=e=>/^-?[\d.]+(?:e-?\d+)?$/.test(e)&&"number"==typeof e,oe=e=>null!=e&&"undefined"!==e,ne=(e,t)=>{if("object"!=typeof e){let i;return Y(e)?(i=se(e,u),i.length>1024&&(i=i.substring(0,1024),t.reportError(521,i+"... length exceeded 1024 chars. Trimmed."))):i=e,i}for(const i in e)if(e.hasOwnProperty(i)){const o=ne(e[i],t);let n;n=se(i,h),n.length>1024&&(n=n.substring(0,1024),t.reportError(520,n+"... length exceeded 1024 chars. Trimmed.")),delete e[i],e[n]=o}return e},se=(e,t)=>e.replace(t,""),re=()=>{const e=new Date;return e.getFullYear()+""+e.getMonth()+e.getDay()},ae=()=>Math.floor((new Date).getTime()/1e3),le=e=>"$D_"+Math.round(e.getTime()/1e3),de=e=>{if(ce(e))return"$D_"+e},ce=e=>{const t=/^(\d{4})(\d{2})(\d{2})$/.exec(e);if(null==t)return!1;const i=t[3],o=t[2]-1,n=t[1],s=new Date(n,o,i);return s.getDate()==i&&s.getMonth()==o&&s.getFullYear()==n};class he{static save(e,t){return!(!e||!t)&&(this._isLocalStorageSupported()?(localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),!0):void 0)}static read(e){if(!e)return!1;let t=null;if(this._isLocalStorageSupported()&&(t=localStorage.getItem(e)),null!=t)try{t=JSON.parse(t)}catch(e){}return t}static remove(e){return!!e&&(this._isLocalStorageSupported()?(localStorage.removeItem(e),!0):void 0)}static removeCookie(e,t){let i=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";t&&(i=i+" domain="+t+"; path=/"),document.cookie=i}static createCookie(e,t,i,o){let n="",s="";if(i){const e=new Date;e.setTime(e.getTime()+1e3*i),n="; expires="+e.toGMTString()}o&&(s="; domain="+o),t=encodeURIComponent(t),document.cookie=e+"="+t+n+s+"; path=/"}static readCookie(e){const t=e+"=",i=document.cookie.split(";");for(let e=0;e=0;o--){if(a=0===o?r[o]+a:"."+r[o]+a,this.readCookie(e)){var n="test_"+e+o;if(this.createCookie(n,t,10,a),!this.readCookie(n))continue;this.removeCookie(n,a)}this.createCookie(e,t,i,a);if(this.readCookie(e)==t){s=a,ue.broadDomain=s;break}}}else this.createCookie(e,t,i,s)}else this.createCookie(e,t,i,o)}static getMetaProp(e){const t=this.readFromLSorCookie(k);if(null!=t)return t[e]}static setMetaProp(e,t){if(this._isLocalStorageSupported()){let i=this.readFromLSorCookie(k);null==i&&(i={}),void 0===t?delete i[e]:i[e]=t,this.saveToLSorCookie(k,i)}}static getAndClearMetaProp(e){const t=this.getMetaProp(e);return this.setMetaProp(e,void 0),t}static setInstantDeleteFlagInK(){let e=this.readFromLSorCookie(m);null==e&&(e={}),e.flag=!0,this.saveToLSorCookie(m,e)}static backupEvent(e,t,i){let o=this.readFromLSorCookie(I);void 0===o&&(o={}),o[t]={q:e},this.saveToLSorCookie(I,o),i.debug("stored in ".concat(I," reqNo : ").concat(t," -> ").concat(e))}static removeBackup(e,t){const i=this.readFromLSorCookie(I);null!=i&&void 0!==i[e]&&(t.debug("del event: ".concat(e," data-> ").concat(i[e].q)),delete i[e],this.saveToLSorCookie(I,i))}}const ue={globalCache:{gcookie:null,REQ_N:0,RESP_N:0},LRU_CACHE:null,globalProfileMap:void 0,globalEventsMap:void 0,blockRequest:!1,isOptInRequest:!1,broadDomain:null,webPushEnabled:null,campaignDivMap:{},currentSessionId:null,wiz_counter:0,notifApi:{notifEnabledFromApi:!1},unsubGroups:[],updatedCategoryLong:null,inbox:null,isPrivacyArrPushed:!1,privacyArray:[],offline:!1,location:null,dismissSpamControl:!1,globalUnsubscribe:!0,flutterVersion:null,variableStore:{}};var pe=t("keyOrder"),ge=t("deleteFromObject");class ve{constructor(e){Object.defineProperty(this,ge,{value:fe}),Object.defineProperty(this,pe,{writable:!0,value:void 0}),this.max=e;let t=he.readFromLSorCookie(E);if(t){const e={};i(this,pe)[pe]=[],t=t.cache;for(const o in t)t.hasOwnProperty(o)&&(e[t[o][0]]=t[o][1],i(this,pe)[pe].push(t[o][0]));this.cache=e}else this.cache={},i(this,pe)[pe]=[]}get(e){const t=this.cache[e];return t&&(this.cache=i(this,ge)[ge](e,this.cache),this.cache[e]=t,i(this,pe)[pe].push(e)),this.saveCacheToLS(this.cache),t}set(e,t){const o=this.cache[e],n=i(this,pe)[pe];null!=o?this.cache=i(this,ge)[ge](e,this.cache):n.length===this.max&&(this.cache=i(this,ge)[ge](n[0],this.cache)),this.cache[e]=t,i(this,pe)[pe][i(this,pe)[pe]-1]!==e&&i(this,pe)[pe].push(e),this.saveCacheToLS(this.cache)}saveCacheToLS(e){const t=[],o=i(this,pe)[pe];for(const i in o)if(o.hasOwnProperty(i)){const n=[];n.push(o[i]),n.push(e[o[i]]),t.push(n)}he.saveToLSorCookie(E,{cache:t})}getKey(e){if(null===e)return null;const t=i(this,pe)[pe];for(const i in t)if(t.hasOwnProperty(i)&&this.cache[t[i]]===e)return t[i];return null}getSecondLastKey(){const e=i(this,pe)[pe];return null!=e&&e.length>1?e[e.length-2]:-1}getLastKey(){const e=i(this,pe)[pe].length;if(e)return i(this,pe)[pe][e-1]}}var fe=function(e,t){const o=JSON.parse(JSON.stringify(i(this,pe)[pe])),n={};let s;for(const i in o)o.hasOwnProperty(i)&&(o[i]!==e?n[o[i]]=t[o[i]]:s=i);return o.splice(s,1),i(this,pe)[pe]=JSON.parse(JSON.stringify(o)),n},be=t("logger"),me=t("request"),ye=t("device"),we=t("session");class Ce{constructor(e){let{logger:t,request:o,device:n,session:s}=e;Object.defineProperty(this,be,{writable:!0,value:void 0}),Object.defineProperty(this,me,{writable:!0,value:void 0}),Object.defineProperty(this,ye,{writable:!0,value:void 0}),Object.defineProperty(this,we,{writable:!0,value:void 0}),i(this,be)[be]=t,i(this,me)[me]=o,i(this,ye)[ye]=n,i(this,we)[we]=s}s(e,t,o,n,s){let r=!1,a=!1;if(window.isOULInProgress&&(o||"undefined"!==n&&n===window.oulReqN)&&(window.isOULInProgress=!1,r=!0),void 0===n&&(n=0),he.removeBackup(n,i(this,be)[be]),n>ue.globalCache.REQ_N)return;if(oe(i(this,ye)[ye].gcookie)||e&&(a=!0),!oe(i(this,ye)[ye].gcookie)||o||"boolean"==typeof s){const n=i(this,we)[we].getSessionCookieObject();if(window.isOULInProgress||n.s&&t{if(Q(e)){for(var t in e)if(e.hasOwnProperty(t)){if(Q(e[t])||Array.isArray(e[t]))return!1;X(e[t])&&(e[t]=le(e[t]))}return!0}return!1},Ne=(e,t)=>{if(Q(e)){for(var i in e)if(e.hasOwnProperty(i))if("Items"===i){if(!Array.isArray(e[i]))return!1;for(var o in e[i].length>50&&t.reportError(522,"Charged Items exceed 50 limit. Actual count: "+e[i].length),e[i])if(e[i].hasOwnProperty(o)&&(!Q(e[i][o])||!Be(e[i][o])))return!1}else{if(Q(e[i])||Array.isArray(e[i]))return!1;X(e[i])&&(e[i]=le(e[i]))}if(Y(e[v])||ie(e[v])){const i=e[v]+"";if(void 0===De&&(De=he.readFromLSorCookie(f)),void 0!==De&&De.trim()===i.trim())return t.error("Duplicate charged Id - Dropped"+e),!1;De=i,he.saveToLSorCookie(f,i)}return!0}return!1};var ze=t("logger"),Ue=t("oldValues"),Fe=t("request"),qe=t("isPersonalisationActive"),Ve=t("processEventArray");class We extends Array{constructor(e,t){let{logger:o,request:n,isPersonalisationActive:s}=e;super(),Object.defineProperty(this,Ve,{value:Ke}),Object.defineProperty(this,ze,{writable:!0,value:void 0}),Object.defineProperty(this,Ue,{writable:!0,value:void 0}),Object.defineProperty(this,Fe,{writable:!0,value:void 0}),Object.defineProperty(this,qe,{writable:!0,value:void 0}),i(this,ze)[ze]=o,i(this,Ue)[Ue]=t,i(this,Fe)[Fe]=n,i(this,qe)[qe]=s}push(){for(var e=arguments.length,t=new Array(e),o=0;o0;){var t=e.shift();if(!Y(t)){i(this,ze)[ze].error(Oe);continue}if(t.length>1024&&(t=t.substring(0,1024),i(this,ze)[ze].reportError(510,t+"... length exceeded 1024 chars. Trimmed.")),$.includes(t)){i(this,ze)[ze].reportError(513,t+" is a restricted system event. It cannot be used as an event name.");continue}const o={type:"event"};if(o.evtName=se(t,h),0!==e.length){const n=e.shift();if(Q(n)){if("Charged"===t){if(!Ne(n,i(this,ze)[ze])){i(this,ze)[ze].reportError(511,"Charged event structure invalid. Not sent.");continue}}else if(!Be(n)){i(this,ze)[ze].reportError(512,t+" event structure invalid. Not sent.");continue}o.evtData=n}else e.unshift(n)}i(this,Fe)[Fe].processEvent(o)}};const He=e=>{const t={},i=e.indexOf("?");if(i>1){const o=e.substring(i+1);let n;const s=/\+/g,r=/([^&=]+)=?([^&]*)/g,a=function(e){let t=e.replace(s," ");try{t=decodeURIComponent(t)}catch(e){}return t};for(n=r.exec(o);n;)t[a(n[1])]=a(n[2]),n=r.exec(o)}return t},Ge=(e,t,i)=>e+"&"+t+"="+encodeURIComponent(i),Je=()=>window.location.hostname,Ze=(e,t)=>(t&&"function"==typeof t.debug&&t.debug("dobj:"+e),Ye(e)),$e=(()=>{let e="",t=0;for(t=0;t<=25;t++)e+=String.fromCharCode(t+65);for(t=0;t<=25;t++)e+=String.fromCharCode(t+97);for(t=0;t<10;t++)e+=t;return e+"+/="})(),Ye=e=>{if(null==e)return"";var t,i,o,n,s,r,a,l="",d=0;for(e=(e=>{if(null==e)return"";let t,i,o,n={},s={},r="",a="",l="",d=2,c=3,h=2,u="",p=0,g=0,v=String.fromCharCode;for(o=0;o>=1}else{for(i=1,t=0;t>=1}d--,0==d&&(d=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;d--,0==d&&(d=Math.pow(2,h),h++),n[a]=c++,l=String(r)}if(""!==l){if(Object.prototype.hasOwnProperty.call(s,l)){if(l.charCodeAt(0)<256){for(t=0;t>=1}else{for(i=1,t=0;t>=1}d--,0==d&&(d=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;d--,0==d&&(d=Math.pow(2,h),h++)}for(i=2,t=0;t>=1;for(;;){if(p<<=1,15==g){u+=v(p);break}g++}return u})(e);d<2*e.length;)d%2==0?(t=e.charCodeAt(d/2)>>8,i=255&e.charCodeAt(d/2),o=d/2+1>8:NaN):(t=255&e.charCodeAt((d-1)/2),(d+1)/2>8,o=255&e.charCodeAt((d+1)/2)):i=o=NaN),d+=3,n=t>>2,s=(3&t)<<4|i>>4,r=(15&i)<<2|o>>6,a=63&o,isNaN(i)?r=a=64:isNaN(o)&&(a=64),l=l+$e.charAt(n)+$e.charAt(s)+$e.charAt(r)+$e.charAt(a);return l};var Qe=t("fireRequest"),Xe=t("dropRequestDueToOptOut"),et=t("addUseIPToRequest"),tt=t("addARPToRequest");class it{constructor(){this.networkRetryCount=0,this.minDelayFrequency=0}static fireRequest(e,t,o,n){i(this,Qe)[Qe](e,1,t,o,n)}getDelayFrequency(){if(this.logger.debug("Network retry #"+this.networkRetryCount),this.networkRetryCount<10)return this.logger.debug(this.account.id,"Failure count is "+this.networkRetryCount+". Setting delay frequency to 1s"),this.minDelayFrequency=W,this.minDelayFrequency;if(null==this.account.region)return this.logger.debug(this.account.id,"Setting delay frequency to 1s"),W;{const e=1e3*(Math.floor(10*Math.random())+1);return this.minDelayFrequency+=e,this.minDelayFrequency<6e5?(this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency):(this.minDelayFrequency=W,this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency)}}}it.logger=void 0,it.device=void 0,it.account=void 0,Object.defineProperty(it,Qe,{value:function(e,t,o,n,s){var r,a;if(i(this,Xe)[Xe]())return void this.logger.debug("req dropped due to optout cookie: "+this.device.gcookie);if(oe(this.device.gcookie)||(ue.blockRequest=!0),s&&s===K)!oe(this.device.gcookie)&&ue.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(this.networkRetryCount)),i(this,Qe)[Qe](e,void 0,o,n)}),this.getDelayFrequency());else if(!oe(this.device.gcookie)&&ue.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(t)),i(this,Qe)[Qe](e,t+1,o,n)}),50);if(n?window.isOULInProgress=!0:(oe(this.device.gcookie)&&(e=Ge(e,"gc",this.device.gcookie)),e=i(this,tt)[tt](e,o)),e=Ge(e,"tries",t),e=i(this,et)[et](e),e=Ge(e,"r",(new Date).getTime()),(null===(r=window.clevertap)||void 0===r?void 0:r.hasOwnProperty("plugin"))||(null===(a=window.wizrocket)||void 0===a?void 0:a.hasOwnProperty("plugin"))){const t=window.clevertap.plugin||window.wizrocket.plugin;e=Ge(e,"ct_pl",t)}-1!==e.indexOf("chrome-extension:")&&(e=e.replace("chrome-extension:","https:"));for(var l=document.getElementsByClassName("ct-jp-cb");l[0]&&l[0].parentNode;)l[0].parentNode.removeChild(l[0]);const d=document.createElement("script");d.setAttribute("type","text/javascript"),d.setAttribute("src",e),d.setAttribute("class","ct-jp-cb"),d.setAttribute("rel","nofollow"),d.async=!0,document.getElementsByTagName("head")[0].appendChild(d),this.logger.debug("req snt -> url: "+e)}}),Object.defineProperty(it,Xe,{value:function(){return!ue.isOptInRequest&&oe(this.device.gcookie)&&Y(this.device.gcookie)?":OO"===this.device.gcookie.slice(-3):(ue.isOptInRequest=!1,!1)}}),Object.defineProperty(it,et,{value:function(e){var t=he.getMetaProp(_);return"boolean"!=typeof t&&(t=!1),Ge(e,_,t?"true":"false")}}),Object.defineProperty(it,tt,{value:function(e,t){if(!0===t){const t={skipResARP:!0};return Ge(e,"arp",Ze(JSON.stringify(t),this.logger))}return he._isLocalStorageSupported()&&void 0!==localStorage.getItem(P)&&null!==localStorage.getItem(P)?Ge(e,"arp",Ze(JSON.stringify(he.readFromLSorCookie(P)),this.logger)):e}});const ot=()=>{let e={};if(he._isLocalStorageSupported()){let t=he.read(y);null!=t?(t=JSON.parse(decodeURIComponent(t).replace(p,'"')),t.hasOwnProperty("global")?e.wp=t:e=t):e={}}return e},nt=e=>{if(he._isLocalStorageSupported()){const t={...ot(),...e},i=JSON.stringify(t);he.save(y,encodeURIComponent(i)),st()}},st=()=>{if(he._isLocalStorageSupported()){let i=he.read(b);if(oe(i))try{i=JSON.parse(decodeURIComponent(he.read(b)));const o=he.read(w)?JSON.parse(decodeURIComponent(he.read(w))):{};if(i&&he._isLocalStorageSupported()){var e={},t=ot();Object.keys(t).forEach((n=>{const s=i in o&&Object.keys(o[i]).length&&o[i][n]?o[i][n]:{},r=t[n].global,a=re(),l=t[n][a];if(void 0!==r){const e=Object.keys(r);for(const t in e){let i=[];if(e.hasOwnProperty(t)){let o=0,n=0;const a=e[t];if("tc"===a)continue;void 0!==l&&void 0!==l[a]&&(o=l[a]),void 0!==r&&void 0!==r[a]&&(n=r[a]),i=[a,o,n],s[a]=i}}}e={...e,[n]:s}})),o[i]=e,he.save(w,encodeURIComponent(JSON.stringify(o)))}}catch(e){console.error("Invalid clevertap Id "+e)}}},rt=()=>{const e=JSON.parse(decodeURIComponent(he.read(b)));let t={};if(he._isLocalStorageSupported()){let i={};t=ot();const o=he.read(w),n=o?decodeURIComponent(o):null,s=n?JSON.parse(n):null,r=e&&null!=o&&s&&s[e]&&s[e].wp?Object.values(s[e].wp):[],a=e&&null!=o&&s&&s[e]&&s[e].wi?Object.values(s[e].wi):[],l=re();let d=0,c=0;return t.wp&&t.wp[l]&&"undefined"!==t.wp[l].tc&&(d=t.wp[l].tc),t.wi&&t.wi[l]&&"undefined"!==t.wi[l].tc&&(c=t.wi[l].tc),i={wmp:d,wimp:c,tlc:r,witlc:a},i}},at=(e,t)=>{let{logger:i}=t,o=!1;if(Q(e))for(const t in e)if(e.hasOwnProperty(t)){o=!0;let n=e[t];if(null==n){delete e[t];continue}"Gender"!==t||n.match(/^M$|^F$/)||(o=!1,i.error(_e)),"Employed"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Ee)),"Married"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Ae)),"Education"!==t||n.match(/^School$|^College$|^Graduate$/)||(o=!1,i.error(Me)),"Age"===t&&null!=n&&(te(n)?e.Age=+n:(o=!1,i.error(Le))),"DOB"===t?(/^\$D_/.test(n)&&11===(n+"").length||X(n)||(o=!1,i.error(Te)),X(n)&&(e[t]=le(n))):X(n)&&(e[t]=le(n)),"Phone"!==t||ee(n)||(n.length>8&&"+"===n.charAt(0)?(n=n.substring(1,n.length),te(n)?e.Phone=+n:(o=!1,i.error(je+". Removed."))):(o=!1,i.error(je+". Removed."))),o||delete e[t]}return o},lt=e=>{const t={};t.Name=e.name,null!=e.id&&(t.FBID=e.id+""),"male"===e.gender?t.Gender="M":"female"===e.gender?t.Gender="F":t.Gender="O";null!=e.relationship_status&&(t.Married="N","Married"===e.relationship_status&&(t.Married="Y"));const i=function(e){if(null!=e){let t="",i="";for(let o=0;o0?"Y":"N",null!=e.email&&(t.Email=e.email),null!=e.birthday){const i=e.birthday.split("/");t.DOB=de(i[2]+i[0]+i[1])}return t},dt=(e,t)=>{let{logger:i}=t;const o={};if(null!=e.displayName&&(o.Name=e.displayName),null!=e.id&&(o.GPID=e.id+""),null!=e.gender&&("male"===e.gender?o.Gender="M":"female"===e.gender?o.Gender="F":"other"===e.gender&&(o.Gender="O")),null!=e.image&&!1===e.image.isDefault&&(o.Photo=e.image.url.split("?sz")[0]),null!=e.emails)for(let t=0;t{if(he._isLocalStorageSupported()){if(null==ue.globalProfileMap&&(ue.globalProfileMap=he.readFromLSorCookie(x),null==ue.globalProfileMap&&(ue.globalProfileMap={})),null!=e._custom){const t=e._custom;for(const i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);delete e._custom}for(const i in e)if(e.hasOwnProperty(i)){if(ue.globalProfileMap.hasOwnProperty(i)&&!t)continue;ue.globalProfileMap[i]=e[i]}null!=ue.globalProfileMap._custom&&delete ue.globalProfileMap._custom,he.saveToLSorCookie(x,ue.globalProfileMap)}},ht=(e,t,i)=>{if(null!=e&&"-1"!==e&&he._isLocalStorageSupported()){const t=ot();let o=t.wp[i];null==o&&(o={},t[i]=o),o[e]="dnd",nt(t)}if(null!=ue.campaignDivMap){const t=ue.campaignDivMap[e];null!=t&&(document.getElementById(t).style.display="none","intentPreview"===t&&null!=document.getElementById("intentOpacityDiv")&&(document.getElementById("intentOpacityDiv").style.display="none"))}};var ut=t("logger"),pt=t("request"),gt=t("account"),vt=t("oldValues"),ft=t("isPersonalisationActive"),bt=t("processProfileArray");class mt extends Array{constructor(e,t){let{logger:o,request:n,account:s,isPersonalisationActive:r}=e;super(),Object.defineProperty(this,bt,{value:yt}),Object.defineProperty(this,ut,{writable:!0,value:void 0}),Object.defineProperty(this,pt,{writable:!0,value:void 0}),Object.defineProperty(this,gt,{writable:!0,value:void 0}),Object.defineProperty(this,vt,{writable:!0,value:void 0}),Object.defineProperty(this,ft,{writable:!0,value:void 0}),i(this,ut)[ut]=o,i(this,pt)[pt]=n,i(this,gt)[gt]=s,i(this,vt)[vt]=t,i(this,ft)[ft]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o0)for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];let n,s={};if(null!=o.Site){if(n=o.Site,ee(n)||!at(n,{logger:i(this,ut)[ut]}))return}else if(null!=o.Facebook){const e=o.Facebook;ee(e)||e.error||(n=lt(e))}else if(null!=o["Google Plus"]){const e=o["Google Plus"];ee(e)||e.error||(n=dt(e,{logger:i(this,ut)[ut]}))}if(null!=n&&!ee(n)){s.type="profile",null==n.tz&&(n.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),s.profile=n,ct(n,!0),s=i(this,pt)[pt].addSystemDataToObject(s,void 0),i(this,pt)[pt].addFlags(s);const e=Ze(JSON.stringify(s),i(this,ut)[ut]);let t=i(this,gt)[gt].dataPostURL;t=Ge(t,"type",A),t=Ge(t,"d",e),i(this,pt)[pt].saveAndFireRequest(t,ue.blockRequest)}}},wt=t("request"),Ct=t("logger"),kt=t("account"),xt=t("session"),Pt=t("oldValues"),It=t("device"),St=t("processOUL"),Ot=t("handleCookieFromCache"),_t=t("deleteUser"),Et=t("processLoginArray");class At extends Array{constructor(e,t){let{request:o,account:n,session:s,logger:r,device:a}=e;super(),Object.defineProperty(this,Et,{value:Rt}),Object.defineProperty(this,_t,{value:Tt}),Object.defineProperty(this,Ot,{value:Lt}),Object.defineProperty(this,St,{value:Mt}),Object.defineProperty(this,wt,{writable:!0,value:void 0}),Object.defineProperty(this,Ct,{writable:!0,value:void 0}),Object.defineProperty(this,kt,{writable:!0,value:void 0}),Object.defineProperty(this,xt,{writable:!0,value:void 0}),Object.defineProperty(this,Pt,{writable:!0,value:void 0}),Object.defineProperty(this,It,{writable:!0,value:void 0}),i(this,wt)[wt]=o,i(this,kt)[kt]=n,i(this,xt)[xt]=s,i(this,Ct)[Ct]=r,i(this,Pt)[Pt]=t,i(this,It)[It]=a}clear(){i(this,Ct)[Ct].debug("clear called. Reset flag has been set."),i(this,_t)[_t](),he.setMetaProp(g,!0)}push(){for(var e=arguments.length,t=new Array(e),o=0;o{let o=he.readFromLSorCookie(m);const n=he.readFromLSorCookie(b);let s;if(null==o)o={},s=e;else{s=o.id;let r=!1,a=!1;if(null==s&&(s=e[0],r=!0),null==ue.LRU_CACHE&&he._isLocalStorageSupported()&&(ue.LRU_CACHE=new ve(100)),r)null!=n&&(ue.LRU_CACHE.set(s,n),ue.blockRequest=!1);else for(const t in e)if(e.hasOwnProperty(t)){const i=e[t];if(ue.LRU_CACHE.cache[i]){s=i,a=!0;break}}if(a){s!==ue.LRU_CACHE.getLastKey()?i(this,Ot)[Ot]():(t=!1,he.saveToLSorCookie(D,t));const e=ue.LRU_CACHE.get(s);ue.LRU_CACHE.set(s,e),he.saveToLSorCookie(b,e),i(this,It)[It].gcookie=e;const o=ue.LRU_CACHE.getSecondLastKey();if(he.readFromLSorCookie(D)&&-1!==o){const e=ue.LRU_CACHE.cache[o];i(this,wt)[wt].unregisterTokenForGuid(e)}}else r?null!=n&&(i(this,It)[It].gcookie=n,he.saveToLSorCookie(b,n),t=!1):this.clear(),he.saveToLSorCookie(D,!1),s=e[0]}o.id=s,he.saveToLSorCookie(m,o)};if(Array.isArray(e)&&e.length>0)for(const n in e)if(e.hasOwnProperty(n)){const s=e[n];let r,a={};if(null!=s.Site){if(r=s.Site,ee(r)||!at(r,{logger:i(this,Ct)[Ct]}))return}else if(null!=s.Facebook){const e=s.Facebook;ee(e)||e.error||(r=lt(e))}else if(null!=s["Google Plus"]){const e=s["Google Plus"];ee(e)&&!e.error&&(r=dt(e,{logger:i(this,Ct)[Ct]}))}if(null!=r&&!ee(r)){a.type="profile",null==r.tz&&(r.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),a.profile=r;const e=[];he._isLocalStorageSupported()&&(r.Identity&&e.push(r.Identity),r.Email&&e.push(r.Email),r.GPID&&e.push("GP:"+r.GPID),r.FBID&&e.push("FB:"+r.FBID),e.length>0&&o(e)),ct(r,!0),a=i(this,wt)[wt].addSystemDataToObject(a,void 0),i(this,wt)[wt].addFlags(a),t&&(a.isOUL=!0);const n=Ze(JSON.stringify(a),i(this,Ct)[Ct]);let s=i(this,kt)[kt].dataPostURL;s=Ge(s,"type",A),s=Ge(s,"d",n),i(this,wt)[wt].saveAndFireRequest(s,ue.blockRequest,t)}}},Lt=function(){ue.blockRequest=!1,console.debug("Block request is false"),he._isLocalStorageSupported()&&(delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),he.removeCookie(y,Je()),he.removeCookie(i(this,xt)[xt].cookieName,ue.broadDomain),he.removeCookie(P,ue.broadDomain),i(this,xt)[xt].setSessionCookieObject("")},Tt=function(){ue.blockRequest=!0,i(this,Ct)[Ct].debug("Block request is true"),ue.globalCache={gcookie:null,REQ_N:0,RESP_N:0},he._isLocalStorageSupported()&&(delete localStorage.WZRK_G,delete localStorage.WZRK_K,delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),he.removeCookie(b,ue.broadDomain),he.removeCookie(y,Je()),he.removeCookie(m,Je()),he.removeCookie(i(this,xt)[xt].cookieName,ue.broadDomain),he.removeCookie(P,ue.broadDomain),i(this,It)[It].gcookie=null,i(this,xt)[xt].setSessionCookieObject("")},Rt=function(e){if(Array.isArray(e)&&e.length>0){const t=e.pop();if(null!=t&&Q(t)&&(null!=t.Site&&Object.keys(t.Site).length>0||null!=t.Facebook&&Object.keys(t.Facebook).length>0||null!=t["Google Plus"]&&Object.keys(t["Google Plus"]).length>0)){he.setInstantDeleteFlagInK();try{i(this,St)[St]([t])}catch(e){i(this,Ct)[Ct].debug(e)}}else i(this,Ct)[Ct].error("Profile object is in incorrect format")}};class jt extends HTMLElement{constructor(){super(),this._details=null,this.shadow=null,this.shadow=this.attachShadow({mode:"open"})}get details(){return this._details||""}set details(e){null===this._details&&(this._details=e,this.renderBanner())}renderBanner(){this.shadow.innerHTML=this.getBannerContent(),!1!==this.trackClick&&this.addEventListener("click",(()=>{const e=this.details.onClick;e&&(this.details.window?window.open(e,"_blank"):window.parent.location.href=e),window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId})}getBannerContent(){return'\n \n \n ")}}class Dt extends HTMLElement{constructor(){super(),this._target=null,this._carousel=null,this.shadow=null,this.slides=0,this.previouslySelectedItem=-1,this.selectedItem=1,this.autoSlide=null,this.stopAutoSlideTimeout=null,this.shadow=this.attachShadow({mode:"open"}),void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",jt)}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderCarousel())}get details(){return this.target.display.details}get display(){return this.target.display}renderCarousel(){this.slides=this.details.length,this.shadow.innerHTML=this.getStyles();const e=this.getCarouselContent();this.display.showNavBtns&&e.insertAdjacentHTML("beforeend",this.display.navBtnsHtml),this.display.showNavArrows&&(e.insertAdjacentHTML("beforeend",this.display.leftNavArrowHtml),e.insertAdjacentHTML("beforeend",this.display.rightNavArrowHtml)),this._carousel=e,this.shadow.appendChild(e),this.setupClick(),this.updateSelectedItem(),this.startAutoSlide(),this.setupOnHover(),window.clevertap.renderNotificationViewed({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot})}setupClick(){this._carousel.addEventListener("click",(e=>{const t=e.target.id;if(t.startsWith("carousel__button")){const e=+t.split("-")[1];e!==this.selectedItem&&(this.previouslySelectedItem=this.selectedItem,this.selectedItem=e,this.updateSelectedItem(),this.startAutoSlide())}else if(t.startsWith("carousel__arrow"))t.endsWith("right")?this.goToNext():this.goToPrev(),this.startAutoSlide();else if(t.indexOf("-")>-1){const e=+t.split("-")[1],i=e-1;window.parent.clevertap&&window.clevertap.renderNotificationClicked({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot,wzrk_slideNo:e});const o=this.details[i].onClick;""!==o&&(this.details[i].window?window.open(o,"_blank"):window.location.href=o)}}))}setupOnHover(){this._carousel.addEventListener("mouseenter",(e=>{this.stopAutoSlideTimeout=setTimeout((()=>{this.autoSlide=clearInterval(this.autoSlide)}),500)})),this._carousel.addEventListener("mouseleave",(e=>{clearTimeout(this.stopAutoSlideTimeout),void 0===this.autoSlide&&this.startAutoSlide()}))}getCarouselContent(){const e=document.createElement("div");return e.setAttribute("class","carousel"),this.details.forEach(((t,i)=>{const o=document.createElement("ct-web-personalisation-banner");o.classList.add("carousel__item"),o.trackClick=!1,o.setAttribute("id","carousel__item-".concat(i+1)),o.details=t,e.appendChild(o)})),e}getStyles(){var e,t;return"\n \n ")}updateSelectedItem(){if(-1!==this.previouslySelectedItem){const e=this.shadow.getElementById("carousel__item-".concat(this.previouslySelectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.previouslySelectedItem));e.classList.remove("carousel__item--selected"),t&&t.classList.remove("carousel__button--selected")}const e=this.shadow.getElementById("carousel__item-".concat(this.selectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.selectedItem));e.classList.add("carousel__item--selected"),t&&t.classList.add("carousel__button--selected")}startAutoSlide(){clearInterval(this.autoSlide),this.autoSlide=setInterval((()=>{this.goToNext()}),this.display.sliderTime?1e3*this.display.sliderTime:3e3)}goToNext(){this.goTo(this.selectedItem,(this.selectedItem+1)%this.slides)}goToPrev(){this.goTo(this.selectedItem,this.selectedItem-1)}goTo(e,t){this.previouslySelectedItem=e,this.selectedItem=t,0===t&&(this.selectedItem=this.slides),this.updateSelectedItem()}}class Bt extends HTMLElement{constructor(){super(),this._target=null,this._session=null,this.shadow=null,this.popup=null,this.container=null,this.resizeObserver=null,this.shadow=this.attachShadow({mode:"open"})}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderImageOnlyPopup())}get session(){return this._session||""}set session(e){this._session=e}get msgId(){return this.target.wzrk_id}get pivotId(){return this.target.wzrk_pivot}get onClickUrl(){return this.target.display.onClickUrl}renderImageOnlyPopup(){const e=this.target.wzrk_id.split("_")[0],t=this.session.sessionId;this.shadow.innerHTML=this.getImageOnlyPopupContent(),this.popup=this.shadowRoot.getElementById("imageOnlyPopup"),this.container=this.shadowRoot.getElementById("container"),this.closeIcon=this.shadowRoot.getElementById("close"),this.popup.addEventListener("load",this.updateImageAndContainerWidth()),this.resizeObserver=new ResizeObserver((()=>this.handleResize(this.popup,this.container))),this.resizeObserver.observe(this.popup),this.closeIcon.addEventListener("click",(()=>{if(this.resizeObserver.unobserve(this.popup),document.getElementById("wzrkImageOnlyDiv").style.display="none",this.remove(),null!=e&&"-1"!==e&&he._isLocalStorageSupported()){const i=ot();let o=i.wp[t];null==o&&(o={},i[t]=o),o[e]="dnd",nt(i)}})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId}),this.onClickUrl&&this.popup.addEventListener("click",(()=>{this.target.display.window?window.open(this.onClickUrl,"_blank"):window.parent.location.href=this.onClickUrl,window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})}))}handleResize(e,t){const i=this.getRenderedImageWidth(e);t.style.setProperty("width","".concat(i,"px"))}getImageOnlyPopupContent(){return"\n ".concat(this.target.msgContent.css,"\n ").concat(this.target.msgContent.html,"\n ")}updateImageAndContainerWidth(){return()=>{const e=this.getRenderedImageWidth(this.popup);this.popup.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("height","auto"),this.container.style.setProperty("position","fixed"),this.popup.style.setProperty("visibility","visible"),this.closeIcon.style.setProperty("visibility","visible"),document.getElementById("wzrkImageOnlyDiv").style.visibility="visible"}}getRenderedImageWidth(e){const t=e.naturalWidth/e.naturalHeight;return e.height*t}}class Nt extends HTMLElement{constructor(e,t){super(),this.wrapper=null,this.snackBar=null,this.shadow=this.attachShadow({mode:"open"}),this.config=e,this.message=t,this.renderMessage(t)}get pivotId(){return this.message.wzrk_pivot}get campaignId(){return this.message.wzrk_id}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}renderMessage(e){switch(this.wrapper=this.createEl("div","messageWrapper"),e.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":{const t=this.prepareBasicMessage(e.msg[0]);this.wrapper.appendChild(t)}}const t=this.createEl("div","timeStamp");if(t.innerHTML="".concat(Jt(e.id.split("_")[1]),""),!e.viewed){const e=this.createEl("span","unreadMarker");t.appendChild(e)}this.wrapper.appendChild(t),this.shadow.appendChild(this.wrapper)}prepareBasicMessage(e){const t=this.createEl("div","message");if(e.imageUrl){const i=this.addImage(e.imageUrl,"mainImg");t.appendChild(i)}const i=this.createEl("div","iconTitleDescWrapper");if(e.iconUrl){const t=this.addImage(e.iconUrl,"iconImg");i.appendChild(t)}const o=this.createEl("div","titleDescWrapper");if(e.title){const t=this.createEl("div","title");t.innerText=e.title,o.appendChild(t)}if(e.description){const t=this.createEl("div","description");t.innerText=e.description,o.appendChild(t)}if((e.title||e.description)&&i.appendChild(o),(e.iconUrl||e.title||e.description)&&t.appendChild(i),e.buttons&&e.buttons.length){const i=this.addButtons(e.buttons);t.appendChild(i)}return t}addButtons(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.createEl("div","buttonsContainer");let i=!1;return e.forEach(((e,o)=>{const n=this.createEl("button","button-".concat(o),"button");n.innerText=e.text,o>0&&(n.style.cssText+="margin-left: 2px;"),"copy"===e.action&&(i=!0),t.appendChild(n)})),i&&this.addSnackbar(t),t}addSnackbar(e){this.snackBar=this.createEl("div","snackbar-".concat(this.campaignId),"snackbar"),this.snackBar.innerHTML=Yt;const t=this.createEl("span","snackbar-msg-".concat(this.campaignId),"snackbar-msg");t.innerText="Copied to clipboard",this.snackBar.appendChild(t),e.appendChild(this.snackBar)}addImage(e,t){const i=this.createEl("div","".concat(t,"Container")),o=this.createEl("img",t);return o.setAttribute("src",e),o.setAttribute("loading","lazy"),i.appendChild(o),i}raiseClickedEvent(e,t){switch(this.message.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":this.raiseClickedForBasicTemplates(e,t)}}raiseClickedForBasicTemplates(e,t){const i=this.message.msg[0],o={msgId:this.campaignId,pivotId:this.pivotId};if("BUTTON"===e.tagName){const t=e.id.split("-")[1],n=i.buttons[t];o.kv={wzrk_c2a:n.text},"url"===n.action?n.openUrlInNewTab?window.open(n.url,"_blank"):window.location=n.url:"copy"===n.action&&(window.focus(),navigator.clipboard.writeText(n.clipboardText),this.snackBar.style.setProperty("display","flex","important"),setTimeout((()=>{this.snackBar.style.setProperty("display","none","important")}),2e3))}else"CT-INBOX-MESSAGE"===e.tagName&&i.onClickUrl&&(i.openUrlInNewTab?window.open(i.onClickUrl,"_blank"):window.location=i.onClickUrl);t?console.log("Notifiction clicked event will be raised at run time with payload ::",o):window.clevertap.renderNotificationClicked(o)}}class zt extends HTMLElement{constructor(e){super(),this.isInboxOpen=!1,this.isInboxFromFlutter=!1,this.selectedCategory=null,this.unviewedMessages={},this.unviewedCounter=0,this.isPreview=!1,this.inboxConfigForPreview={},this.inboxSelector=null,this.inbox=null,this.emptyInboxMsg=null,this.inboxCard=null,this.unviewedBadge=null,this.observer=null,this.selectedCategoryRef=null,this.addClickListenerOnDocument=(()=>e=>{if(e.composedPath().includes(this.inbox)){const t=e.path||e.composedPath&&e.composedPath();if(t.length){const e=t[0].id;if("closeInbox"===e)this.toggleInbox();else if(e.startsWith("category-"))this.prevCategoryRef=this.selectedCategoryRef,this.selectedCategoryRef=t[0],this.updateActiveCategory(t[0].innerText);else{const e=t.filter((e=>{var t;return(null===(t=e.id)||void 0===t?void 0:t.startsWith("button-"))||"CT-INBOX-MESSAGE"===e.tagName}));if(e.length){e[e.length-1].raiseClickedEvent(e[0],this.isPreview)}}}}else(this.inboxSelector.contains(e.target)||this.isInboxOpen)&&(this.isInboxFromFlutter?this.isInboxFromFlutter=!1:this.toggleInbox(e))})(),this.setBadgeStyle=e=>{null!==this.unviewedBadge&&(this.unviewedBadge.innerText=e>9?"9+":e,this.unviewedBadge.style.display=e>0?"flex":"none")},this.logger=e,this.shadow=this.attachShadow({mode:"open"})}get incomingMessages(){return[]}set incomingMessages(e){void 0===e&&(e=[]),e.length>0&&this.inbox&&this.updateInboxMessages(e)}get incomingMessagesForPreview(){return[]}set incomingMessagesForPreview(e){void 0===e&&(e=[]);const t={};e.length>0&&this.inbox&&(this.isPreview=!0,this.unviewedCounter=0,e.forEach((e=>{const i="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=i,t[i]=e,this.unviewedMessages[i]=e,this.unviewedCounter++})),this.buildUIForMessages(t),this.updateUnviewedBadgeCounter())}connectedCallback(){this.init()}init(){this.config=this.isPreview?this.inboxConfigForPreview:he.readFromLSorCookie(q)||{},0!==Object.keys(this.config).length&&(this.inboxSelector=document.getElementById(this.config.inboxSelector),null!==this.inboxSelector&&(this.config.styles.notificationsBadge?this.addUnviewedBadge():this.unviewedBadge&&this.unviewedBadge.remove(),this.createinbox(),document.removeEventListener("click",this.addClickListenerOnDocument),document.addEventListener("click",this.addClickListenerOnDocument),this.config.categories.length&&this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadow.innerHTML=this.getInboxStyles(),this.shadow.appendChild(this.inbox)))}addMsgsToInboxFromLS(){const e=this.deleteExpiredAndGetUnexpiredMsgs(!1),t=e?Object.keys(e):[];0!==t.length&&(t.forEach((t=>{e[t].viewed||(this.unviewedMessages[t]=e[t],this.unviewedCounter++)})),this.buildUIForMessages(e),this.updateUnviewedBadgeCounter())}deleteExpiredAndGetUnexpiredMsgs(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Vt();const i=Math.floor(Date.now()/1e3);for(const o in t)if(t[o].wzrk_ttl&&t[o].wzrk_ttl>0&&t[o].wzrk_ttl0&&(t=Object.values(t).sort(((e,t)=>t.date-e.date)).reduce(((e,t)=>(e[t.id]=t,e)),{})),Wt(t),t}updateInboxMessages(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.deleteExpiredAndGetUnexpiredMsgs(),i=Date.now(),o={};e.forEach(((e,n)=>{const s="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=s,e.date=i-n,e.viewed=0,t[s]=e,o[s]=e,this.unviewedMessages[s]=e,this.unviewedCounter++})),Wt(t),this.buildUIForMessages(o),this.updateUnviewedBadgeCounter()}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}addUnviewedBadge(){this.unviewedBadge||(this.unviewedBadge=this.createEl("div","unviewedBadge"),this.unviewedBadge.style.cssText="display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ".concat(this.config.styles.notificationsBadge.backgroundColor,"; font-size: 12px; color: ").concat(this.config.styles.notificationsBadge.textColor,"; font-weight: bold; align-items: center; justify-content: center;"),document.body.appendChild(this.unviewedBadge)),this.updateUnviewedBadgePosition(),window.addEventListener("resize",(()=>{this.updateUnviewedBadgePosition()}))}updateUnviewedBadgePosition(){const{top:e,right:t}=this.inboxSelector.getBoundingClientRect();this.unviewedBadge.style.top="".concat(e-8,"px"),this.unviewedBadge.style.left="".concat(t-8,"px")}createinbox(){this.inbox=this.createEl("div","inbox");const e=this.createEl("div","header"),t=this.createEl("div","headerTitle");t.innerText=this.config.title;const i=this.createEl("div","closeInbox");if(i.innerHTML="×",e.appendChild(t),e.appendChild(i),this.inbox.appendChild(e),this.config.categories.length){const e=this.createCategories();this.inbox.appendChild(e)}this.inboxCard=this.createEl("div","inboxCard"),this.inbox.appendChild(this.inboxCard),this.emptyInboxMsg=this.createEl("div","emptyInboxMsg"),this.emptyInboxMsg.innerText="All messages will be displayed here.",this.inboxCard.appendChild(this.emptyInboxMsg);const o={root:this.inboxCard,rootMargin:"0px",threshold:.5};this.observer=new IntersectionObserver(((e,t)=>{this.handleMessageViewed(e)}),o),this.addMsgsToInboxFromLS()}createCategories(){const e=this.createEl("div","categoriesContainer"),t=this.createEl("div","leftArrow");t.innerHTML=$t,t.children[0].style="transform: rotate(180deg)",t.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(-70,0)})),e.appendChild(t);const i=this.createEl("div","categoriesWrapper");["All",...this.config.categories].forEach(((e,t)=>{const o=this.createEl("div","category-".concat(t),"category");o.innerText=e,0===t&&(this.selectedCategoryRef=o),i.appendChild(o)})),e.appendChild(i);const o=this.createEl("div","rightArrow");o.innerHTML=$t,o.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(70,0)})),e.appendChild(o);const n={root:e,threshold:.9},s=i.children[0],r=i.children[this.config.categories.length];new IntersectionObserver((e=>{this.categoryObserverCb(t,e[0].intersectionRatio>=.9)}),n).observe(s);return new IntersectionObserver((e=>{this.categoryObserverCb(o,e[0].intersectionRatio>=.9)}),n).observe(r),e}categoryObserverCb(e,t){e&&(e.style.display=t?"none":"flex")}updateActiveCategory(e){this.selectedCategory=e,this.inboxCard.scrollTop=0;let t=0;this.prevCategoryRef&&this.prevCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef.setAttribute("selected","true"),this.inboxCard.childNodes.forEach((e=>{"emptyInboxMsg"!==e.getAttribute("id")&&(e.style.display="All"===this.selectedCategory||e.getAttribute("category")===this.selectedCategory?"block":"none","block"===e.style.display&&t++)})),0===t?(this.emptyInboxMsg.innerText="".concat(e," messages will be displayed here."),this.emptyInboxMsg.style.display="block"):this.emptyInboxMsg.style.display="none"}buildUIForMessages(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!this.isPreview&&this.updateTSForRenderedMsgs(),this.inboxCard.scrollTop=0;const i=null!==(e=this.config.maxMsgsInInbox)&&void 0!==e?e:15,o=this.inboxCard.firstChild,n=Object.values(t).sort(((e,t)=>t.date-e.date)).map((e=>e.id));for(const e of n){const i=new Nt(this.config,t[e]);i.setAttribute("id",t[e].id),i.setAttribute("pivot",t[e].wzrk_pivot),i.setAttribute("part","ct-inbox-message"),this.config.categories.length>0?(i.setAttribute("category",t[e].tags[0]||""),i.style.display="All"===this.selectedCategory||t[e].category===this.selectedCategory?"block":"none"):i.style.display="block",this.inboxCard.insertBefore(i,o),this.observer.observe(i)}let s=this.inboxCard.querySelectorAll("ct-inbox-message").length;for(;s>i;){const e=this.inboxCard.querySelectorAll("ct-inbox-message");e.length>0&&e[e.length-1].remove(),s--}const r=this.inboxCard.querySelectorAll('ct-inbox-message[style*="display: block"]').length;this.emptyInboxMsg.style.display=r?"none":"block"}handleMessageViewed(e){const t=!this.isPreview;this.isInboxOpen&&e.forEach((e=>{e.isIntersecting&&this.unviewedMessages.hasOwnProperty(e.target.id)&&0===e.target.message.viewed&&(e.target.message.viewed=1,t?(window.clevertap.renderNotificationViewed({msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.updateMessageInLS(e.target.id,{...e.target.message,viewed:1}),setTimeout((()=>{e.target.shadowRoot.getElementById("unreadMarker").style.display="none"}),1e3)):console.log("Notifiction viewed event will be raised at run time with payload ::",{msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.unviewedCounter--,this.updateUnviewedBadgeCounter(),delete this.unviewedMessages[e.target.id])}))}updateMessageInLS(e,t){if(!this.isPreview){const i=Vt();i[e]=t,Wt(i)}}toggleInbox(e){this.isInboxOpen=!this.isInboxOpen,this.isInboxFromFlutter=!!(null==e?void 0:e.rect),this.isInboxOpen?(this.inboxCard.scrollTop=0,!this.isPreview&&this.deleteExpiredAndGetUnexpiredMsgs(),this.inbox.style.display="block",this.inbox.style.zIndex="2147483647",this.config.categories.length&&(this.selectedCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef=this.shadowRoot.getElementById("category-0"),this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadowRoot.getElementById("categoriesWrapper").scrollLeft-=this.shadowRoot.getElementById("categoriesWrapper").scrollWidth),this.setInboxPosition(e)):this.inbox.style.display="none"}setInboxPosition(e){const t=window.outerWidth,i=getComputedStyle(ue.inbox),o=i.getPropertyValue("--inbox-top"),n=i.getPropertyValue("--inbox-bottom"),s=i.getPropertyValue("--inbox-left"),r=i.getPropertyValue("--inbox-right");if(t>481&&!(o||n||s||r)){const t=Gt(e,this.inbox.clientHeight,this.inbox.clientWidth),i=t.xPos,o=t.yPos;this.inbox.style.top=o+"px",this.inbox.style.left=i+"px"}}updateUnviewedBadgeCounter(){if(this.isPreview)return void this.setBadgeStyle(this.unviewedCounter);let e=0;this.inboxCard.querySelectorAll("ct-inbox-message").forEach((t=>{const i=Vt();i[t.id]&&0===i[t.id].viewed&&e++})),this.setBadgeStyle(e)}updateTSForRenderedMsgs(){this.inboxCard.querySelectorAll("ct-inbox-message").forEach((e=>{const t=e.id.split("_")[1];e.shadow.getElementById("timeStamp").firstChild.innerText=Jt(t)}))}getInboxStyles(){const e=this.config.categories.length?64:16,t={panelBackgroundColor:this.config.styles.panelBackgroundColor,panelBorderColor:this.config.styles.panelBorderColor,headerBackgroundColor:this.config.styles.header.backgroundColor,headerTitleColor:this.config.styles.header.titleColor,closeIconColor:this.config.styles.closeIconColor,categoriesTabColor:this.config.styles.categories.tabColor,categoriesTitleColor:this.config.styles.categories.titleColor,selectedCategoryTabColor:this.config.styles.categories.selectedTab.tabColor,selectedCategoryTitleColor:this.config.styles.categories.selectedTab.titleColor,headerCategoryHeight:36+e};this.config.styles.categories.borderColor&&(t.categoriesBorderColor=this.config.styles.categories.borderColor),this.config.styles.categories.selectedTab.borderColor&&(t.selectedCategoryBorderColor=this.config.styles.categories.selectedTab.borderColor);const i=(e=>{let{panelBackgroundColor:t,panelBorderColor:i,headerBackgroundColor:o,headerTitleColor:n,closeIconColor:s,categoriesTabColor:r,categoriesTitleColor:a,categoriesBorderColor:l,selectedCategoryTabColor:d,selectedCategoryTitleColor:c,selectedCategoryBorderColor:h,headerCategoryHeight:u}=e;return'\n \n ")})(t),o=this.config.styles.cards;return i+(e=>{let{backgroundColor:t,borderColor:i,titleColor:o,descriptionColor:n,buttonColor:s,buttonTextColor:r,unreadMarkerColor:a}=e;return'\n \n ")})({backgroundColor:o.backgroundColor,borderColor:o.borderColor,titleColor:o.titleColor,descriptionColor:o.descriptionColor,buttonColor:o.buttonColor,buttonTextColor:o.buttonTextColor,unreadMarkerColor:o.unreadMarkerColor})}}const Ut=e=>{e.inbox_preview?ue.inbox.incomingMessagesForPreview=e.inbox_notifs:ue.inbox.incomingMessages=e},Ft=e=>{Ht(),ue.inbox=new zt({logger:e}),document.body.appendChild(ue.inbox)},qt=e=>{const t=he.readFromLSorCookie(V)||{};if(Object.keys(t).length>0&&Object.keys(t)[0].includes("_")){const i={};return i[e]=t,he.saveToLSorCookie(V,i),i}return t},Vt=()=>{const e=JSON.parse(decodeURIComponent(he.read(b)));if(!oe(e))return{};const t=qt(e);return t.hasOwnProperty(e)?t[e]:{}},Wt=e=>{const t=JSON.parse(decodeURIComponent(he.read(b)));if(!oe(t))return;const i={...qt(t),[t]:e};he.saveToLSorCookie(V,i)},Kt=e=>new Promise(((t,i)=>{if("complete"===document.readyState)Ft(e),t();else{const i=he.readFromLSorCookie(q)||{},o=()=>{null===ue.inbox&&Ft(e),t()};window.addEventListener("load",(()=>{if(document.getElementById(i.inboxSelector))o();else{let n=0;if(n<20){const s=setInterval((()=>{document.getElementById(i.inboxSelector)?(o(),clearInterval(s),t()):n>=20&&(clearInterval(s),e.debug("Failed to add inbox")),n++}),500)}}}))}})),Ht=()=>{void 0===customElements.get("ct-web-inbox")&&(customElements.define("ct-web-inbox",zt),customElements.define("ct-inbox-message",Nt))},Gt=(e,t,i)=>{const o=document.scrollingElement.scrollLeft,n=document.scrollingElement.scrollTop,s=window.innerWidth+o,r=window.innerHeight+n,a=e.rect||e.target.getBoundingClientRect(),l=a.x+o,d=a.y+n,c=a.left+o,h=a.right+o,u=a.top+n,p=a.bottom,g=a.height,v=a.width;let f,b,m=!1;const y=16;if(p+t<=r){const e=r-(p+t);b=e>=y?p+y:p+e}else if(u-t>=n){const e=u-t;b=e>=y?u-t-y:u-t-e}else m=!0,b=d+g/2-t/2,br&&(b=r-t);if(m){const e=h+i;if(e<=s){f=h+(e+y<=s?y:s-e)}else{const e=c-i;f=e-(e-y>=o?y:e-o)}}else f=l+v/2-i/2,fs&&(f=h-i>=o?h-i:s-i);return{xPos:f,yPos:b}},Jt=e=>{const t=Date.now();let i=Math.floor((t-e)/6e4);return i<5?"Just now":i<60?"".concat(i," minute").concat(i>1?"s":""," ago"):(i=Math.floor(i/60),i<24?"".concat(i," hour").concat(i>1?"s":""," ago"):(i=Math.floor(i/24),"".concat(i," day").concat(i>1?"s":""," ago")))},Zt=()=>Object.keys(he.readFromLSorCookie(q)||{}).length>0,$t='\n\n\n',Yt='\n\n\n',Qt="https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js",Xt="https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css",ei=(e,t,i)=>{document.addEventListener("DOMContentLoaded",(()=>function(e,t,i){document.body.innerHTML="",ti=document.createElement("div"),ti.id="overlayDiv",ti.style.position="relative",ti.style.display="flex",document.body.appendChild(ti);(function(e,t,i,o){return new Promise(((n,s)=>{var r=document.createElement("script");r.type="module",r.src=e,r.onload=function(){"function"==typeof window.Overlay?(window.Overlay({id:"#overlayDiv",url:t,variant:i,details:o}),n()):s(new Error("ContentLayout not found in overlay.js"))},r.onerror=function(e){s(e)},document.head.appendChild(r)}))})(Qt,e,t,i).then((()=>{console.log("Overlay script loaded successfully.")})).catch((e=>{console.error("Error loading overlay script:",e)})),o=document.createElement("link"),o.rel="stylesheet",o.type="text/css",o.href=Xt,document.head.appendChild(o),function(){const e={kitId:"eqj6nom",scriptTimeout:3e3,async:!0},t=document.documentElement,i=setTimeout((function(){t.className=t.className.replace(/\bwf-loading\b/g,"")+" wf-inactive"}),e.scriptTimeout),o=document.createElement("script");let n=!1;const s=document.getElementsByTagName("script")[0];let r;t.className+=" wf-loading",o.src="https://use.typekit.net/"+e.kitId+".js",o.async=!0,o.onload=o.onreadystatechange=function(){if(r=this.readyState,!(n||r&&"complete"!==r&&"loaded"!==r)){n=!0,clearTimeout(i);try{Typekit.load(e)}catch(e){}}},s.parentNode.insertBefore(o,s)}();var o}(e,t,i)))};let ti;const ii=(e,t)=>{const i=t?e.details[0]:e.display.details[0],o=Object.keys(i)[0],n=i[o];if(o===window.location.href.split("?")[0])for(const i in n){const o=document.querySelector(i);if(o)n[i].html?o.outerHTML=n[i].html:oi(e,n[i]),t||window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot});else{let o=0;const s=setInterval((()=>{const r=document.querySelector(i);r?(n[i].html?r.outerHTML=n[i].html:oi(e,n[i]),t||window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot}),clearInterval(s)):(o++,o>=20&&(console.log("No element present on DOM with selector '".concat(i,"'.")),clearInterval(s)))}),500)}}};function oi(e,t){const i={};i.msgId=e.wzrk_id,e.wzrk_pivot&&(i.pivotId=e.wzrk_pivot),null!=t.json&&(i.json=t.json);const o=new CustomEvent("CT_web_native_display_buider",{detail:i});document.dispatchEvent(o)}const ni=e=>{const t=e.indexOf("\n `\n return html.replace(/(<\\s*\\/\\s*body)/, `${script}\\n$1`)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n const displayObj = targetingMsgJson.display\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = WIZ_IFRAME_INTENT\n let html = targetingMsgJson.msgContent.html\n if (displayObj['custom-editor'] && !displayObj['bee-editor'] && displayObj['custom-html-sandbox']) { // sandbox the iframe only for custom html\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox allow-forms' // allow popup to open url in new page\n html = ctEventhandler(html)\n }\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (targetingMsgJson.display['custom-editor'] && !targetingMsgJson.display['bee-editor'] && targetingMsgJson.display['custom-html-sandbox']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n let contentDiv\n iframe.onload = () => {\n if (targetingMsgJson.display['custom-editor'] && !targetingMsgJson.display['bee-editor'] && targetingMsgJson.display['custom-html-sandbox']) {\n window.addEventListener('message', event => {\n switch (event?.data?.action) {\n case GET_NOTIFICATION_DATA:\n window.clevertap.renderNotificationClicked(event.data.value)\n break\n case EVENT:\n window.clevertap.event.push(event.data.value)\n break\n case PROFILE:\n window.clevertap.profile.push(event.data.value)\n break\n case OUL:\n window.clevertap.onUserLogin.push(event.data.value)\n break\n case CLOSE_INTERSTITIAL_POPUP:\n setTimeout(() => {\n const interstitialWrapper = window.document.getElementById('intentPreview')\n const interstitialOverlay = window.document.getElementById('intentOpacityDiv')\n interstitialOverlay && interstitialOverlay.remove()\n interstitialWrapper && interstitialWrapper.remove()\n }, 0)\n break\n default:\n // Handle unknown action\n break\n }\n })\n contentDiv = ''\n } else {\n contentDiv = document.getElementById(WIZ_IFRAME_INTENT).contentDocument.getElementById('contentDiv')\n }\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n this.#logger.error('Error subscribing: ' + error)\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { handleMessageEvent } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token) {\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n this.#checkBuilder()\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n #checkBuilder () {\n const search = window.location.search\n const parentWindow = window.opener\n\n if (search === '?ctBuilder') {\n // open in visual builder mode\n this.#logger.debug('open in visual builder mode')\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('builder', '*')\n }\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('preview', '*')\n }\n }\n }\n\n pageChanged () {\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","constructor","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","dataPostPEURL","dataPostURL","recorderURL","emailURL","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","WIZ_IFRAME","WIZ_IFRAME_INTENT","ADJUST_IFRAME_HEIGHT","UPDATE_HEIGHT","GET_NOTIFICATION","EVENT","PROFILE","OUL","CLOSE_BOX_POPUP","CLOSE_BANNER_POPUP","GET_NOTIFICATION_DATA","CLOSE_INTERSTITIAL_POPUP","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","save","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","read","data","getItem","parse","e","remove","removeItem","removeCookie","name","domain","cookieStr","document","cookie","createCookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","readCookie","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","saveToLSorCookie","property","location","hostname","$ct","globalCache","readFromLSorCookie","trim","err","createBroadCookie","broadDomain","domainParts","testBroadDomain","testCookieName","tempCookie","getMetaProp","metaObj","setMetaProp","wzrkMetaObj","getAndClearMetaProp","setInstantDeleteFlagInK","k","flag","backupEvent","reqNo","backupArr","q","debug","removeBackup","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","get","item","saveCacheToLS","set","allKeys","objToArray","index","temp","getKey","getSecondLastKey","keysArr","getLastKey","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","s","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","sessionObj","getSessionCookieObject","kIdFromLS","guidFromLRUCache","lastK","lastGUID","unregisterTokenForGuid","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","_processOldValues","getDetails","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","fireRequest","skipARP","sendOULFlag","getDelayFrequency","account","randomDelay","random","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","ProfileHandler","profilesArr","getAttribute","propName","_handleIncrementDecrementValue","command","tz","profile","addSystemDataToObject","addFlags","compressedData","saveAndFireRequest","_handleMultiValueSet","arrayVal","array","toLowerCase","sendMultiValueData","_handleMultiValueAdd","propKey","propVal","_handleMultiValueRemove","_handleMultiValueDelete","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","clear","addToK","ids","g","kId","anonymousUser","foundInCache","gFromCache","Identity","cookieName","loginArr","pop","processProfile","CTWebPersonalisationBanner","HTMLElement","_details","shadow","attachShadow","mode","details","renderBanner","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","target","renderCarousel","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","button","setInterval","sliderTime","goTo","prev","cur","CTWebPopupImageOnly","_session","popup","container","resizeObserver","renderImageOnlyPopup","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","Message","config","message","wrapper","snackBar","renderMessage","createEl","part","_el","msg","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","raiseClickedEvent","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","contains","setBadgeStyle","msgCount","incomingMessages","msgs","updateInboxMessages","incomingMessagesForPreview","previewMsgs","now","buildUIForMessages","updateUnviewedBadgeCounter","connectedCallback","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","addMsgsToInboxFromLS","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","deleteMsgsFromUI","getInboxMessages","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","top","right","getBoundingClientRect","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","inbox_notifs","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","OVERLAY_PATH","CSS_PATH","handleMessageEvent","initialiseCTBuilder","variant","renderVisualBuilder","onContentLoad","position","overlayPath","loadOverlayScript","then","catch","loadCSS","loadTypeKit","link","rel","head","script","src","onload","Overlay","Error","onerror","kitId","scriptTimeout","docElement","documentElement","timeoutId","className","typeKitScript","scriptLoaded","firstScript","scriptReadyState","onreadystatechange","Typekit","load","targetingMsgJson","siteUrl","selectors","selector","element","querySelector","outerHTML","dispatchJsonData","intervalId","retryElement","inaObj","json","kvPairsEvent","CustomEvent","dispatchEvent","ctEventhandler","ctScript","insertPosition","join","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","onclick","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","sandbox","pointerCss","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","closeCampaign","Event","appendScriptForCustomEvent","srcdoc","handleMessage","heightAdjust","boxWrapper","bannerWrapper","margin","onUserLogin","handleIframeLoad","contentWindow","postMessage","contentDocument","scrollHeight","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","interstitialWrapper","interstitialOverlay","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","getTotalVisits","visitCount","getLastVisit","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","info","debugPE","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","getTimeElapsed","sessionStart","getPageCount","seqNo","requestTime","RequestManager","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","post","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","_enableWebPush","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","skipDialog","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","getValue","getdefaultValue","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","addValueChangedCallback","removeValueChangedCallback","clearStartFlag","VariableStore","syncVariables","onSyncSuccess","onSyncFailure","meta","tk","r","status","fetchVariables","onFetchCallback","addVariablesChangedCallback","callback","addOneTimeVariablesChangedCallback","removeVariablesChangedCallback","removeOneTimeVariablesChangedCallback","callBack","CleverTap","spa","isSpa","bind","enablePersonalization","_isPersonalisationActive","ReqestManager","privacy","notifications","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","handleDecrementValue","setMultiValuesForKey","addMultiValueForKey","addMultiValuesForKey","removeMultiValueForKey","removeMultiValuesForKey","removeValueForKey","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","sendLocationData","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","elements","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","setOffline","arg","defineVariable","timeout","debouncedPageChanged","parentWindow","opener","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;EAAO,MAAMA,aAAa,GAAG,oBAAtB;EACA,MAAMC,eAAe,GAAG,QAAxB;EACA,MAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;ECAQ,MAAMC,OAAN,CAAc;EAO3BC,EAAAA,WAAW,GAAsE;EAAA,QAApE;EAAEC,MAAAA;EAAF,KAAoE,uEAA3D,EAA2D;EAAA,QAAvDC,MAAuD,uEAA9C,EAA8C;EAAA,QAA1CC,YAA0C,uEAA3BP,aAA2B;EAAA,QAAZQ,KAAY,uEAAJ,EAAI;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,aALvE;EAKuE;EAAA;EAAA;EAAA,aAJjER;EAIiE;EAAA;EAAA;EAAA,aAHjE;EAGiE;EAAA;EAAA;EAAA,aAFxE;EAEwE;EAC/E,SAAKK,EAAL,GAAUA,EAAV;;EACA,QAAIC,MAAJ,EAA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AAuB,IAAvB,wBAA/B,CAAtB;;EAEA,4DAAcwX,kBAAd,CAAiCnI,WAAjC,EAA8CpN,GAAG,CAACgC,YAAlD;EACD;;yDAEoB;EACnB,SAAQ,OAAOrC,MAAM,CAACqrC,MAAd,KAAyB,WAAzB,IAAwCrrC,MAAM,CAACqrC,MAAP,CAAcC,IAAd,KAAuB,YAAvE;EACD;;yDAMmBltC,MAAM;EACxB,MAAI,KAAKqmC,wBAAL,EAAJ,EAAqC;EACnCrmC,IAAAA,IAAI,CAAC++B,KAAL,GAAa,IAAb;EACD;EACF;;QCnxBGrvB,SAAS,GAAG,IAAIy9B,SAAJ,CAAcvrC,MAAM,CAAC8N,SAArB;EAElB9N,MAAM,CAAC8N,SAAP,GAAmB9N,MAAM,CAAC+N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/modules/visualBuilder/builder_constants.js","src/modules/visualBuilder/pageBuilder.js","src/util/clevertap-handler.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/notification.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\nexport const WIZ_IFRAME = 'wiz-iframe'\nexport const WIZ_IFRAME_INTENT = 'wiz-iframe-intent'\nexport const ADJUST_IFRAME_HEIGHT = 'adjustIFrameHeight'\nexport const UPDATE_HEIGHT = 'update height'\nexport const GET_NOTIFICATION = 'getnotif'\nexport const EVENT = 'Event'\nexport const PROFILE = 'Profile'\nexport const OUL = 'OUL'\nexport const CLOSE_BOX_POPUP = 'closeBoxPopUp'\nexport const CLOSE_BANNER_POPUP = 'closeBannerPopUp'\nexport const GET_NOTIFICATION_DATA = 'getnotifData'\nexport const CLOSE_INTERSTITIAL_POPUP = 'closeInterstitialPopUp'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {}\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n // Initialize array\n var array = []\n\n // Check if globalProfileMap is null, initialize if needed\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n // Check if the value to be set is either string or number\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = $ct.globalProfileMap[propKey]\n array.push(typeof propVal === 'number' ? propVal : propVal.toLowerCase())\n } else {\n $ct.globalProfileMap[propKey] = propVal\n }\n } else {\n // Check if propVal is an array\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = Array.isArray($ct.globalProfileMap[propKey]) ? $ct.globalProfileMap[propKey] : [$ct.globalProfileMap[propKey]]\n }\n\n // Check for case-sensitive inputs and filter the same ones\n for (var i = 0; i < propVal.length; i++) {\n if (typeof propVal[i] === 'number' && !array.includes(propVal[i])) {\n array.push(propVal[i])\n } else if (typeof propVal[i] === 'string' && !array.includes(propVal[i].toLowerCase())) {\n array.push(propVal[i].toLowerCase())\n } else if ((typeof propVal[i] === 'number' && array.includes(propVal[i])) || (typeof propVal[i] === 'string' && array.includes(propVal[i].toLowerCase()))) {\n console.error('Values already included')\n } else {\n console.error('Array supports only string or number type values')\n }\n }\n\n // Update globalProfileMap with the array\n $ct.globalProfileMap[propKey] = array\n }\n\n // Save to local storage or cookie\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Call the sendMultiValueData function\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n var index = $ct.globalProfileMap[propKey].indexOf(propVal)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n } else {\n for (var k = 0; k < propVal.length; k++) {\n var idx = $ct.globalProfileMap[propKey].indexOf(propVal[k])\n if (idx !== -1) {\n $ct.globalProfileMap[propKey].splice(idx, 1)\n }\n }\n }\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n // console.log('Raise notification clicked event for ', item)\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","export const OVERLAY_PATH = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js'\nexport const CSS_PATH = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css'\n","import { CSS_PATH, OVERLAY_PATH } from './builder_constants'\n\nexport const checkBuilder = (logger) => {\n const search = window.location.search\n const parentWindow = window.opener\n\n if (search === '?ctBuilder') {\n // open in visual builder mode\n logger.debug('open in visual builder mode')\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('builder', '*')\n }\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('preview', '*')\n }\n }\n}\n\nconst handleMessageEvent = (event) => {\n if (event.data && event.data.message) {\n if (event.data.message === 'Dashboard' && event.data.url) {\n initialiseCTBuilder(event.data.url, event.data.variant ?? null, event.data.details ?? {})\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n }\n}\n/**\n * Initializes the Clevertap builder.\n * @param {string} url - The URL to initialize the builder.\n * @param {string} variant - The variant of the builder.\n * @param {Object} details - The details object.\n */\nconst initialiseCTBuilder = (url, variant, details) => {\n document.addEventListener('DOMContentLoaded', () => onContentLoad(url, variant, details))\n}\n\nlet container\n/**\n * Handles content load for Clevertap builder.\n */\nfunction onContentLoad (url, variant, details) {\n document.body.innerHTML = ''\n container = document.createElement('div')\n container.id = 'overlayDiv'\n container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form\n container.style.display = 'flex'\n document.body.appendChild(container)\n const overlayPath = OVERLAY_PATH\n loadOverlayScript(overlayPath, url, variant, details)\n .then(() => {\n console.log('Overlay script loaded successfully.')\n })\n .catch((error) => {\n console.error('Error loading overlay script:', error)\n })\n loadCSS()\n loadTypeKit()\n}\n\n/**\n * Loads CSS file.\n */\nfunction loadCSS () {\n var link = document.createElement('link')\n link.rel = 'stylesheet'\n link.type = 'text/css'\n link.href = CSS_PATH\n document.head.appendChild(link)\n}\n\n/**\n * Loads the overlay script.\n * @param {string} overlayPath - The path to overlay script.\n * @param {string} url - The URL.\n * @param {string} variant - The variant.\n * @param {Object} details - The details object.\n * @returns {Promise} A promise.\n */\nfunction loadOverlayScript (overlayPath, url, variant, details) {\n return new Promise((resolve, reject) => {\n var script = document.createElement('script')\n script.type = 'module'\n script.src = overlayPath\n script.onload = function () {\n if (typeof window.Overlay === 'function') {\n window.Overlay({ id: '#overlayDiv', url, variant, details })\n resolve()\n } else {\n reject(new Error('ContentLayout not found in overlay.js'))\n }\n }\n script.onerror = function (error) {\n reject(error)\n }\n document.head.appendChild(script)\n })\n}\n\n/**\n * Loads TypeKit script.\n */\nfunction loadTypeKit () {\n const config = {\n kitId: 'eqj6nom',\n scriptTimeout: 3000,\n async: true\n }\n\n const docElement = document.documentElement\n const timeoutId = setTimeout(function () {\n docElement.className = docElement.className.replace(/\\bwf-loading\\b/g, '') + ' wf-inactive'\n }, config.scriptTimeout)\n const typeKitScript = document.createElement('script')\n let scriptLoaded = false\n const firstScript = document.getElementsByTagName('script')[0]\n let scriptReadyState\n\n docElement.className += ' wf-loading'\n typeKitScript.src = 'https://use.typekit.net/' + config.kitId + '.js'\n typeKitScript.async = true\n typeKitScript.onload = typeKitScript.onreadystatechange = function () {\n scriptReadyState = this.readyState\n if (scriptLoaded || (scriptReadyState && scriptReadyState !== 'complete' && scriptReadyState !== 'loaded')) return\n scriptLoaded = true\n clearTimeout(timeoutId)\n try {\n // eslint-disable-next-line no-undef\n Typekit.load(config)\n } catch (e) {}\n }\n\n firstScript.parentNode.insertBefore(typeKitScript, firstScript)\n}\n\n/**\n * Renders the visual builder.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {boolean} isPreview - Indicates if it's a preview.\n */\nexport const renderVisualBuilder = (targetingMsgJson, isPreview) => {\n const details = isPreview ? targetingMsgJson.details[0] : targetingMsgJson.display.details[0]\n const siteUrl = Object.keys(details)[0]\n const selectors = details[siteUrl]\n\n if (siteUrl === window.location.href.split('?')[0]) {\n for (const selector in selectors) {\n const element = document.querySelector(selector)\n if (element) {\n if (selectors[selector].html) {\n element.outerHTML = selectors[selector].html\n } else {\n // Update json data\n dispatchJsonData(targetingMsgJson, selectors[selector])\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n } else {\n let count = 0\n const intervalId = setInterval(() => {\n const retryElement = document.querySelector(selector)\n if (retryElement) {\n if (selectors[selector].html) {\n retryElement.outerHTML = selectors[selector].html\n } else {\n // Update json data\n dispatchJsonData(targetingMsgJson, selectors[selector])\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n clearInterval(intervalId)\n } else {\n count++\n if (count >= 20) {\n console.log(`No element present on DOM with selector '${selector}'.`)\n clearInterval(intervalId)\n }\n }\n }, 500)\n }\n }\n }\n}\n\n/**\n * Dispatches JSON data.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {Object} selector - The selector object.\n */\nfunction dispatchJsonData (targetingMsgJson, selector) {\n const inaObj = {}\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (selector.json != null) {\n inaObj.json = selector.json\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display_buider', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n}\n","// clevertap-handler.js\n\nconst ctEventhandler = (html) => {\n const ctScript = `\n var clevertap = {\n event: {\n push: (eventName) => {\n window.parent.postMessage({\n action: 'Event',\n value: eventName\n },'*');\n }\n },\n profile: {\n push: (eventName) => {\n window.parent.postMessage({\n action: 'Profile',\n value: eventName\n },'*');\n }\n },\n onUserLogin: {\n push: (eventName) => {\n window.parent.postMessage({\n action: 'OUL',\n value: eventName\n },'*');\n }\n },\n closeBoxPopUp: () => {\n window.parent.postMessage({\n action: 'closeBoxPopUp',\n value: 'closeBoxPopUp'\n },'*');\n },\n closeBannerPopUp: () => {\n window.parent.postMessage({\n action: 'closeBannerPopUp',\n value: 'closeBannerPopUp'\n },'*');\n },\n closeInterstitialPopUp: () => {\n window.parent.postMessage({\n action: 'closeInterstitialPopUp',\n value: 'closeInterstitialPopUp'\n },'*');\n }\n }\n `\n const insertPosition = html.indexOf('\n `\n return html.replace(/(<\\s*\\/\\s*body)/, `${script}\\n$1`)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n const displayObj = targetingMsgJson.display\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = WIZ_IFRAME_INTENT\n let html = targetingMsgJson.msgContent.html\n if (displayObj['custom-editor'] && !displayObj['bee-editor'] && displayObj['custom-html-sandbox']) { // sandbox the iframe only for custom html\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox allow-forms' // allow popup to open url in new page\n html = ctEventhandler(html)\n }\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (targetingMsgJson.display['custom-editor'] && !targetingMsgJson.display['bee-editor'] && targetingMsgJson.display['custom-html-sandbox']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n let contentDiv\n iframe.onload = () => {\n if (targetingMsgJson.display['custom-editor'] && !targetingMsgJson.display['bee-editor'] && targetingMsgJson.display['custom-html-sandbox']) {\n window.addEventListener('message', event => {\n switch (event?.data?.action) {\n case GET_NOTIFICATION_DATA:\n window.clevertap.renderNotificationClicked(event.data.value)\n break\n case EVENT:\n window.clevertap.event.push(event.data.value)\n break\n case PROFILE:\n window.clevertap.profile.push(event.data.value)\n break\n case OUL:\n window.clevertap.onUserLogin.push(event.data.value)\n break\n case CLOSE_INTERSTITIAL_POPUP:\n setTimeout(() => {\n const interstitialWrapper = window.document.getElementById('intentPreview')\n const interstitialOverlay = window.document.getElementById('intentOpacityDiv')\n interstitialOverlay && interstitialOverlay.remove()\n interstitialWrapper && interstitialWrapper.remove()\n }, 0)\n break\n default:\n // Handle unknown action\n break\n }\n })\n contentDiv = ''\n } else {\n contentDiv = document.getElementById(WIZ_IFRAME_INTENT).contentDocument.getElementById('contentDiv')\n }\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n this.#logger.error('Error subscribing: ' + error)\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { checkBuilder } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token) {\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n checkBuilder(this.#logger)\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n pageChanged () {\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","constructor","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","dataPostPEURL","dataPostURL","recorderURL","emailURL","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","WIZ_IFRAME","WIZ_IFRAME_INTENT","ADJUST_IFRAME_HEIGHT","UPDATE_HEIGHT","GET_NOTIFICATION","EVENT","PROFILE","OUL","CLOSE_BOX_POPUP","CLOSE_BANNER_POPUP","GET_NOTIFICATION_DATA","CLOSE_INTERSTITIAL_POPUP","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","save","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","read","data","getItem","parse","e","remove","removeItem","removeCookie","name","domain","cookieStr","document","cookie","createCookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","readCookie","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","saveToLSorCookie","property","location","hostname","$ct","globalCache","readFromLSorCookie","trim","err","createBroadCookie","broadDomain","domainParts","testBroadDomain","testCookieName","tempCookie","getMetaProp","metaObj","setMetaProp","wzrkMetaObj","getAndClearMetaProp","setInstantDeleteFlagInK","k","flag","backupEvent","reqNo","backupArr","q","debug","removeBackup","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","get","item","saveCacheToLS","set","allKeys","objToArray","index","temp","getKey","getSecondLastKey","keysArr","getLastKey","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","s","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","sessionObj","getSessionCookieObject","kIdFromLS","guidFromLRUCache","lastK","lastGUID","unregisterTokenForGuid","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","_processOldValues","getDetails","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","fireRequest","skipARP","sendOULFlag","getDelayFrequency","account","randomDelay","random","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","ProfileHandler","profilesArr","getAttribute","propName","_handleIncrementDecrementValue","command","tz","profile","addSystemDataToObject","addFlags","compressedData","saveAndFireRequest","_handleMultiValueSet","arrayVal","array","toLowerCase","sendMultiValueData","_handleMultiValueAdd","propKey","propVal","_handleMultiValueRemove","_handleMultiValueDelete","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","clear","addToK","ids","g","kId","anonymousUser","foundInCache","gFromCache","Identity","cookieName","loginArr","pop","processProfile","CTWebPersonalisationBanner","HTMLElement","_details","shadow","attachShadow","mode","details","renderBanner","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","target","renderCarousel","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","button","setInterval","sliderTime","goTo","prev","cur","CTWebPopupImageOnly","_session","popup","container","resizeObserver","renderImageOnlyPopup","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","Message","config","message","wrapper","snackBar","renderMessage","createEl","part","_el","msg","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","raiseClickedEvent","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","contains","setBadgeStyle","msgCount","incomingMessages","msgs","updateInboxMessages","incomingMessagesForPreview","previewMsgs","now","buildUIForMessages","updateUnviewedBadgeCounter","connectedCallback","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","addMsgsToInboxFromLS","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","deleteMsgsFromUI","getInboxMessages","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","top","right","getBoundingClientRect","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","inbox_notifs","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","OVERLAY_PATH","CSS_PATH","checkBuilder","parentWindow","opener","handleMessageEvent","postMessage","initialiseCTBuilder","variant","renderVisualBuilder","onContentLoad","position","overlayPath","loadOverlayScript","then","catch","loadCSS","loadTypeKit","link","rel","head","script","src","onload","Overlay","Error","onerror","kitId","scriptTimeout","docElement","documentElement","timeoutId","className","typeKitScript","scriptLoaded","firstScript","scriptReadyState","onreadystatechange","Typekit","load","targetingMsgJson","siteUrl","selectors","selector","element","querySelector","outerHTML","dispatchJsonData","intervalId","retryElement","inaObj","json","kvPairsEvent","CustomEvent","dispatchEvent","ctEventhandler","ctScript","insertPosition","join","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","onclick","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","sandbox","pointerCss","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","closeCampaign","Event","appendScriptForCustomEvent","srcdoc","handleMessage","heightAdjust","boxWrapper","bannerWrapper","margin","onUserLogin","handleIframeLoad","contentWindow","contentDocument","scrollHeight","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","interstitialWrapper","interstitialOverlay","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","getTotalVisits","visitCount","getLastVisit","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","info","debugPE","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","getTimeElapsed","sessionStart","getPageCount","seqNo","requestTime","RequestManager","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","post","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","_enableWebPush","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","skipDialog","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","getValue","getdefaultValue","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","addValueChangedCallback","removeValueChangedCallback","clearStartFlag","VariableStore","syncVariables","onSyncSuccess","onSyncFailure","meta","tk","r","status","fetchVariables","onFetchCallback","addVariablesChangedCallback","callback","addOneTimeVariablesChangedCallback","removeVariablesChangedCallback","removeOneTimeVariablesChangedCallback","callBack","CleverTap","spa","isSpa","bind","enablePersonalization","_isPersonalisationActive","ReqestManager","privacy","notifications","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","handleDecrementValue","setMultiValuesForKey","addMultiValueForKey","addMultiValuesForKey","removeMultiValueForKey","removeMultiValuesForKey","removeValueForKey","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","sendLocationData","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","elements","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","setOffline","arg","defineVariable","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;EAAO,MAAMA,aAAa,GAAG,oBAAtB;EACA,MAAMC,eAAe,GAAG,QAAxB;EACA,MAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;ECAQ,MAAMC,OAAN,CAAc;EAO3BC,EAAAA,WAAW,GAAsE;EAAA,QAApE;EAAEC,MAAAA;EAAF,KAAoE,uEAA3D,EAA2D;EAAA,QAAvDC,MAAuD,uEAA9C,EAA8C;EAAA,QAA1CC,YAA0C,uEAA3BP,aAA2B;EAAA,QAAZQ,KAAY,uEAAJ,EAAI;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,aALvE;EAKuE;EAAA;EAAA;EAAA,aAJjER;EAIiE;EAAA;EAAA;EAAA,aAHjE;EAGiE;EAAA;EAAA;EAAA,aAFxE;EAEwE;EAC/E,SAAKK,EAAL,GAAUA,EAAV;;EACA,QAAIC,MAAJ,EAAY;EACV,WAAKA,MAAL,GAAcA,MAAd;EACD;;EACD,QAAIC,YAAJ,EAAkB;EAChB,WAAKA,YAAL,GAAoBA,YAApB;EACD;;EACD,QAAIC,KAAJ,EAAW;EACT,WAAKA,KAAL,GAAaA,KAAb;EACD;EACF;;EAED,MAAIH,EAAJ,GAAU;EACR,uCAAO,IAAP;EACD;;EAED,MAAIA,EAAJ,CAAQI,SAAR,EAAmB;EACjB,gEAAkBA,SAAlB;EACD;;EAED,MAAIH,MAAJ,GAAc;EACZ,uCAAO,IAAP;EACD;;EAED,MAAIA,MAAJ,CAAYA,MAAZ,EAAoB;EAClB,0DAAeA,MAAf;EACD;;EAED,MAAII,YAAJ,GAAoB;EAClB,uCAAO,IAAP;EACD;;EAED,MAAIA,YAAJ,CAAkBA,YAAlB,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8N,SAAP,GAAmB9N,MAAM,CAAC+N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file diff --git a/clevertap.min.js b/clevertap.min.js index 6b0f3898..5b256478 100644 --- a/clevertap.min.js +++ b/clevertap.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).clevertap=t()}(this,(function(){"use strict";var e=0;function t(t){return"__private_"+e+++"_"+t}function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}const o="clevertap-prod.com",n="https:";var s=t("accountId"),r=t("region"),a=t("targetDomain"),l=t("dcSdkversion"),d=t("token");class c{constructor(){let{id:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";Object.defineProperty(this,s,{writable:!0,value:void 0}),Object.defineProperty(this,r,{writable:!0,value:""}),Object.defineProperty(this,a,{writable:!0,value:o}),Object.defineProperty(this,l,{writable:!0,value:""}),Object.defineProperty(this,d,{writable:!0,value:""}),this.id=e,t&&(this.region=t),i&&(this.targetDomain=i),n&&(this.token=n)}get id(){return i(this,s)[s]}set id(e){i(this,s)[s]=e}get region(){return i(this,r)[r]}set region(e){i(this,r)[r]=e}get dcSDKVersion(){return i(this,l)[l]}set dcSDKVersion(e){i(this,l)[l]=e}get targetDomain(){return i(this,a)[a]}set targetDomain(e){i(this,a)[a]=e}get token(){return i(this,d)[d]}set token(e){i(this,d)[d]=e}get finalTargetDomain(){return this.region?"".concat(this.region,".").concat(this.targetDomain):this.targetDomain===o?"".concat("eu1",".").concat(this.targetDomain):this.targetDomain}get dataPostPEURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/defineVars")}get dataPostURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/a?t=96")}get recorderURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/r?r=1")}get emailURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/e?r=1")}}const h=new RegExp("^\\s+|\\.|:|\\$|'|\"|\\\\|\\s+$","g"),u=new RegExp("^\\s+|'|\"|\\\\|\\s+$","g"),p=new RegExp("'","g"),g="clear",v="Charged ID",f="WZRK_CHARGED_ID",b="WZRK_G",m="WZRK_K",y="WZRK_CAMP",w="WZRK_CAMP_G",C="WZRK_EV",k="WZRK_META",x="WZRK_PR",P="WZRK_ARP",I="WZRK_L",S="global",O="optOut",_="useIP",E="WZRK_X",A="push",M=31536e3,L="wzrk_",T="wzrk_id",R="Notification Viewed",j="Notification Clicked",D="WZRK_FPU",B="WZRK_PSD",N="$incr",z="$add",U="$remove",F="$delete",q="WZRK_INBOX_CONFIG",V="WZRK_INBOX",W=1e3,K="wzrk_fetch",H="wiz-iframe",G="wiz-iframe-intent",J="Event",Z="Profile",$=["Stayed","UTM Visited","App Launched","Notification Sent",R,j],Y=e=>"string"==typeof e||e instanceof String,Q=e=>"[object Object]"===Object.prototype.toString.call(e),X=e=>"object"==typeof e&&e instanceof Date,ee=e=>{for(const t in e)if(e.hasOwnProperty(t))return!1;return!0},te=e=>!isNaN(parseFloat(e))&&isFinite(e),ie=e=>/^-?[\d.]+(?:e-?\d+)?$/.test(e)&&"number"==typeof e,oe=e=>null!=e&&"undefined"!==e,ne=(e,t)=>{if("object"!=typeof e){let i;return Y(e)?(i=se(e,u),i.length>1024&&(i=i.substring(0,1024),t.reportError(521,i+"... length exceeded 1024 chars. Trimmed."))):i=e,i}for(const i in e)if(e.hasOwnProperty(i)){const o=ne(e[i],t);let n;n=se(i,h),n.length>1024&&(n=n.substring(0,1024),t.reportError(520,n+"... length exceeded 1024 chars. Trimmed.")),delete e[i],e[n]=o}return e},se=(e,t)=>e.replace(t,""),re=()=>{const e=new Date;return e.getFullYear()+""+e.getMonth()+e.getDay()},ae=()=>Math.floor((new Date).getTime()/1e3),le=e=>"$D_"+Math.round(e.getTime()/1e3),de=e=>{if(ce(e))return"$D_"+e},ce=e=>{const t=/^(\d{4})(\d{2})(\d{2})$/.exec(e);if(null==t)return!1;const i=t[3],o=t[2]-1,n=t[1],s=new Date(n,o,i);return s.getDate()==i&&s.getMonth()==o&&s.getFullYear()==n};class he{static save(e,t){return!(!e||!t)&&(this._isLocalStorageSupported()?(localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),!0):void 0)}static read(e){if(!e)return!1;let t=null;if(this._isLocalStorageSupported()&&(t=localStorage.getItem(e)),null!=t)try{t=JSON.parse(t)}catch(e){}return t}static remove(e){return!!e&&(this._isLocalStorageSupported()?(localStorage.removeItem(e),!0):void 0)}static removeCookie(e,t){let i=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";t&&(i=i+" domain="+t+"; path=/"),document.cookie=i}static createCookie(e,t,i,o){let n="",s="";if(i){const e=new Date;e.setTime(e.getTime()+1e3*i),n="; expires="+e.toGMTString()}o&&(s="; domain="+o),t=encodeURIComponent(t),document.cookie=e+"="+t+n+s+"; path=/"}static readCookie(e){const t=e+"=",i=document.cookie.split(";");for(let e=0;e=0;o--){if(a=0===o?r[o]+a:"."+r[o]+a,this.readCookie(e)){var n="test_"+e+o;if(this.createCookie(n,t,10,a),!this.readCookie(n))continue;this.removeCookie(n,a)}this.createCookie(e,t,i,a);if(this.readCookie(e)==t){s=a,ue.broadDomain=s;break}}}else this.createCookie(e,t,i,s)}else this.createCookie(e,t,i,o)}static getMetaProp(e){const t=this.readFromLSorCookie(k);if(null!=t)return t[e]}static setMetaProp(e,t){if(this._isLocalStorageSupported()){let i=this.readFromLSorCookie(k);null==i&&(i={}),void 0===t?delete i[e]:i[e]=t,this.saveToLSorCookie(k,i)}}static getAndClearMetaProp(e){const t=this.getMetaProp(e);return this.setMetaProp(e,void 0),t}static setInstantDeleteFlagInK(){let e=this.readFromLSorCookie(m);null==e&&(e={}),e.flag=!0,this.saveToLSorCookie(m,e)}static backupEvent(e,t,i){let o=this.readFromLSorCookie(I);void 0===o&&(o={}),o[t]={q:e},this.saveToLSorCookie(I,o),i.debug("stored in ".concat(I," reqNo : ").concat(t," -> ").concat(e))}static removeBackup(e,t){const i=this.readFromLSorCookie(I);null!=i&&void 0!==i[e]&&(t.debug("del event: ".concat(e," data-> ").concat(i[e].q)),delete i[e],this.saveToLSorCookie(I,i))}}const ue={globalCache:{gcookie:null,REQ_N:0,RESP_N:0},LRU_CACHE:null,globalProfileMap:void 0,globalEventsMap:void 0,blockRequest:!1,isOptInRequest:!1,broadDomain:null,webPushEnabled:null,campaignDivMap:{},currentSessionId:null,wiz_counter:0,notifApi:{notifEnabledFromApi:!1},unsubGroups:[],updatedCategoryLong:null,inbox:null,isPrivacyArrPushed:!1,privacyArray:[],offline:!1,location:null,dismissSpamControl:!1,globalUnsubscribe:!0,flutterVersion:null,variableStore:{}};var pe=t("keyOrder"),ge=t("deleteFromObject");class ve{constructor(e){Object.defineProperty(this,ge,{value:fe}),Object.defineProperty(this,pe,{writable:!0,value:void 0}),this.max=e;let t=he.readFromLSorCookie(E);if(t){const e={};i(this,pe)[pe]=[],t=t.cache;for(const o in t)t.hasOwnProperty(o)&&(e[t[o][0]]=t[o][1],i(this,pe)[pe].push(t[o][0]));this.cache=e}else this.cache={},i(this,pe)[pe]=[]}get(e){const t=this.cache[e];return t&&(this.cache=i(this,ge)[ge](e,this.cache),this.cache[e]=t,i(this,pe)[pe].push(e)),this.saveCacheToLS(this.cache),t}set(e,t){const o=this.cache[e],n=i(this,pe)[pe];null!=o?this.cache=i(this,ge)[ge](e,this.cache):n.length===this.max&&(this.cache=i(this,ge)[ge](n[0],this.cache)),this.cache[e]=t,i(this,pe)[pe][i(this,pe)[pe]-1]!==e&&i(this,pe)[pe].push(e),this.saveCacheToLS(this.cache)}saveCacheToLS(e){const t=[],o=i(this,pe)[pe];for(const i in o)if(o.hasOwnProperty(i)){const n=[];n.push(o[i]),n.push(e[o[i]]),t.push(n)}he.saveToLSorCookie(E,{cache:t})}getKey(e){if(null===e)return null;const t=i(this,pe)[pe];for(const i in t)if(t.hasOwnProperty(i)&&this.cache[t[i]]===e)return t[i];return null}getSecondLastKey(){const e=i(this,pe)[pe];return null!=e&&e.length>1?e[e.length-2]:-1}getLastKey(){const e=i(this,pe)[pe].length;if(e)return i(this,pe)[pe][e-1]}}var fe=function(e,t){const o=JSON.parse(JSON.stringify(i(this,pe)[pe])),n={};let s;for(const i in o)o.hasOwnProperty(i)&&(o[i]!==e?n[o[i]]=t[o[i]]:s=i);return o.splice(s,1),i(this,pe)[pe]=JSON.parse(JSON.stringify(o)),n},be=t("logger"),me=t("request"),ye=t("device"),we=t("session");class Ce{constructor(e){let{logger:t,request:o,device:n,session:s}=e;Object.defineProperty(this,be,{writable:!0,value:void 0}),Object.defineProperty(this,me,{writable:!0,value:void 0}),Object.defineProperty(this,ye,{writable:!0,value:void 0}),Object.defineProperty(this,we,{writable:!0,value:void 0}),i(this,be)[be]=t,i(this,me)[me]=o,i(this,ye)[ye]=n,i(this,we)[we]=s}s(e,t,o,n,s){let r=!1,a=!1;if(window.isOULInProgress&&(o||"undefined"!==n&&n===window.oulReqN)&&(window.isOULInProgress=!1,r=!0),void 0===n&&(n=0),he.removeBackup(n,i(this,be)[be]),n>ue.globalCache.REQ_N)return;if(oe(i(this,ye)[ye].gcookie)||e&&(a=!0),!oe(i(this,ye)[ye].gcookie)||o||"boolean"==typeof s){const n=i(this,we)[we].getSessionCookieObject();if(window.isOULInProgress||n.s&&t{if(Q(e)){for(var t in e)if(e.hasOwnProperty(t)){if(Q(e[t])||Array.isArray(e[t]))return!1;X(e[t])&&(e[t]=le(e[t]))}return!0}return!1},Ne=(e,t)=>{if(Q(e)){for(var i in e)if(e.hasOwnProperty(i))if("Items"===i){if(!Array.isArray(e[i]))return!1;for(var o in e[i].length>50&&t.reportError(522,"Charged Items exceed 50 limit. Actual count: "+e[i].length),e[i])if(e[i].hasOwnProperty(o)&&(!Q(e[i][o])||!Be(e[i][o])))return!1}else{if(Q(e[i])||Array.isArray(e[i]))return!1;X(e[i])&&(e[i]=le(e[i]))}if(Y(e[v])||ie(e[v])){const i=e[v]+"";if(void 0===De&&(De=he.readFromLSorCookie(f)),void 0!==De&&De.trim()===i.trim())return t.error("Duplicate charged Id - Dropped"+e),!1;De=i,he.saveToLSorCookie(f,i)}return!0}return!1};var ze=t("logger"),Ue=t("oldValues"),Fe=t("request"),qe=t("isPersonalisationActive"),Ve=t("processEventArray");class We extends Array{constructor(e,t){let{logger:o,request:n,isPersonalisationActive:s}=e;super(),Object.defineProperty(this,Ve,{value:Ke}),Object.defineProperty(this,ze,{writable:!0,value:void 0}),Object.defineProperty(this,Ue,{writable:!0,value:void 0}),Object.defineProperty(this,Fe,{writable:!0,value:void 0}),Object.defineProperty(this,qe,{writable:!0,value:void 0}),i(this,ze)[ze]=o,i(this,Ue)[Ue]=t,i(this,Fe)[Fe]=n,i(this,qe)[qe]=s}push(){for(var e=arguments.length,t=new Array(e),o=0;o0;){var t=e.shift();if(!Y(t)){i(this,ze)[ze].error(Oe);continue}if(t.length>1024&&(t=t.substring(0,1024),i(this,ze)[ze].reportError(510,t+"... length exceeded 1024 chars. Trimmed.")),$.includes(t)){i(this,ze)[ze].reportError(513,t+" is a restricted system event. It cannot be used as an event name.");continue}const o={type:"event"};if(o.evtName=se(t,h),0!==e.length){const n=e.shift();if(Q(n)){if("Charged"===t){if(!Ne(n,i(this,ze)[ze])){i(this,ze)[ze].reportError(511,"Charged event structure invalid. Not sent.");continue}}else if(!Be(n)){i(this,ze)[ze].reportError(512,t+" event structure invalid. Not sent.");continue}o.evtData=n}else e.unshift(n)}i(this,Fe)[Fe].processEvent(o)}};const He=e=>{const t={},i=e.indexOf("?");if(i>1){const o=e.substring(i+1);let n;const s=/\+/g,r=/([^&=]+)=?([^&]*)/g,a=function(e){let t=e.replace(s," ");try{t=decodeURIComponent(t)}catch(e){}return t};for(n=r.exec(o);n;)t[a(n[1])]=a(n[2]),n=r.exec(o)}return t},Ge=(e,t,i)=>e+"&"+t+"="+encodeURIComponent(i),Je=()=>window.location.hostname,Ze=(e,t)=>(t&&"function"==typeof t.debug&&t.debug("dobj:"+e),Ye(e)),$e=(()=>{let e="",t=0;for(t=0;t<=25;t++)e+=String.fromCharCode(t+65);for(t=0;t<=25;t++)e+=String.fromCharCode(t+97);for(t=0;t<10;t++)e+=t;return e+"+/="})(),Ye=e=>{if(null==e)return"";var t,i,o,n,s,r,a,l="",d=0;for(e=(e=>{if(null==e)return"";let t,i,o,n={},s={},r="",a="",l="",d=2,c=3,h=2,u="",p=0,g=0,v=String.fromCharCode;for(o=0;o>=1}else{for(i=1,t=0;t>=1}d--,0==d&&(d=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;d--,0==d&&(d=Math.pow(2,h),h++),n[a]=c++,l=String(r)}if(""!==l){if(Object.prototype.hasOwnProperty.call(s,l)){if(l.charCodeAt(0)<256){for(t=0;t>=1}else{for(i=1,t=0;t>=1}d--,0==d&&(d=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;d--,0==d&&(d=Math.pow(2,h),h++)}for(i=2,t=0;t>=1;for(;;){if(p<<=1,15==g){u+=v(p);break}g++}return u})(e);d<2*e.length;)d%2==0?(t=e.charCodeAt(d/2)>>8,i=255&e.charCodeAt(d/2),o=d/2+1>8:NaN):(t=255&e.charCodeAt((d-1)/2),(d+1)/2>8,o=255&e.charCodeAt((d+1)/2)):i=o=NaN),d+=3,n=t>>2,s=(3&t)<<4|i>>4,r=(15&i)<<2|o>>6,a=63&o,isNaN(i)?r=a=64:isNaN(o)&&(a=64),l=l+$e.charAt(n)+$e.charAt(s)+$e.charAt(r)+$e.charAt(a);return l};var Qe=t("fireRequest"),Xe=t("dropRequestDueToOptOut"),et=t("addUseIPToRequest"),tt=t("addARPToRequest");class it{constructor(){this.networkRetryCount=0,this.minDelayFrequency=0}static fireRequest(e,t,o,n){i(this,Qe)[Qe](e,1,t,o,n)}getDelayFrequency(){if(this.logger.debug("Network retry #"+this.networkRetryCount),this.networkRetryCount<10)return this.logger.debug(this.account.id,"Failure count is "+this.networkRetryCount+". Setting delay frequency to 1s"),this.minDelayFrequency=W,this.minDelayFrequency;if(null==this.account.region)return this.logger.debug(this.account.id,"Setting delay frequency to 1s"),W;{const e=1e3*(Math.floor(10*Math.random())+1);return this.minDelayFrequency+=e,this.minDelayFrequency<6e5?(this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency):(this.minDelayFrequency=W,this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency)}}}it.logger=void 0,it.device=void 0,it.account=void 0,Object.defineProperty(it,Qe,{value:function(e,t,o,n,s){var r,a;if(i(this,Xe)[Xe]())return void this.logger.debug("req dropped due to optout cookie: "+this.device.gcookie);if(oe(this.device.gcookie)||(ue.blockRequest=!0),s&&s===K)!oe(this.device.gcookie)&&ue.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(this.networkRetryCount)),i(this,Qe)[Qe](e,void 0,o,n)}),this.getDelayFrequency());else if(!oe(this.device.gcookie)&&ue.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(t)),i(this,Qe)[Qe](e,t+1,o,n)}),50);if(n?window.isOULInProgress=!0:(oe(this.device.gcookie)&&(e=Ge(e,"gc",this.device.gcookie)),e=i(this,tt)[tt](e,o)),e=Ge(e,"tries",t),e=i(this,et)[et](e),e=Ge(e,"r",(new Date).getTime()),(null===(r=window.clevertap)||void 0===r?void 0:r.hasOwnProperty("plugin"))||(null===(a=window.wizrocket)||void 0===a?void 0:a.hasOwnProperty("plugin"))){const t=window.clevertap.plugin||window.wizrocket.plugin;e=Ge(e,"ct_pl",t)}-1!==e.indexOf("chrome-extension:")&&(e=e.replace("chrome-extension:","https:"));for(var l=document.getElementsByClassName("ct-jp-cb");l[0]&&l[0].parentNode;)l[0].parentNode.removeChild(l[0]);const d=document.createElement("script");d.setAttribute("type","text/javascript"),d.setAttribute("src",e),d.setAttribute("class","ct-jp-cb"),d.setAttribute("rel","nofollow"),d.async=!0,document.getElementsByTagName("head")[0].appendChild(d),this.logger.debug("req snt -> url: "+e)}}),Object.defineProperty(it,Xe,{value:function(){return!ue.isOptInRequest&&oe(this.device.gcookie)&&Y(this.device.gcookie)?":OO"===this.device.gcookie.slice(-3):(ue.isOptInRequest=!1,!1)}}),Object.defineProperty(it,et,{value:function(e){var t=he.getMetaProp(_);return"boolean"!=typeof t&&(t=!1),Ge(e,_,t?"true":"false")}}),Object.defineProperty(it,tt,{value:function(e,t){if(!0===t){const t={skipResARP:!0};return Ge(e,"arp",Ze(JSON.stringify(t),this.logger))}return he._isLocalStorageSupported()&&void 0!==localStorage.getItem(P)&&null!==localStorage.getItem(P)?Ge(e,"arp",Ze(JSON.stringify(he.readFromLSorCookie(P)),this.logger)):e}});const ot=()=>{let e={};if(he._isLocalStorageSupported()){let t=he.read(y);null!=t?(t=JSON.parse(decodeURIComponent(t).replace(p,'"')),t.hasOwnProperty("global")?e.wp=t:e=t):e={}}return e},nt=e=>{if(he._isLocalStorageSupported()){const t={...ot(),...e},i=JSON.stringify(t);he.save(y,encodeURIComponent(i)),st()}},st=()=>{if(he._isLocalStorageSupported()){let i=he.read(b);if(oe(i))try{i=JSON.parse(decodeURIComponent(he.read(b)));const o=he.read(w)?JSON.parse(decodeURIComponent(he.read(w))):{};if(i&&he._isLocalStorageSupported()){var e={},t=ot();Object.keys(t).forEach((n=>{const s=i in o&&Object.keys(o[i]).length&&o[i][n]?o[i][n]:{},r=t[n].global,a=re(),l=t[n][a];if(void 0!==r){const e=Object.keys(r);for(const t in e){let i=[];if(e.hasOwnProperty(t)){let o=0,n=0;const a=e[t];if("tc"===a)continue;void 0!==l&&void 0!==l[a]&&(o=l[a]),void 0!==r&&void 0!==r[a]&&(n=r[a]),i=[a,o,n],s[a]=i}}}e={...e,[n]:s}})),o[i]=e,he.save(w,encodeURIComponent(JSON.stringify(o)))}}catch(e){console.error("Invalid clevertap Id "+e)}}},rt=()=>{const e=JSON.parse(decodeURIComponent(he.read(b)));let t={};if(he._isLocalStorageSupported()){let i={};t=ot();const o=he.read(w),n=o?decodeURIComponent(o):null,s=n?JSON.parse(n):null,r=e&&null!=o&&s&&s[e]&&s[e].wp?Object.values(s[e].wp):[],a=e&&null!=o&&s&&s[e]&&s[e].wi?Object.values(s[e].wi):[],l=re();let d=0,c=0;return t.wp&&t.wp[l]&&"undefined"!==t.wp[l].tc&&(d=t.wp[l].tc),t.wi&&t.wi[l]&&"undefined"!==t.wi[l].tc&&(c=t.wi[l].tc),i={wmp:d,wimp:c,tlc:r,witlc:a},i}},at=(e,t)=>{let{logger:i}=t,o=!1;if(Q(e))for(const t in e)if(e.hasOwnProperty(t)){o=!0;let n=e[t];if(null==n){delete e[t];continue}"Gender"!==t||n.match(/^M$|^F$/)||(o=!1,i.error(_e)),"Employed"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Ee)),"Married"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Ae)),"Education"!==t||n.match(/^School$|^College$|^Graduate$/)||(o=!1,i.error(Me)),"Age"===t&&null!=n&&(te(n)?e.Age=+n:(o=!1,i.error(Le))),"DOB"===t?(/^\$D_/.test(n)&&11===(n+"").length||X(n)||(o=!1,i.error(Te)),X(n)&&(e[t]=le(n))):X(n)&&(e[t]=le(n)),"Phone"!==t||ee(n)||(n.length>8&&"+"===n.charAt(0)?(n=n.substring(1,n.length),te(n)?e.Phone=+n:(o=!1,i.error(je+". Removed."))):(o=!1,i.error(je+". Removed."))),o||delete e[t]}return o},lt=e=>{const t={};t.Name=e.name,null!=e.id&&(t.FBID=e.id+""),"male"===e.gender?t.Gender="M":"female"===e.gender?t.Gender="F":t.Gender="O";null!=e.relationship_status&&(t.Married="N","Married"===e.relationship_status&&(t.Married="Y"));const i=function(e){if(null!=e){let t="",i="";for(let o=0;o0?"Y":"N",null!=e.email&&(t.Email=e.email),null!=e.birthday){const i=e.birthday.split("/");t.DOB=de(i[2]+i[0]+i[1])}return t},dt=(e,t)=>{let{logger:i}=t;const o={};if(null!=e.displayName&&(o.Name=e.displayName),null!=e.id&&(o.GPID=e.id+""),null!=e.gender&&("male"===e.gender?o.Gender="M":"female"===e.gender?o.Gender="F":"other"===e.gender&&(o.Gender="O")),null!=e.image&&!1===e.image.isDefault&&(o.Photo=e.image.url.split("?sz")[0]),null!=e.emails)for(let t=0;t{if(he._isLocalStorageSupported()){if(null==ue.globalProfileMap&&(ue.globalProfileMap=he.readFromLSorCookie(x),null==ue.globalProfileMap&&(ue.globalProfileMap={})),null!=e._custom){const t=e._custom;for(const i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);delete e._custom}for(const i in e)if(e.hasOwnProperty(i)){if(ue.globalProfileMap.hasOwnProperty(i)&&!t)continue;ue.globalProfileMap[i]=e[i]}null!=ue.globalProfileMap._custom&&delete ue.globalProfileMap._custom,he.saveToLSorCookie(x,ue.globalProfileMap)}},ht=(e,t,i)=>{if(null!=e&&"-1"!==e&&he._isLocalStorageSupported()){const t=ot();let o=t.wp[i];null==o&&(o={},t[i]=o),o[e]="dnd",nt(t)}if(null!=ue.campaignDivMap){const t=ue.campaignDivMap[e];null!=t&&(document.getElementById(t).style.display="none","intentPreview"===t&&null!=document.getElementById("intentOpacityDiv")&&(document.getElementById("intentOpacityDiv").style.display="none"))}};var ut=t("logger"),pt=t("request"),gt=t("account"),vt=t("oldValues"),ft=t("isPersonalisationActive"),bt=t("processProfileArray");class mt extends Array{constructor(e,t){let{logger:o,request:n,account:s,isPersonalisationActive:r}=e;super(),Object.defineProperty(this,bt,{value:yt}),Object.defineProperty(this,ut,{writable:!0,value:void 0}),Object.defineProperty(this,pt,{writable:!0,value:void 0}),Object.defineProperty(this,gt,{writable:!0,value:void 0}),Object.defineProperty(this,vt,{writable:!0,value:void 0}),Object.defineProperty(this,ft,{writable:!0,value:void 0}),i(this,ut)[ut]=o,i(this,pt)[pt]=n,i(this,gt)[gt]=s,i(this,vt)[vt]=t,i(this,ft)[ft]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o0)for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];let n,s={};if(null!=o.Site){if(n=o.Site,ee(n)||!at(n,{logger:i(this,ut)[ut]}))return}else if(null!=o.Facebook){const e=o.Facebook;ee(e)||e.error||(n=lt(e))}else if(null!=o["Google Plus"]){const e=o["Google Plus"];ee(e)||e.error||(n=dt(e,{logger:i(this,ut)[ut]}))}if(null!=n&&!ee(n)){s.type="profile",null==n.tz&&(n.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),s.profile=n,ct(n,!0),s=i(this,pt)[pt].addSystemDataToObject(s,void 0),i(this,pt)[pt].addFlags(s);const e=Ze(JSON.stringify(s),i(this,ut)[ut]);let t=i(this,gt)[gt].dataPostURL;t=Ge(t,"type",A),t=Ge(t,"d",e),i(this,pt)[pt].saveAndFireRequest(t,ue.blockRequest)}}},wt=t("request"),Ct=t("logger"),kt=t("account"),xt=t("session"),Pt=t("oldValues"),It=t("device"),St=t("processOUL"),Ot=t("handleCookieFromCache"),_t=t("deleteUser"),Et=t("processLoginArray");class At extends Array{constructor(e,t){let{request:o,account:n,session:s,logger:r,device:a}=e;super(),Object.defineProperty(this,Et,{value:Rt}),Object.defineProperty(this,_t,{value:Tt}),Object.defineProperty(this,Ot,{value:Lt}),Object.defineProperty(this,St,{value:Mt}),Object.defineProperty(this,wt,{writable:!0,value:void 0}),Object.defineProperty(this,Ct,{writable:!0,value:void 0}),Object.defineProperty(this,kt,{writable:!0,value:void 0}),Object.defineProperty(this,xt,{writable:!0,value:void 0}),Object.defineProperty(this,Pt,{writable:!0,value:void 0}),Object.defineProperty(this,It,{writable:!0,value:void 0}),i(this,wt)[wt]=o,i(this,kt)[kt]=n,i(this,xt)[xt]=s,i(this,Ct)[Ct]=r,i(this,Pt)[Pt]=t,i(this,It)[It]=a}clear(){i(this,Ct)[Ct].debug("clear called. Reset flag has been set."),i(this,_t)[_t](),he.setMetaProp(g,!0)}push(){for(var e=arguments.length,t=new Array(e),o=0;o{let o=he.readFromLSorCookie(m);const n=he.readFromLSorCookie(b);let s;if(null==o)o={},s=e;else{s=o.id;let r=!1,a=!1;if(null==s&&(s=e[0],r=!0),null==ue.LRU_CACHE&&he._isLocalStorageSupported()&&(ue.LRU_CACHE=new ve(100)),r)null!=n&&(ue.LRU_CACHE.set(s,n),ue.blockRequest=!1);else for(const t in e)if(e.hasOwnProperty(t)){const i=e[t];if(ue.LRU_CACHE.cache[i]){s=i,a=!0;break}}if(a){s!==ue.LRU_CACHE.getLastKey()?i(this,Ot)[Ot]():(t=!1,he.saveToLSorCookie(D,t));const e=ue.LRU_CACHE.get(s);ue.LRU_CACHE.set(s,e),he.saveToLSorCookie(b,e),i(this,It)[It].gcookie=e;const o=ue.LRU_CACHE.getSecondLastKey();if(he.readFromLSorCookie(D)&&-1!==o){const e=ue.LRU_CACHE.cache[o];i(this,wt)[wt].unregisterTokenForGuid(e)}}else r?null!=n&&(i(this,It)[It].gcookie=n,he.saveToLSorCookie(b,n),t=!1):this.clear(),he.saveToLSorCookie(D,!1),s=e[0]}o.id=s,he.saveToLSorCookie(m,o)};if(Array.isArray(e)&&e.length>0)for(const n in e)if(e.hasOwnProperty(n)){const s=e[n];let r,a={};if(null!=s.Site){if(r=s.Site,ee(r)||!at(r,{logger:i(this,Ct)[Ct]}))return}else if(null!=s.Facebook){const e=s.Facebook;ee(e)||e.error||(r=lt(e))}else if(null!=s["Google Plus"]){const e=s["Google Plus"];ee(e)&&!e.error&&(r=dt(e,{logger:i(this,Ct)[Ct]}))}if(null!=r&&!ee(r)){a.type="profile",null==r.tz&&(r.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),a.profile=r;const e=[];he._isLocalStorageSupported()&&(r.Identity&&e.push(r.Identity),r.Email&&e.push(r.Email),r.GPID&&e.push("GP:"+r.GPID),r.FBID&&e.push("FB:"+r.FBID),e.length>0&&o(e)),ct(r,!0),a=i(this,wt)[wt].addSystemDataToObject(a,void 0),i(this,wt)[wt].addFlags(a),t&&(a.isOUL=!0);const n=Ze(JSON.stringify(a),i(this,Ct)[Ct]);let s=i(this,kt)[kt].dataPostURL;s=Ge(s,"type",A),s=Ge(s,"d",n),i(this,wt)[wt].saveAndFireRequest(s,ue.blockRequest,t)}}},Lt=function(){ue.blockRequest=!1,console.debug("Block request is false"),he._isLocalStorageSupported()&&(delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),he.removeCookie(y,Je()),he.removeCookie(i(this,xt)[xt].cookieName,ue.broadDomain),he.removeCookie(P,ue.broadDomain),i(this,xt)[xt].setSessionCookieObject("")},Tt=function(){ue.blockRequest=!0,i(this,Ct)[Ct].debug("Block request is true"),ue.globalCache={gcookie:null,REQ_N:0,RESP_N:0},he._isLocalStorageSupported()&&(delete localStorage.WZRK_G,delete localStorage.WZRK_K,delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),he.removeCookie(b,ue.broadDomain),he.removeCookie(y,Je()),he.removeCookie(m,Je()),he.removeCookie(i(this,xt)[xt].cookieName,ue.broadDomain),he.removeCookie(P,ue.broadDomain),i(this,It)[It].gcookie=null,i(this,xt)[xt].setSessionCookieObject("")},Rt=function(e){if(Array.isArray(e)&&e.length>0){const t=e.pop();if(null!=t&&Q(t)&&(null!=t.Site&&Object.keys(t.Site).length>0||null!=t.Facebook&&Object.keys(t.Facebook).length>0||null!=t["Google Plus"]&&Object.keys(t["Google Plus"]).length>0)){he.setInstantDeleteFlagInK();try{i(this,St)[St]([t])}catch(e){i(this,Ct)[Ct].debug(e)}}else i(this,Ct)[Ct].error("Profile object is in incorrect format")}};class jt extends HTMLElement{constructor(){super(),this._details=null,this.shadow=null,this.shadow=this.attachShadow({mode:"open"})}get details(){return this._details||""}set details(e){null===this._details&&(this._details=e,this.renderBanner())}renderBanner(){this.shadow.innerHTML=this.getBannerContent(),!1!==this.trackClick&&this.addEventListener("click",(()=>{const e=this.details.onClick;e&&(this.details.window?window.open(e,"_blank"):window.parent.location.href=e),window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId})}getBannerContent(){return'\n \n \n ")}}class Dt extends HTMLElement{constructor(){super(),this._target=null,this._carousel=null,this.shadow=null,this.slides=0,this.previouslySelectedItem=-1,this.selectedItem=1,this.autoSlide=null,this.stopAutoSlideTimeout=null,this.shadow=this.attachShadow({mode:"open"}),void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",jt)}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderCarousel())}get details(){return this.target.display.details}get display(){return this.target.display}renderCarousel(){this.slides=this.details.length,this.shadow.innerHTML=this.getStyles();const e=this.getCarouselContent();this.display.showNavBtns&&e.insertAdjacentHTML("beforeend",this.display.navBtnsHtml),this.display.showNavArrows&&(e.insertAdjacentHTML("beforeend",this.display.leftNavArrowHtml),e.insertAdjacentHTML("beforeend",this.display.rightNavArrowHtml)),this._carousel=e,this.shadow.appendChild(e),this.setupClick(),this.updateSelectedItem(),this.startAutoSlide(),this.setupOnHover(),window.clevertap.renderNotificationViewed({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot})}setupClick(){this._carousel.addEventListener("click",(e=>{const t=e.target.id;if(t.startsWith("carousel__button")){const e=+t.split("-")[1];e!==this.selectedItem&&(this.previouslySelectedItem=this.selectedItem,this.selectedItem=e,this.updateSelectedItem(),this.startAutoSlide())}else if(t.startsWith("carousel__arrow"))t.endsWith("right")?this.goToNext():this.goToPrev(),this.startAutoSlide();else if(t.indexOf("-")>-1){const e=+t.split("-")[1],i=e-1;window.parent.clevertap&&window.clevertap.renderNotificationClicked({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot,wzrk_slideNo:e});const o=this.details[i].onClick;""!==o&&(this.details[i].window?window.open(o,"_blank"):window.location.href=o)}}))}setupOnHover(){this._carousel.addEventListener("mouseenter",(e=>{this.stopAutoSlideTimeout=setTimeout((()=>{this.autoSlide=clearInterval(this.autoSlide)}),500)})),this._carousel.addEventListener("mouseleave",(e=>{clearTimeout(this.stopAutoSlideTimeout),void 0===this.autoSlide&&this.startAutoSlide()}))}getCarouselContent(){const e=document.createElement("div");return e.setAttribute("class","carousel"),this.details.forEach(((t,i)=>{const o=document.createElement("ct-web-personalisation-banner");o.classList.add("carousel__item"),o.trackClick=!1,o.setAttribute("id","carousel__item-".concat(i+1)),o.details=t,e.appendChild(o)})),e}getStyles(){var e,t;return"\n \n ")}updateSelectedItem(){if(-1!==this.previouslySelectedItem){const e=this.shadow.getElementById("carousel__item-".concat(this.previouslySelectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.previouslySelectedItem));e.classList.remove("carousel__item--selected"),t&&t.classList.remove("carousel__button--selected")}const e=this.shadow.getElementById("carousel__item-".concat(this.selectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.selectedItem));e.classList.add("carousel__item--selected"),t&&t.classList.add("carousel__button--selected")}startAutoSlide(){clearInterval(this.autoSlide),this.autoSlide=setInterval((()=>{this.goToNext()}),this.display.sliderTime?1e3*this.display.sliderTime:3e3)}goToNext(){this.goTo(this.selectedItem,(this.selectedItem+1)%this.slides)}goToPrev(){this.goTo(this.selectedItem,this.selectedItem-1)}goTo(e,t){this.previouslySelectedItem=e,this.selectedItem=t,0===t&&(this.selectedItem=this.slides),this.updateSelectedItem()}}class Bt extends HTMLElement{constructor(){super(),this._target=null,this._session=null,this.shadow=null,this.popup=null,this.container=null,this.resizeObserver=null,this.shadow=this.attachShadow({mode:"open"})}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderImageOnlyPopup())}get session(){return this._session||""}set session(e){this._session=e}get msgId(){return this.target.wzrk_id}get pivotId(){return this.target.wzrk_pivot}get onClickUrl(){return this.target.display.onClickUrl}renderImageOnlyPopup(){const e=this.target.wzrk_id.split("_")[0],t=this.session.sessionId;this.shadow.innerHTML=this.getImageOnlyPopupContent(),this.popup=this.shadowRoot.getElementById("imageOnlyPopup"),this.container=this.shadowRoot.getElementById("container"),this.closeIcon=this.shadowRoot.getElementById("close"),this.popup.addEventListener("load",this.updateImageAndContainerWidth()),this.resizeObserver=new ResizeObserver((()=>this.handleResize(this.popup,this.container))),this.resizeObserver.observe(this.popup),this.closeIcon.addEventListener("click",(()=>{if(this.resizeObserver.unobserve(this.popup),document.getElementById("wzrkImageOnlyDiv").style.display="none",this.remove(),null!=e&&"-1"!==e&&he._isLocalStorageSupported()){const i=ot();let o=i.wp[t];null==o&&(o={},i[t]=o),o[e]="dnd",nt(i)}})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId}),this.onClickUrl&&this.popup.addEventListener("click",(()=>{this.target.display.window?window.open(this.onClickUrl,"_blank"):window.parent.location.href=this.onClickUrl,window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})}))}handleResize(e,t){const i=this.getRenderedImageWidth(e);t.style.setProperty("width","".concat(i,"px"))}getImageOnlyPopupContent(){return"\n ".concat(this.target.msgContent.css,"\n ").concat(this.target.msgContent.html,"\n ")}updateImageAndContainerWidth(){return()=>{const e=this.getRenderedImageWidth(this.popup);this.popup.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("height","auto"),this.container.style.setProperty("position","fixed"),this.popup.style.setProperty("visibility","visible"),this.closeIcon.style.setProperty("visibility","visible"),document.getElementById("wzrkImageOnlyDiv").style.visibility="visible"}}getRenderedImageWidth(e){const t=e.naturalWidth/e.naturalHeight;return e.height*t}}class Nt extends HTMLElement{constructor(e,t){super(),this.wrapper=null,this.snackBar=null,this.shadow=this.attachShadow({mode:"open"}),this.config=e,this.message=t,this.renderMessage(t)}get pivotId(){return this.message.wzrk_pivot}get campaignId(){return this.message.wzrk_id}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}renderMessage(e){switch(this.wrapper=this.createEl("div","messageWrapper"),e.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":{const t=this.prepareBasicMessage(e.msg[0]);this.wrapper.appendChild(t)}}const t=this.createEl("div","timeStamp");if(t.innerHTML="".concat(Jt(e.id.split("_")[1]),""),!e.viewed){const e=this.createEl("span","unreadMarker");t.appendChild(e)}this.wrapper.appendChild(t),this.shadow.appendChild(this.wrapper)}prepareBasicMessage(e){const t=this.createEl("div","message");if(e.imageUrl){const i=this.addImage(e.imageUrl,"mainImg");t.appendChild(i)}const i=this.createEl("div","iconTitleDescWrapper");if(e.iconUrl){const t=this.addImage(e.iconUrl,"iconImg");i.appendChild(t)}const o=this.createEl("div","titleDescWrapper");if(e.title){const t=this.createEl("div","title");t.innerText=e.title,o.appendChild(t)}if(e.description){const t=this.createEl("div","description");t.innerText=e.description,o.appendChild(t)}if((e.title||e.description)&&i.appendChild(o),(e.iconUrl||e.title||e.description)&&t.appendChild(i),e.buttons&&e.buttons.length){const i=this.addButtons(e.buttons);t.appendChild(i)}return t}addButtons(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.createEl("div","buttonsContainer");let i=!1;return e.forEach(((e,o)=>{const n=this.createEl("button","button-".concat(o),"button");n.innerText=e.text,o>0&&(n.style.cssText+="margin-left: 2px;"),"copy"===e.action&&(i=!0),t.appendChild(n)})),i&&this.addSnackbar(t),t}addSnackbar(e){this.snackBar=this.createEl("div","snackbar-".concat(this.campaignId),"snackbar"),this.snackBar.innerHTML=Yt;const t=this.createEl("span","snackbar-msg-".concat(this.campaignId),"snackbar-msg");t.innerText="Copied to clipboard",this.snackBar.appendChild(t),e.appendChild(this.snackBar)}addImage(e,t){const i=this.createEl("div","".concat(t,"Container")),o=this.createEl("img",t);return o.setAttribute("src",e),o.setAttribute("loading","lazy"),i.appendChild(o),i}raiseClickedEvent(e,t){switch(this.message.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":this.raiseClickedForBasicTemplates(e,t)}}raiseClickedForBasicTemplates(e,t){const i=this.message.msg[0],o={msgId:this.campaignId,pivotId:this.pivotId};if("BUTTON"===e.tagName){const t=e.id.split("-")[1],n=i.buttons[t];o.kv={wzrk_c2a:n.text},"url"===n.action?n.openUrlInNewTab?window.open(n.url,"_blank"):window.location=n.url:"copy"===n.action&&(window.focus(),navigator.clipboard.writeText(n.clipboardText),this.snackBar.style.setProperty("display","flex","important"),setTimeout((()=>{this.snackBar.style.setProperty("display","none","important")}),2e3))}else"CT-INBOX-MESSAGE"===e.tagName&&i.onClickUrl&&(i.openUrlInNewTab?window.open(i.onClickUrl,"_blank"):window.location=i.onClickUrl);t?console.log("Notifiction clicked event will be raised at run time with payload ::",o):window.clevertap.renderNotificationClicked(o)}}class zt extends HTMLElement{constructor(e){super(),this.isInboxOpen=!1,this.isInboxFromFlutter=!1,this.selectedCategory=null,this.unviewedMessages={},this.unviewedCounter=0,this.isPreview=!1,this.inboxConfigForPreview={},this.inboxSelector=null,this.inbox=null,this.emptyInboxMsg=null,this.inboxCard=null,this.unviewedBadge=null,this.observer=null,this.selectedCategoryRef=null,this.addClickListenerOnDocument=(()=>e=>{if(e.composedPath().includes(this.inbox)){const t=e.path||e.composedPath&&e.composedPath();if(t.length){const e=t[0].id;if("closeInbox"===e)this.toggleInbox();else if(e.startsWith("category-"))this.prevCategoryRef=this.selectedCategoryRef,this.selectedCategoryRef=t[0],this.updateActiveCategory(t[0].innerText);else{const e=t.filter((e=>{var t;return(null===(t=e.id)||void 0===t?void 0:t.startsWith("button-"))||"CT-INBOX-MESSAGE"===e.tagName}));if(e.length){e[e.length-1].raiseClickedEvent(e[0],this.isPreview)}}}}else(this.inboxSelector.contains(e.target)||this.isInboxOpen)&&(this.isInboxFromFlutter?this.isInboxFromFlutter=!1:this.toggleInbox(e))})(),this.setBadgeStyle=e=>{null!==this.unviewedBadge&&(this.unviewedBadge.innerText=e>9?"9+":e,this.unviewedBadge.style.display=e>0?"flex":"none")},this.logger=e,this.shadow=this.attachShadow({mode:"open"})}get incomingMessages(){return[]}set incomingMessages(e){void 0===e&&(e=[]),e.length>0&&this.inbox&&this.updateInboxMessages(e)}get incomingMessagesForPreview(){return[]}set incomingMessagesForPreview(e){void 0===e&&(e=[]);const t={};e.length>0&&this.inbox&&(this.isPreview=!0,this.unviewedCounter=0,e.forEach((e=>{const i="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=i,t[i]=e,this.unviewedMessages[i]=e,this.unviewedCounter++})),this.buildUIForMessages(t),this.updateUnviewedBadgeCounter())}connectedCallback(){this.init()}init(){this.config=this.isPreview?this.inboxConfigForPreview:he.readFromLSorCookie(q)||{},0!==Object.keys(this.config).length&&(this.inboxSelector=document.getElementById(this.config.inboxSelector),null!==this.inboxSelector&&(this.config.styles.notificationsBadge?this.addUnviewedBadge():this.unviewedBadge&&this.unviewedBadge.remove(),this.createinbox(),document.removeEventListener("click",this.addClickListenerOnDocument),document.addEventListener("click",this.addClickListenerOnDocument),this.config.categories.length&&this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadow.innerHTML=this.getInboxStyles(),this.shadow.appendChild(this.inbox)))}addMsgsToInboxFromLS(){const e=this.deleteExpiredAndGetUnexpiredMsgs(!1),t=e?Object.keys(e):[];0!==t.length&&(t.forEach((t=>{e[t].viewed||(this.unviewedMessages[t]=e[t],this.unviewedCounter++)})),this.buildUIForMessages(e),this.updateUnviewedBadgeCounter())}deleteExpiredAndGetUnexpiredMsgs(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Vt();const i=Math.floor(Date.now()/1e3);for(const o in t)if(t[o].wzrk_ttl&&t[o].wzrk_ttl>0&&t[o].wzrk_ttl0&&(t=Object.values(t).sort(((e,t)=>t.date-e.date)).reduce(((e,t)=>(e[t.id]=t,e)),{})),Wt(t),t}updateInboxMessages(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.deleteExpiredAndGetUnexpiredMsgs(),i=Date.now(),o={};e.forEach(((e,n)=>{const s="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=s,e.date=i-n,e.viewed=0,t[s]=e,o[s]=e,this.unviewedMessages[s]=e,this.unviewedCounter++})),Wt(t),this.buildUIForMessages(o),this.updateUnviewedBadgeCounter()}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}addUnviewedBadge(){this.unviewedBadge||(this.unviewedBadge=this.createEl("div","unviewedBadge"),this.unviewedBadge.style.cssText="display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ".concat(this.config.styles.notificationsBadge.backgroundColor,"; font-size: 12px; color: ").concat(this.config.styles.notificationsBadge.textColor,"; font-weight: bold; align-items: center; justify-content: center;"),document.body.appendChild(this.unviewedBadge)),this.updateUnviewedBadgePosition(),window.addEventListener("resize",(()=>{this.updateUnviewedBadgePosition()}))}updateUnviewedBadgePosition(){const{top:e,right:t}=this.inboxSelector.getBoundingClientRect();this.unviewedBadge.style.top="".concat(e-8,"px"),this.unviewedBadge.style.left="".concat(t-8,"px")}createinbox(){this.inbox=this.createEl("div","inbox");const e=this.createEl("div","header"),t=this.createEl("div","headerTitle");t.innerText=this.config.title;const i=this.createEl("div","closeInbox");if(i.innerHTML="×",e.appendChild(t),e.appendChild(i),this.inbox.appendChild(e),this.config.categories.length){const e=this.createCategories();this.inbox.appendChild(e)}this.inboxCard=this.createEl("div","inboxCard"),this.inbox.appendChild(this.inboxCard),this.emptyInboxMsg=this.createEl("div","emptyInboxMsg"),this.emptyInboxMsg.innerText="All messages will be displayed here.",this.inboxCard.appendChild(this.emptyInboxMsg);const o={root:this.inboxCard,rootMargin:"0px",threshold:.5};this.observer=new IntersectionObserver(((e,t)=>{this.handleMessageViewed(e)}),o),this.addMsgsToInboxFromLS()}createCategories(){const e=this.createEl("div","categoriesContainer"),t=this.createEl("div","leftArrow");t.innerHTML=$t,t.children[0].style="transform: rotate(180deg)",t.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(-70,0)})),e.appendChild(t);const i=this.createEl("div","categoriesWrapper");["All",...this.config.categories].forEach(((e,t)=>{const o=this.createEl("div","category-".concat(t),"category");o.innerText=e,0===t&&(this.selectedCategoryRef=o),i.appendChild(o)})),e.appendChild(i);const o=this.createEl("div","rightArrow");o.innerHTML=$t,o.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(70,0)})),e.appendChild(o);const n={root:e,threshold:.9},s=i.children[0],r=i.children[this.config.categories.length];new IntersectionObserver((e=>{this.categoryObserverCb(t,e[0].intersectionRatio>=.9)}),n).observe(s);return new IntersectionObserver((e=>{this.categoryObserverCb(o,e[0].intersectionRatio>=.9)}),n).observe(r),e}categoryObserverCb(e,t){e&&(e.style.display=t?"none":"flex")}updateActiveCategory(e){this.selectedCategory=e,this.inboxCard.scrollTop=0;let t=0;this.prevCategoryRef&&this.prevCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef.setAttribute("selected","true"),this.inboxCard.childNodes.forEach((e=>{"emptyInboxMsg"!==e.getAttribute("id")&&(e.style.display="All"===this.selectedCategory||e.getAttribute("category")===this.selectedCategory?"block":"none","block"===e.style.display&&t++)})),0===t?(this.emptyInboxMsg.innerText="".concat(e," messages will be displayed here."),this.emptyInboxMsg.style.display="block"):this.emptyInboxMsg.style.display="none"}buildUIForMessages(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!this.isPreview&&this.updateTSForRenderedMsgs(),this.inboxCard.scrollTop=0;const i=null!==(e=this.config.maxMsgsInInbox)&&void 0!==e?e:15,o=this.inboxCard.firstChild,n=Object.values(t).sort(((e,t)=>t.date-e.date)).map((e=>e.id));for(const e of n){const i=new Nt(this.config,t[e]);i.setAttribute("id",t[e].id),i.setAttribute("pivot",t[e].wzrk_pivot),i.setAttribute("part","ct-inbox-message"),this.config.categories.length>0?(i.setAttribute("category",t[e].tags[0]||""),i.style.display="All"===this.selectedCategory||t[e].category===this.selectedCategory?"block":"none"):i.style.display="block",this.inboxCard.insertBefore(i,o),this.observer.observe(i)}let s=this.inboxCard.querySelectorAll("ct-inbox-message").length;for(;s>i;){const e=this.inboxCard.querySelectorAll("ct-inbox-message");e.length>0&&e[e.length-1].remove(),s--}const r=this.inboxCard.querySelectorAll('ct-inbox-message[style*="display: block"]').length;this.emptyInboxMsg.style.display=r?"none":"block"}handleMessageViewed(e){const t=!this.isPreview;this.isInboxOpen&&e.forEach((e=>{e.isIntersecting&&this.unviewedMessages.hasOwnProperty(e.target.id)&&0===e.target.message.viewed&&(e.target.message.viewed=1,t?(window.clevertap.renderNotificationViewed({msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.updateMessageInLS(e.target.id,{...e.target.message,viewed:1}),setTimeout((()=>{e.target.shadowRoot.getElementById("unreadMarker").style.display="none"}),1e3)):console.log("Notifiction viewed event will be raised at run time with payload ::",{msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.unviewedCounter--,this.updateUnviewedBadgeCounter(),delete this.unviewedMessages[e.target.id])}))}updateMessageInLS(e,t){if(!this.isPreview){const i=Vt();i[e]=t,Wt(i)}}toggleInbox(e){this.isInboxOpen=!this.isInboxOpen,this.isInboxFromFlutter=!!(null==e?void 0:e.rect),this.isInboxOpen?(this.inboxCard.scrollTop=0,!this.isPreview&&this.deleteExpiredAndGetUnexpiredMsgs(),this.inbox.style.display="block",this.inbox.style.zIndex="2147483647",this.config.categories.length&&(this.selectedCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef=this.shadowRoot.getElementById("category-0"),this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadowRoot.getElementById("categoriesWrapper").scrollLeft-=this.shadowRoot.getElementById("categoriesWrapper").scrollWidth),this.setInboxPosition(e)):this.inbox.style.display="none"}setInboxPosition(e){const t=window.outerWidth,i=getComputedStyle(ue.inbox),o=i.getPropertyValue("--inbox-top"),n=i.getPropertyValue("--inbox-bottom"),s=i.getPropertyValue("--inbox-left"),r=i.getPropertyValue("--inbox-right");if(t>481&&!(o||n||s||r)){const t=Gt(e,this.inbox.clientHeight,this.inbox.clientWidth),i=t.xPos,o=t.yPos;this.inbox.style.top=o+"px",this.inbox.style.left=i+"px"}}updateUnviewedBadgeCounter(){if(this.isPreview)return void this.setBadgeStyle(this.unviewedCounter);let e=0;this.inboxCard.querySelectorAll("ct-inbox-message").forEach((t=>{const i=Vt();i[t.id]&&0===i[t.id].viewed&&e++})),this.setBadgeStyle(e)}updateTSForRenderedMsgs(){this.inboxCard.querySelectorAll("ct-inbox-message").forEach((e=>{const t=e.id.split("_")[1];e.shadow.getElementById("timeStamp").firstChild.innerText=Jt(t)}))}getInboxStyles(){const e=this.config.categories.length?64:16,t={panelBackgroundColor:this.config.styles.panelBackgroundColor,panelBorderColor:this.config.styles.panelBorderColor,headerBackgroundColor:this.config.styles.header.backgroundColor,headerTitleColor:this.config.styles.header.titleColor,closeIconColor:this.config.styles.closeIconColor,categoriesTabColor:this.config.styles.categories.tabColor,categoriesTitleColor:this.config.styles.categories.titleColor,selectedCategoryTabColor:this.config.styles.categories.selectedTab.tabColor,selectedCategoryTitleColor:this.config.styles.categories.selectedTab.titleColor,headerCategoryHeight:36+e};this.config.styles.categories.borderColor&&(t.categoriesBorderColor=this.config.styles.categories.borderColor),this.config.styles.categories.selectedTab.borderColor&&(t.selectedCategoryBorderColor=this.config.styles.categories.selectedTab.borderColor);const i=(e=>{let{panelBackgroundColor:t,panelBorderColor:i,headerBackgroundColor:o,headerTitleColor:n,closeIconColor:s,categoriesTabColor:r,categoriesTitleColor:a,categoriesBorderColor:l,selectedCategoryTabColor:d,selectedCategoryTitleColor:c,selectedCategoryBorderColor:h,headerCategoryHeight:u}=e;return'\n \n ")})(t),o=this.config.styles.cards;return i+(e=>{let{backgroundColor:t,borderColor:i,titleColor:o,descriptionColor:n,buttonColor:s,buttonTextColor:r,unreadMarkerColor:a}=e;return'\n \n ")})({backgroundColor:o.backgroundColor,borderColor:o.borderColor,titleColor:o.titleColor,descriptionColor:o.descriptionColor,buttonColor:o.buttonColor,buttonTextColor:o.buttonTextColor,unreadMarkerColor:o.unreadMarkerColor})}}const Ut=e=>{e.inbox_preview?ue.inbox.incomingMessagesForPreview=e.inbox_notifs:ue.inbox.incomingMessages=e},Ft=e=>{Ht(),ue.inbox=new zt({logger:e}),document.body.appendChild(ue.inbox)},qt=e=>{const t=he.readFromLSorCookie(V)||{};if(Object.keys(t).length>0&&Object.keys(t)[0].includes("_")){const i={};return i[e]=t,he.saveToLSorCookie(V,i),i}return t},Vt=()=>{const e=JSON.parse(decodeURIComponent(he.read(b)));if(!oe(e))return{};const t=qt(e);return t.hasOwnProperty(e)?t[e]:{}},Wt=e=>{const t=JSON.parse(decodeURIComponent(he.read(b)));if(!oe(t))return;const i={...qt(t),[t]:e};he.saveToLSorCookie(V,i)},Kt=e=>new Promise(((t,i)=>{if("complete"===document.readyState)Ft(e),t();else{const i=he.readFromLSorCookie(q)||{},o=()=>{null===ue.inbox&&Ft(e),t()};window.addEventListener("load",(()=>{if(document.getElementById(i.inboxSelector))o();else{let n=0;if(n<20){const s=setInterval((()=>{document.getElementById(i.inboxSelector)?(o(),clearInterval(s),t()):n>=20&&(clearInterval(s),e.debug("Failed to add inbox")),n++}),500)}}}))}})),Ht=()=>{void 0===customElements.get("ct-web-inbox")&&(customElements.define("ct-web-inbox",zt),customElements.define("ct-inbox-message",Nt))},Gt=(e,t,i)=>{const o=document.scrollingElement.scrollLeft,n=document.scrollingElement.scrollTop,s=window.innerWidth+o,r=window.innerHeight+n,a=e.rect||e.target.getBoundingClientRect(),l=a.x+o,d=a.y+n,c=a.left+o,h=a.right+o,u=a.top+n,p=a.bottom,g=a.height,v=a.width;let f,b,m=!1;const y=16;if(p+t<=r){const e=r-(p+t);b=e>=y?p+y:p+e}else if(u-t>=n){const e=u-t;b=e>=y?u-t-y:u-t-e}else m=!0,b=d+g/2-t/2,br&&(b=r-t);if(m){const e=h+i;if(e<=s){f=h+(e+y<=s?y:s-e)}else{const e=c-i;f=e-(e-y>=o?y:e-o)}}else f=l+v/2-i/2,fs&&(f=h-i>=o?h-i:s-i);return{xPos:f,yPos:b}},Jt=e=>{const t=Date.now();let i=Math.floor((t-e)/6e4);return i<5?"Just now":i<60?"".concat(i," minute").concat(i>1?"s":""," ago"):(i=Math.floor(i/60),i<24?"".concat(i," hour").concat(i>1?"s":""," ago"):(i=Math.floor(i/24),"".concat(i," day").concat(i>1?"s":""," ago")))},Zt=()=>Object.keys(he.readFromLSorCookie(q)||{}).length>0,$t='\n\n\n',Yt='\n\n\n',Qt="https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js",Xt="https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css",ei=e=>{var t,i;e.data&&e.data.message&&("Dashboard"===e.data.message&&e.data.url?ti(e.data.url,null!==(t=e.data.variant)&&void 0!==t?t:null,null!==(i=e.data.details)&&void 0!==i?i:{}):"Overlay"===e.data.message&&oi(e.data,!0))},ti=(e,t,i)=>{document.addEventListener("DOMContentLoaded",(()=>function(e,t,i){document.body.innerHTML="",ii=document.createElement("div"),ii.id="overlayDiv",ii.style.position="relative",ii.style.display="flex",document.body.appendChild(ii);(function(e,t,i,o){return new Promise(((n,s)=>{var r=document.createElement("script");r.type="module",r.src=e,r.onload=function(){"function"==typeof window.Overlay?(window.Overlay({id:"#overlayDiv",url:t,variant:i,details:o}),n()):s(new Error("ContentLayout not found in overlay.js"))},r.onerror=function(e){s(e)},document.head.appendChild(r)}))})(Qt,e,t,i).then((()=>{console.log("Overlay script loaded successfully.")})).catch((e=>{console.error("Error loading overlay script:",e)})),o=document.createElement("link"),o.rel="stylesheet",o.type="text/css",o.href=Xt,document.head.appendChild(o),function(){const e={kitId:"eqj6nom",scriptTimeout:3e3,async:!0},t=document.documentElement,i=setTimeout((function(){t.className=t.className.replace(/\bwf-loading\b/g,"")+" wf-inactive"}),e.scriptTimeout),o=document.createElement("script");let n=!1;const s=document.getElementsByTagName("script")[0];let r;t.className+=" wf-loading",o.src="https://use.typekit.net/"+e.kitId+".js",o.async=!0,o.onload=o.onreadystatechange=function(){if(r=this.readyState,!(n||r&&"complete"!==r&&"loaded"!==r)){n=!0,clearTimeout(i);try{Typekit.load(e)}catch(e){}}},s.parentNode.insertBefore(o,s)}();var o}(e,t,i)))};let ii;const oi=(e,t)=>{const i=t?e.details[0]:e.display.details[0],o=Object.keys(i)[0],n=i[o];if(o===window.location.href.split("?")[0])for(const i in n){const o=document.querySelector(i);if(o)n[i].html?o.outerHTML=n[i].html:ni(e,n[i]),t||window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot});else{let o=0;const s=setInterval((()=>{const r=document.querySelector(i);r?(n[i].html?r.outerHTML=n[i].html:ni(e,n[i]),t||window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot}),clearInterval(s)):(o++,o>=20&&(console.log("No element present on DOM with selector '".concat(i,"'.")),clearInterval(s)))}),500)}}};function ni(e,t){const i={};i.msgId=e.wzrk_id,e.wzrk_pivot&&(i.pivotId=e.wzrk_pivot),null!=t.json&&(i.json=t.json);const o=new CustomEvent("CT_web_native_display_buider",{detail:i});document.dispatchEvent(o)}const si=e=>{const t=e.indexOf("\n `\n return html.replace(/(<\\s*\\/\\s*body)/, `${script}\\n$1`)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n const displayObj = targetingMsgJson.display\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = WIZ_IFRAME_INTENT\n let html = targetingMsgJson.msgContent.html\n if (displayObj['custom-editor'] && !displayObj['bee-editor'] && displayObj['custom-html-sandbox']) { // sandbox the iframe only for custom html\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox allow-forms' // allow popup to open url in new page\n html = ctEventhandler(html)\n }\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (targetingMsgJson.display['custom-editor'] && !targetingMsgJson.display['bee-editor'] && targetingMsgJson.display['custom-html-sandbox']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n let contentDiv\n iframe.onload = () => {\n if (targetingMsgJson.display['custom-editor'] && !targetingMsgJson.display['bee-editor'] && targetingMsgJson.display['custom-html-sandbox']) {\n window.addEventListener('message', event => {\n switch (event?.data?.action) {\n case GET_NOTIFICATION_DATA:\n window.clevertap.renderNotificationClicked(event.data.value)\n break\n case EVENT:\n window.clevertap.event.push(event.data.value)\n break\n case PROFILE:\n window.clevertap.profile.push(event.data.value)\n break\n case OUL:\n window.clevertap.onUserLogin.push(event.data.value)\n break\n case CLOSE_INTERSTITIAL_POPUP:\n setTimeout(() => {\n const interstitialWrapper = window.document.getElementById('intentPreview')\n const interstitialOverlay = window.document.getElementById('intentOpacityDiv')\n interstitialOverlay && interstitialOverlay.remove()\n interstitialWrapper && interstitialWrapper.remove()\n }, 0)\n break\n default:\n // Handle unknown action\n break\n }\n })\n contentDiv = ''\n } else {\n contentDiv = document.getElementById(WIZ_IFRAME_INTENT).contentDocument.getElementById('contentDiv')\n }\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n this.#logger.error('Error subscribing: ' + error)\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { checkBuilder } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token) {\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n checkBuilder(this.#logger)\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n pageChanged () {\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","constructor","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","dataPostPEURL","dataPostURL","recorderURL","emailURL","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","WIZ_IFRAME","WIZ_IFRAME_INTENT","ADJUST_IFRAME_HEIGHT","UPDATE_HEIGHT","GET_NOTIFICATION","EVENT","PROFILE","OUL","CLOSE_BOX_POPUP","CLOSE_BANNER_POPUP","GET_NOTIFICATION_DATA","CLOSE_INTERSTITIAL_POPUP","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","save","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","read","data","getItem","parse","e","remove","removeItem","removeCookie","name","domain","cookieStr","document","cookie","createCookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","readCookie","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","saveToLSorCookie","property","location","hostname","$ct","globalCache","readFromLSorCookie","trim","err","createBroadCookie","broadDomain","domainParts","testBroadDomain","testCookieName","tempCookie","getMetaProp","metaObj","setMetaProp","wzrkMetaObj","getAndClearMetaProp","setInstantDeleteFlagInK","k","flag","backupEvent","reqNo","backupArr","q","debug","removeBackup","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","get","item","saveCacheToLS","set","allKeys","objToArray","index","temp","getKey","getSecondLastKey","keysArr","getLastKey","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","s","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","sessionObj","getSessionCookieObject","kIdFromLS","guidFromLRUCache","lastK","lastGUID","unregisterTokenForGuid","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","_processOldValues","getDetails","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","fireRequest","skipARP","sendOULFlag","getDelayFrequency","account","randomDelay","random","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","ProfileHandler","profilesArr","getAttribute","propName","_handleIncrementDecrementValue","command","tz","profile","addSystemDataToObject","addFlags","compressedData","saveAndFireRequest","_handleMultiValueSet","arrayVal","array","toLowerCase","sendMultiValueData","_handleMultiValueAdd","propKey","propVal","_handleMultiValueRemove","_handleMultiValueDelete","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","clear","addToK","ids","g","kId","anonymousUser","foundInCache","gFromCache","Identity","cookieName","loginArr","pop","processProfile","CTWebPersonalisationBanner","HTMLElement","_details","shadow","attachShadow","mode","details","renderBanner","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","target","renderCarousel","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","button","setInterval","sliderTime","goTo","prev","cur","CTWebPopupImageOnly","_session","popup","container","resizeObserver","renderImageOnlyPopup","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","Message","config","message","wrapper","snackBar","renderMessage","createEl","part","_el","msg","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","raiseClickedEvent","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","contains","setBadgeStyle","msgCount","incomingMessages","msgs","updateInboxMessages","incomingMessagesForPreview","previewMsgs","now","buildUIForMessages","updateUnviewedBadgeCounter","connectedCallback","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","addMsgsToInboxFromLS","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","deleteMsgsFromUI","getInboxMessages","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","top","right","getBoundingClientRect","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","inbox_notifs","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","OVERLAY_PATH","CSS_PATH","checkBuilder","parentWindow","opener","handleMessageEvent","postMessage","initialiseCTBuilder","variant","renderVisualBuilder","onContentLoad","position","overlayPath","loadOverlayScript","then","catch","loadCSS","loadTypeKit","link","rel","head","script","src","onload","Overlay","Error","onerror","kitId","scriptTimeout","docElement","documentElement","timeoutId","className","typeKitScript","scriptLoaded","firstScript","scriptReadyState","onreadystatechange","Typekit","load","targetingMsgJson","siteUrl","selectors","selector","element","querySelector","outerHTML","dispatchJsonData","intervalId","retryElement","inaObj","json","kvPairsEvent","CustomEvent","dispatchEvent","ctEventhandler","ctScript","insertPosition","join","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","onclick","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","sandbox","pointerCss","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","closeCampaign","Event","appendScriptForCustomEvent","srcdoc","handleMessage","heightAdjust","boxWrapper","bannerWrapper","margin","onUserLogin","handleIframeLoad","contentWindow","contentDocument","scrollHeight","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","interstitialWrapper","interstitialOverlay","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","getTotalVisits","visitCount","getLastVisit","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","info","debugPE","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","getTimeElapsed","sessionStart","getPageCount","seqNo","requestTime","RequestManager","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","post","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","_enableWebPush","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","skipDialog","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","getValue","getdefaultValue","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","addValueChangedCallback","removeValueChangedCallback","clearStartFlag","VariableStore","syncVariables","onSyncSuccess","onSyncFailure","meta","tk","r","status","fetchVariables","onFetchCallback","addVariablesChangedCallback","callback","addOneTimeVariablesChangedCallback","removeVariablesChangedCallback","removeOneTimeVariablesChangedCallback","callBack","CleverTap","spa","isSpa","bind","enablePersonalization","_isPersonalisationActive","ReqestManager","privacy","notifications","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","handleDecrementValue","setMultiValuesForKey","addMultiValueForKey","addMultiValuesForKey","removeMultiValueForKey","removeMultiValuesForKey","removeValueForKey","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","sendLocationData","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","elements","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","setOffline","arg","defineVariable","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;EAAO,MAAMA,aAAa,GAAG,oBAAtB;EACA,MAAMC,eAAe,GAAG,QAAxB;EACA,MAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;ECAQ,MAAMC,OAAN,CAAc;EAO3BC,EAAAA,WAAW,GAAsE;EAAA,QAApE;EAAEC,MAAAA;EAAF,KAAoE,uEAA3D,EAA2D;EAAA,QAAvDC,MAAuD,uEAA9C,EAA8C;EAAA,QAA1CC,YAA0C,uEAA3BP,aAA2B;EAAA,QAAZQ,KAAY,uEAAJ,EAAI;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,aALvE;EAKuE;EAAA;EAAA;EAAA,aAJjER;EAIiE;EAAA;EAAA;EAAA,aAHjE;EAGiE;EAAA;EAAA;EAAA,aAFxE;EAEwE;EAC/E,SAAKK,EAAL,GAAUA,EAAV;;EACA,QAAIC,MAAJ,EAAY;EACV,WAAKA,MAAL,GAAcA,MAAd;EACD;;EACD,QAAIC,YAAJ,EAAkB;EAChB,WAAKA,YAAL,GAAoBA,YAApB;EACD;;EACD,QAAIC,KAAJ,EAAW;EACT,WAAKA,KAAL,GAAaA,KAAb;EACD;EACF;;EAED,MAAIH,EAAJ,GAAU;EACR,uCAAO,IAAP;EACD;;EAED,MAAIA,EAAJ,CAAQI,SAAR,EAAmB;EACjB,gEAAkBA,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;EACD;;yDAMmBntC,MAAM;EACxB,MAAI,KAAKwmC,wBAAL,EAAJ,EAAqC;EACnCxmC,IAAAA,IAAI,CAACk/B,KAAL,GAAa,IAAb;EACD;EACF;;QC9vBGxvB,SAAS,GAAG,IAAI09B,SAAJ,CAAcxrC,MAAM,CAAC8N,SAArB;EAElB9N,MAAM,CAAC8N,SAAP,GAAmB9N,MAAM,CAAC+N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/modules/visualBuilder/builder_constants.js","src/modules/visualBuilder/pageBuilder.js","src/util/clevertap-handler.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/notification.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\nexport const WIZ_IFRAME = 'wiz-iframe'\nexport const WIZ_IFRAME_INTENT = 'wiz-iframe-intent'\nexport const ADJUST_IFRAME_HEIGHT = 'adjustIFrameHeight'\nexport const UPDATE_HEIGHT = 'update height'\nexport const GET_NOTIFICATION = 'getnotif'\nexport const EVENT = 'Event'\nexport const PROFILE = 'Profile'\nexport const OUL = 'OUL'\nexport const CLOSE_BOX_POPUP = 'closeBoxPopUp'\nexport const CLOSE_BANNER_POPUP = 'closeBannerPopUp'\nexport const GET_NOTIFICATION_DATA = 'getnotifData'\nexport const CLOSE_INTERSTITIAL_POPUP = 'closeInterstitialPopUp'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {}\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n // Initialize array\n var array = []\n\n // Check if globalProfileMap is null, initialize if needed\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n // Check if the value to be set is either string or number\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = $ct.globalProfileMap[propKey]\n array.push(typeof propVal === 'number' ? propVal : propVal.toLowerCase())\n } else {\n $ct.globalProfileMap[propKey] = propVal\n }\n } else {\n // Check if propVal is an array\n if ($ct.globalProfileMap.hasOwnProperty(propKey)) {\n array = Array.isArray($ct.globalProfileMap[propKey]) ? $ct.globalProfileMap[propKey] : [$ct.globalProfileMap[propKey]]\n }\n\n // Check for case-sensitive inputs and filter the same ones\n for (var i = 0; i < propVal.length; i++) {\n if (typeof propVal[i] === 'number' && !array.includes(propVal[i])) {\n array.push(propVal[i])\n } else if (typeof propVal[i] === 'string' && !array.includes(propVal[i].toLowerCase())) {\n array.push(propVal[i].toLowerCase())\n } else if ((typeof propVal[i] === 'number' && array.includes(propVal[i])) || (typeof propVal[i] === 'string' && array.includes(propVal[i].toLowerCase()))) {\n console.error('Values already included')\n } else {\n console.error('Array supports only string or number type values')\n }\n }\n\n // Update globalProfileMap with the array\n $ct.globalProfileMap[propKey] = array\n }\n\n // Save to local storage or cookie\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Call the sendMultiValueData function\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n if (typeof propVal === 'string' || typeof propVal === 'number') {\n var index = $ct.globalProfileMap[propKey].indexOf(propVal)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n } else {\n for (var k = 0; k < propVal.length; k++) {\n var idx = $ct.globalProfileMap[propKey].indexOf(propVal[k])\n if (idx !== -1) {\n $ct.globalProfileMap[propKey].splice(idx, 1)\n }\n }\n }\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n console.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n // console.log('Raise notification clicked event for ', item)\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","export const OVERLAY_PATH = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js'\nexport const CSS_PATH = 'https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css'\n","import { CSS_PATH, OVERLAY_PATH } from './builder_constants'\n\nexport const checkBuilder = (logger) => {\n const search = window.location.search\n const parentWindow = window.opener\n\n if (search === '?ctBuilder') {\n // open in visual builder mode\n logger.debug('open in visual builder mode')\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('builder', '*')\n }\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage('preview', '*')\n }\n }\n}\n\nconst handleMessageEvent = (event) => {\n if (event.data && event.data.message) {\n if (event.data.message === 'Dashboard' && event.data.url) {\n initialiseCTBuilder(event.data.url, event.data.variant ?? null, event.data.details ?? {})\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n }\n}\n/**\n * Initializes the Clevertap builder.\n * @param {string} url - The URL to initialize the builder.\n * @param {string} variant - The variant of the builder.\n * @param {Object} details - The details object.\n */\nconst initialiseCTBuilder = (url, variant, details) => {\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', () => onContentLoad(url, variant, details))\n } else {\n onContentLoad(url, variant, details)\n }\n}\n\nlet container\nlet contentLoaded = false\n/**\n * Handles content load for Clevertap builder.\n */\nfunction onContentLoad (url, variant, details) {\n if (!contentLoaded) {\n document.body.innerHTML = ''\n container = document.createElement('div')\n container.id = 'overlayDiv'\n container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form\n container.style.display = 'flex'\n document.body.appendChild(container)\n const overlayPath = OVERLAY_PATH\n loadOverlayScript(overlayPath, url, variant, details)\n .then(() => {\n console.log('Overlay script loaded successfully.')\n contentLoaded = true\n })\n .catch((error) => {\n console.error('Error loading overlay script:', error)\n })\n loadCSS()\n loadTypeKit()\n }\n}\n\n/**\n * Loads CSS file.\n */\nfunction loadCSS () {\n var link = document.createElement('link')\n link.rel = 'stylesheet'\n link.type = 'text/css'\n link.href = CSS_PATH\n document.head.appendChild(link)\n}\n\n/**\n * Loads the overlay script.\n * @param {string} overlayPath - The path to overlay script.\n * @param {string} url - The URL.\n * @param {string} variant - The variant.\n * @param {Object} details - The details object.\n * @returns {Promise} A promise.\n */\nfunction loadOverlayScript (overlayPath, url, variant, details) {\n return new Promise((resolve, reject) => {\n var script = document.createElement('script')\n script.type = 'module'\n script.src = overlayPath\n script.onload = function () {\n if (typeof window.Overlay === 'function') {\n window.Overlay({ id: '#overlayDiv', url, variant, details })\n resolve()\n } else {\n reject(new Error('ContentLayout not found in overlay.js'))\n }\n }\n script.onerror = function (error) {\n reject(error)\n }\n document.head.appendChild(script)\n })\n}\n\n/**\n * Loads TypeKit script.\n */\nfunction loadTypeKit () {\n const config = {\n kitId: 'eqj6nom',\n scriptTimeout: 3000,\n async: true\n }\n\n const docElement = document.documentElement\n const timeoutId = setTimeout(function () {\n docElement.className = docElement.className.replace(/\\bwf-loading\\b/g, '') + ' wf-inactive'\n }, config.scriptTimeout)\n const typeKitScript = document.createElement('script')\n let scriptLoaded = false\n const firstScript = document.getElementsByTagName('script')[0]\n let scriptReadyState\n\n docElement.className += ' wf-loading'\n typeKitScript.src = 'https://use.typekit.net/' + config.kitId + '.js'\n typeKitScript.async = true\n typeKitScript.onload = typeKitScript.onreadystatechange = function () {\n scriptReadyState = this.readyState\n if (scriptLoaded || (scriptReadyState && scriptReadyState !== 'complete' && scriptReadyState !== 'loaded')) return\n scriptLoaded = true\n clearTimeout(timeoutId)\n try {\n // eslint-disable-next-line no-undef\n Typekit.load(config)\n } catch (e) {}\n }\n\n firstScript.parentNode.insertBefore(typeKitScript, firstScript)\n}\n\n/**\n * Renders the visual builder.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {boolean} isPreview - Indicates if it's a preview.\n */\nexport const renderVisualBuilder = (targetingMsgJson, isPreview) => {\n const details = isPreview ? targetingMsgJson.details[0] : targetingMsgJson.display.details[0]\n const siteUrl = Object.keys(details)[0]\n const selectors = details[siteUrl]\n\n if (siteUrl === window.location.href.split('?')[0]) {\n for (const selector in selectors) {\n const element = document.querySelector(selector)\n if (element) {\n if (selectors[selector].html) {\n element.outerHTML = selectors[selector].html\n } else {\n // Update json data\n dispatchJsonData(targetingMsgJson, selectors[selector])\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n } else {\n let count = 0\n const intervalId = setInterval(() => {\n const retryElement = document.querySelector(selector)\n if (retryElement) {\n if (selectors[selector].html) {\n retryElement.outerHTML = selectors[selector].html\n } else {\n // Update json data\n dispatchJsonData(targetingMsgJson, selectors[selector])\n }\n if (!isPreview) {\n window.clevertap.renderNotificationViewed({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n clearInterval(intervalId)\n } else {\n count++\n if (count >= 20) {\n console.log(`No element present on DOM with selector '${selector}'.`)\n clearInterval(intervalId)\n }\n }\n }, 500)\n }\n }\n }\n}\n\n/**\n * Dispatches JSON data.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {Object} selector - The selector object.\n */\nfunction dispatchJsonData (targetingMsgJson, selector) {\n const inaObj = {}\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (selector.json != null) {\n inaObj.json = selector.json\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display_buider', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n}\n","// clevertap-handler.js\n\nconst ctEventhandler = (html) => {\n const ctScript = `\n var clevertap = {\n event: {\n push: (eventName) => {\n window.parent.postMessage({\n action: 'Event',\n value: eventName\n },'*');\n }\n },\n profile: {\n push: (eventName) => {\n window.parent.postMessage({\n action: 'Profile',\n value: eventName\n },'*');\n }\n },\n onUserLogin: {\n push: (eventName) => {\n window.parent.postMessage({\n action: 'OUL',\n value: eventName\n },'*');\n }\n },\n closeBoxPopUp: () => {\n window.parent.postMessage({\n action: 'closeBoxPopUp',\n value: 'closeBoxPopUp'\n },'*');\n },\n closeBannerPopUp: () => {\n window.parent.postMessage({\n action: 'closeBannerPopUp',\n value: 'closeBannerPopUp'\n },'*');\n },\n closeInterstitialPopUp: () => {\n window.parent.postMessage({\n action: 'closeInterstitialPopUp',\n value: 'closeInterstitialPopUp'\n },'*');\n }\n }\n `\n const insertPosition = html.indexOf('\n `\n return html.replace(/(<\\s*\\/\\s*body)/, `${script}\\n$1`)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n const displayObj = targetingMsgJson.display\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = WIZ_IFRAME_INTENT\n let html = targetingMsgJson.msgContent.html\n if (displayObj['custom-editor'] && !displayObj['bee-editor'] && displayObj['custom-html-sandbox']) { // sandbox the iframe only for custom html\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox allow-forms' // allow popup to open url in new page\n html = ctEventhandler(html)\n }\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (targetingMsgJson.display['custom-editor'] && !targetingMsgJson.display['bee-editor'] && targetingMsgJson.display['custom-html-sandbox']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n let contentDiv\n iframe.onload = () => {\n if (targetingMsgJson.display['custom-editor'] && !targetingMsgJson.display['bee-editor'] && targetingMsgJson.display['custom-html-sandbox']) {\n window.addEventListener('message', event => {\n switch (event?.data?.action) {\n case GET_NOTIFICATION_DATA:\n window.clevertap.renderNotificationClicked(event.data.value)\n break\n case EVENT:\n window.clevertap.event.push(event.data.value)\n break\n case PROFILE:\n window.clevertap.profile.push(event.data.value)\n break\n case OUL:\n window.clevertap.onUserLogin.push(event.data.value)\n break\n case CLOSE_INTERSTITIAL_POPUP:\n setTimeout(() => {\n const interstitialWrapper = window.document.getElementById('intentPreview')\n const interstitialOverlay = window.document.getElementById('intentOpacityDiv')\n interstitialOverlay && interstitialOverlay.remove()\n interstitialWrapper && interstitialWrapper.remove()\n }, 0)\n break\n default:\n // Handle unknown action\n break\n }\n })\n contentDiv = ''\n } else {\n contentDiv = document.getElementById(WIZ_IFRAME_INTENT).contentDocument.getElementById('contentDiv')\n }\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n this.#logger.error('Error subscribing: ' + error)\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { checkBuilder } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token) {\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n checkBuilder(this.#logger)\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n pageChanged () {\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","constructor","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","dataPostPEURL","dataPostURL","recorderURL","emailURL","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","WIZ_IFRAME","WIZ_IFRAME_INTENT","ADJUST_IFRAME_HEIGHT","UPDATE_HEIGHT","GET_NOTIFICATION","EVENT","PROFILE","OUL","CLOSE_BOX_POPUP","CLOSE_BANNER_POPUP","GET_NOTIFICATION_DATA","CLOSE_INTERSTITIAL_POPUP","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","save","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","read","data","getItem","parse","e","remove","removeItem","removeCookie","name","domain","cookieStr","document","cookie","createCookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","readCookie","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","saveToLSorCookie","property","location","hostname","$ct","globalCache","readFromLSorCookie","trim","err","createBroadCookie","broadDomain","domainParts","testBroadDomain","testCookieName","tempCookie","getMetaProp","metaObj","setMetaProp","wzrkMetaObj","getAndClearMetaProp","setInstantDeleteFlagInK","k","flag","backupEvent","reqNo","backupArr","q","debug","removeBackup","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","get","item","saveCacheToLS","set","allKeys","objToArray","index","temp","getKey","getSecondLastKey","keysArr","getLastKey","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","s","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","sessionObj","getSessionCookieObject","kIdFromLS","guidFromLRUCache","lastK","lastGUID","unregisterTokenForGuid","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","_processOldValues","getDetails","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","fireRequest","skipARP","sendOULFlag","getDelayFrequency","account","randomDelay","random","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","ProfileHandler","profilesArr","getAttribute","propName","_handleIncrementDecrementValue","command","tz","profile","addSystemDataToObject","addFlags","compressedData","saveAndFireRequest","_handleMultiValueSet","arrayVal","array","toLowerCase","sendMultiValueData","_handleMultiValueAdd","propKey","propVal","_handleMultiValueRemove","_handleMultiValueDelete","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","clear","addToK","ids","g","kId","anonymousUser","foundInCache","gFromCache","Identity","cookieName","loginArr","pop","processProfile","CTWebPersonalisationBanner","HTMLElement","_details","shadow","attachShadow","mode","details","renderBanner","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","target","renderCarousel","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","button","setInterval","sliderTime","goTo","prev","cur","CTWebPopupImageOnly","_session","popup","container","resizeObserver","renderImageOnlyPopup","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","Message","config","message","wrapper","snackBar","renderMessage","createEl","part","_el","msg","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","raiseClickedEvent","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","contains","setBadgeStyle","msgCount","incomingMessages","msgs","updateInboxMessages","incomingMessagesForPreview","previewMsgs","now","buildUIForMessages","updateUnviewedBadgeCounter","connectedCallback","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","addMsgsToInboxFromLS","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","deleteMsgsFromUI","getInboxMessages","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","top","right","getBoundingClientRect","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","inbox_notifs","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","OVERLAY_PATH","CSS_PATH","checkBuilder","parentWindow","opener","handleMessageEvent","postMessage","initialiseCTBuilder","variant","renderVisualBuilder","onContentLoad","contentLoaded","position","overlayPath","loadOverlayScript","then","catch","loadCSS","loadTypeKit","link","rel","head","script","src","onload","Overlay","Error","onerror","kitId","scriptTimeout","docElement","documentElement","timeoutId","className","typeKitScript","scriptLoaded","firstScript","scriptReadyState","onreadystatechange","Typekit","load","targetingMsgJson","siteUrl","selectors","selector","element","querySelector","outerHTML","dispatchJsonData","intervalId","retryElement","inaObj","json","kvPairsEvent","CustomEvent","dispatchEvent","ctEventhandler","ctScript","insertPosition","join","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","onclick","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","sandbox","pointerCss","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","closeCampaign","Event","appendScriptForCustomEvent","srcdoc","handleMessage","heightAdjust","boxWrapper","bannerWrapper","margin","onUserLogin","handleIframeLoad","contentWindow","contentDocument","scrollHeight","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","interstitialWrapper","interstitialOverlay","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","getTotalVisits","visitCount","getLastVisit","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","info","debugPE","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","getTimeElapsed","sessionStart","getPageCount","seqNo","requestTime","RequestManager","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","post","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","_enableWebPush","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","skipDialog","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","getValue","getdefaultValue","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","addValueChangedCallback","removeValueChangedCallback","clearStartFlag","VariableStore","syncVariables","onSyncSuccess","onSyncFailure","meta","tk","r","status","fetchVariables","onFetchCallback","addVariablesChangedCallback","callback","addOneTimeVariablesChangedCallback","removeVariablesChangedCallback","removeOneTimeVariablesChangedCallback","callBack","CleverTap","spa","isSpa","bind","enablePersonalization","_isPersonalisationActive","ReqestManager","privacy","notifications","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","handleDecrementValue","setMultiValuesForKey","addMultiValueForKey","addMultiValuesForKey","removeMultiValueForKey","removeMultiValuesForKey","removeValueForKey","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","sendLocationData","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","elements","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","setOffline","arg","defineVariable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,IAAAA,IAAI,CAACm/B,KAAL,GAAa,IAAb;EACD;EACF;;QC9vBGzvB,SAAS,GAAG,IAAI29B,SAAJ,CAAczrC,MAAM,CAAC8N,SAArB;EAElB9N,MAAM,CAAC8N,SAAP,GAAmB9N,MAAM,CAAC+N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file diff --git a/clevertap.min.js b/clevertap.min.js index 5b256478..2e38a48a 100644 --- a/clevertap.min.js +++ b/clevertap.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).clevertap=t()}(this,(function(){"use strict";var e=0;function t(t){return"__private_"+e+++"_"+t}function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}const o="clevertap-prod.com",n="https:";var s=t("accountId"),r=t("region"),a=t("targetDomain"),l=t("dcSdkversion"),d=t("token");class c{constructor(){let{id:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";Object.defineProperty(this,s,{writable:!0,value:void 0}),Object.defineProperty(this,r,{writable:!0,value:""}),Object.defineProperty(this,a,{writable:!0,value:o}),Object.defineProperty(this,l,{writable:!0,value:""}),Object.defineProperty(this,d,{writable:!0,value:""}),this.id=e,t&&(this.region=t),i&&(this.targetDomain=i),n&&(this.token=n)}get id(){return i(this,s)[s]}set id(e){i(this,s)[s]=e}get region(){return i(this,r)[r]}set region(e){i(this,r)[r]=e}get dcSDKVersion(){return i(this,l)[l]}set dcSDKVersion(e){i(this,l)[l]=e}get targetDomain(){return i(this,a)[a]}set targetDomain(e){i(this,a)[a]=e}get token(){return i(this,d)[d]}set token(e){i(this,d)[d]=e}get finalTargetDomain(){return this.region?"".concat(this.region,".").concat(this.targetDomain):this.targetDomain===o?"".concat("eu1",".").concat(this.targetDomain):this.targetDomain}get dataPostPEURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/defineVars")}get dataPostURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/a?t=96")}get recorderURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/r?r=1")}get emailURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/e?r=1")}}const h=new RegExp("^\\s+|\\.|:|\\$|'|\"|\\\\|\\s+$","g"),u=new RegExp("^\\s+|'|\"|\\\\|\\s+$","g"),p=new RegExp("'","g"),g="clear",v="Charged ID",f="WZRK_CHARGED_ID",b="WZRK_G",m="WZRK_K",y="WZRK_CAMP",w="WZRK_CAMP_G",C="WZRK_EV",k="WZRK_META",x="WZRK_PR",P="WZRK_ARP",I="WZRK_L",S="global",O="optOut",_="useIP",E="WZRK_X",A="push",M=31536e3,L="wzrk_",T="wzrk_id",R="Notification Viewed",j="Notification Clicked",D="WZRK_FPU",B="WZRK_PSD",N="$incr",z="$add",U="$remove",F="$delete",q="WZRK_INBOX_CONFIG",V="WZRK_INBOX",W=1e3,K="wzrk_fetch",H="wiz-iframe",G="wiz-iframe-intent",J="Event",Z="Profile",$=["Stayed","UTM Visited","App Launched","Notification Sent",R,j],Y=e=>"string"==typeof e||e instanceof String,Q=e=>"[object Object]"===Object.prototype.toString.call(e),X=e=>"object"==typeof e&&e instanceof Date,ee=e=>{for(const t in e)if(e.hasOwnProperty(t))return!1;return!0},te=e=>!isNaN(parseFloat(e))&&isFinite(e),ie=e=>/^-?[\d.]+(?:e-?\d+)?$/.test(e)&&"number"==typeof e,oe=e=>null!=e&&"undefined"!==e,ne=(e,t)=>{if("object"!=typeof e){let i;return Y(e)?(i=se(e,u),i.length>1024&&(i=i.substring(0,1024),t.reportError(521,i+"... length exceeded 1024 chars. Trimmed."))):i=e,i}for(const i in e)if(e.hasOwnProperty(i)){const o=ne(e[i],t);let n;n=se(i,h),n.length>1024&&(n=n.substring(0,1024),t.reportError(520,n+"... length exceeded 1024 chars. Trimmed.")),delete e[i],e[n]=o}return e},se=(e,t)=>e.replace(t,""),re=()=>{const e=new Date;return e.getFullYear()+""+e.getMonth()+e.getDay()},ae=()=>Math.floor((new Date).getTime()/1e3),le=e=>"$D_"+Math.round(e.getTime()/1e3),de=e=>{if(ce(e))return"$D_"+e},ce=e=>{const t=/^(\d{4})(\d{2})(\d{2})$/.exec(e);if(null==t)return!1;const i=t[3],o=t[2]-1,n=t[1],s=new Date(n,o,i);return s.getDate()==i&&s.getMonth()==o&&s.getFullYear()==n};class he{static save(e,t){return!(!e||!t)&&(this._isLocalStorageSupported()?(localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),!0):void 0)}static read(e){if(!e)return!1;let t=null;if(this._isLocalStorageSupported()&&(t=localStorage.getItem(e)),null!=t)try{t=JSON.parse(t)}catch(e){}return t}static remove(e){return!!e&&(this._isLocalStorageSupported()?(localStorage.removeItem(e),!0):void 0)}static removeCookie(e,t){let i=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";t&&(i=i+" domain="+t+"; path=/"),document.cookie=i}static createCookie(e,t,i,o){let n="",s="";if(i){const e=new Date;e.setTime(e.getTime()+1e3*i),n="; expires="+e.toGMTString()}o&&(s="; domain="+o),t=encodeURIComponent(t),document.cookie=e+"="+t+n+s+"; path=/"}static readCookie(e){const t=e+"=",i=document.cookie.split(";");for(let e=0;e=0;o--){if(a=0===o?r[o]+a:"."+r[o]+a,this.readCookie(e)){var n="test_"+e+o;if(this.createCookie(n,t,10,a),!this.readCookie(n))continue;this.removeCookie(n,a)}this.createCookie(e,t,i,a);if(this.readCookie(e)==t){s=a,ue.broadDomain=s;break}}}else this.createCookie(e,t,i,s)}else this.createCookie(e,t,i,o)}static getMetaProp(e){const t=this.readFromLSorCookie(k);if(null!=t)return t[e]}static setMetaProp(e,t){if(this._isLocalStorageSupported()){let i=this.readFromLSorCookie(k);null==i&&(i={}),void 0===t?delete i[e]:i[e]=t,this.saveToLSorCookie(k,i)}}static getAndClearMetaProp(e){const t=this.getMetaProp(e);return this.setMetaProp(e,void 0),t}static setInstantDeleteFlagInK(){let e=this.readFromLSorCookie(m);null==e&&(e={}),e.flag=!0,this.saveToLSorCookie(m,e)}static backupEvent(e,t,i){let o=this.readFromLSorCookie(I);void 0===o&&(o={}),o[t]={q:e},this.saveToLSorCookie(I,o),i.debug("stored in ".concat(I," reqNo : ").concat(t," -> ").concat(e))}static removeBackup(e,t){const i=this.readFromLSorCookie(I);null!=i&&void 0!==i[e]&&(t.debug("del event: ".concat(e," data-> ").concat(i[e].q)),delete i[e],this.saveToLSorCookie(I,i))}}const ue={globalCache:{gcookie:null,REQ_N:0,RESP_N:0},LRU_CACHE:null,globalProfileMap:void 0,globalEventsMap:void 0,blockRequest:!1,isOptInRequest:!1,broadDomain:null,webPushEnabled:null,campaignDivMap:{},currentSessionId:null,wiz_counter:0,notifApi:{notifEnabledFromApi:!1},unsubGroups:[],updatedCategoryLong:null,inbox:null,isPrivacyArrPushed:!1,privacyArray:[],offline:!1,location:null,dismissSpamControl:!1,globalUnsubscribe:!0,flutterVersion:null,variableStore:{}};var pe=t("keyOrder"),ge=t("deleteFromObject");class ve{constructor(e){Object.defineProperty(this,ge,{value:fe}),Object.defineProperty(this,pe,{writable:!0,value:void 0}),this.max=e;let t=he.readFromLSorCookie(E);if(t){const e={};i(this,pe)[pe]=[],t=t.cache;for(const o in t)t.hasOwnProperty(o)&&(e[t[o][0]]=t[o][1],i(this,pe)[pe].push(t[o][0]));this.cache=e}else this.cache={},i(this,pe)[pe]=[]}get(e){const t=this.cache[e];return t&&(this.cache=i(this,ge)[ge](e,this.cache),this.cache[e]=t,i(this,pe)[pe].push(e)),this.saveCacheToLS(this.cache),t}set(e,t){const o=this.cache[e],n=i(this,pe)[pe];null!=o?this.cache=i(this,ge)[ge](e,this.cache):n.length===this.max&&(this.cache=i(this,ge)[ge](n[0],this.cache)),this.cache[e]=t,i(this,pe)[pe][i(this,pe)[pe]-1]!==e&&i(this,pe)[pe].push(e),this.saveCacheToLS(this.cache)}saveCacheToLS(e){const t=[],o=i(this,pe)[pe];for(const i in o)if(o.hasOwnProperty(i)){const n=[];n.push(o[i]),n.push(e[o[i]]),t.push(n)}he.saveToLSorCookie(E,{cache:t})}getKey(e){if(null===e)return null;const t=i(this,pe)[pe];for(const i in t)if(t.hasOwnProperty(i)&&this.cache[t[i]]===e)return t[i];return null}getSecondLastKey(){const e=i(this,pe)[pe];return null!=e&&e.length>1?e[e.length-2]:-1}getLastKey(){const e=i(this,pe)[pe].length;if(e)return i(this,pe)[pe][e-1]}}var fe=function(e,t){const o=JSON.parse(JSON.stringify(i(this,pe)[pe])),n={};let s;for(const i in o)o.hasOwnProperty(i)&&(o[i]!==e?n[o[i]]=t[o[i]]:s=i);return o.splice(s,1),i(this,pe)[pe]=JSON.parse(JSON.stringify(o)),n},be=t("logger"),me=t("request"),ye=t("device"),we=t("session");class Ce{constructor(e){let{logger:t,request:o,device:n,session:s}=e;Object.defineProperty(this,be,{writable:!0,value:void 0}),Object.defineProperty(this,me,{writable:!0,value:void 0}),Object.defineProperty(this,ye,{writable:!0,value:void 0}),Object.defineProperty(this,we,{writable:!0,value:void 0}),i(this,be)[be]=t,i(this,me)[me]=o,i(this,ye)[ye]=n,i(this,we)[we]=s}s(e,t,o,n,s){let r=!1,a=!1;if(window.isOULInProgress&&(o||"undefined"!==n&&n===window.oulReqN)&&(window.isOULInProgress=!1,r=!0),void 0===n&&(n=0),he.removeBackup(n,i(this,be)[be]),n>ue.globalCache.REQ_N)return;if(oe(i(this,ye)[ye].gcookie)||e&&(a=!0),!oe(i(this,ye)[ye].gcookie)||o||"boolean"==typeof s){const n=i(this,we)[we].getSessionCookieObject();if(window.isOULInProgress||n.s&&t{if(Q(e)){for(var t in e)if(e.hasOwnProperty(t)){if(Q(e[t])||Array.isArray(e[t]))return!1;X(e[t])&&(e[t]=le(e[t]))}return!0}return!1},Ne=(e,t)=>{if(Q(e)){for(var i in e)if(e.hasOwnProperty(i))if("Items"===i){if(!Array.isArray(e[i]))return!1;for(var o in e[i].length>50&&t.reportError(522,"Charged Items exceed 50 limit. Actual count: "+e[i].length),e[i])if(e[i].hasOwnProperty(o)&&(!Q(e[i][o])||!Be(e[i][o])))return!1}else{if(Q(e[i])||Array.isArray(e[i]))return!1;X(e[i])&&(e[i]=le(e[i]))}if(Y(e[v])||ie(e[v])){const i=e[v]+"";if(void 0===De&&(De=he.readFromLSorCookie(f)),void 0!==De&&De.trim()===i.trim())return t.error("Duplicate charged Id - Dropped"+e),!1;De=i,he.saveToLSorCookie(f,i)}return!0}return!1};var ze=t("logger"),Ue=t("oldValues"),Fe=t("request"),qe=t("isPersonalisationActive"),Ve=t("processEventArray");class We extends Array{constructor(e,t){let{logger:o,request:n,isPersonalisationActive:s}=e;super(),Object.defineProperty(this,Ve,{value:Ke}),Object.defineProperty(this,ze,{writable:!0,value:void 0}),Object.defineProperty(this,Ue,{writable:!0,value:void 0}),Object.defineProperty(this,Fe,{writable:!0,value:void 0}),Object.defineProperty(this,qe,{writable:!0,value:void 0}),i(this,ze)[ze]=o,i(this,Ue)[Ue]=t,i(this,Fe)[Fe]=n,i(this,qe)[qe]=s}push(){for(var e=arguments.length,t=new Array(e),o=0;o0;){var t=e.shift();if(!Y(t)){i(this,ze)[ze].error(Oe);continue}if(t.length>1024&&(t=t.substring(0,1024),i(this,ze)[ze].reportError(510,t+"... length exceeded 1024 chars. Trimmed.")),$.includes(t)){i(this,ze)[ze].reportError(513,t+" is a restricted system event. It cannot be used as an event name.");continue}const o={type:"event"};if(o.evtName=se(t,h),0!==e.length){const n=e.shift();if(Q(n)){if("Charged"===t){if(!Ne(n,i(this,ze)[ze])){i(this,ze)[ze].reportError(511,"Charged event structure invalid. Not sent.");continue}}else if(!Be(n)){i(this,ze)[ze].reportError(512,t+" event structure invalid. Not sent.");continue}o.evtData=n}else e.unshift(n)}i(this,Fe)[Fe].processEvent(o)}};const He=e=>{const t={},i=e.indexOf("?");if(i>1){const o=e.substring(i+1);let n;const s=/\+/g,r=/([^&=]+)=?([^&]*)/g,a=function(e){let t=e.replace(s," ");try{t=decodeURIComponent(t)}catch(e){}return t};for(n=r.exec(o);n;)t[a(n[1])]=a(n[2]),n=r.exec(o)}return t},Ge=(e,t,i)=>e+"&"+t+"="+encodeURIComponent(i),Je=()=>window.location.hostname,Ze=(e,t)=>(t&&"function"==typeof t.debug&&t.debug("dobj:"+e),Ye(e)),$e=(()=>{let e="",t=0;for(t=0;t<=25;t++)e+=String.fromCharCode(t+65);for(t=0;t<=25;t++)e+=String.fromCharCode(t+97);for(t=0;t<10;t++)e+=t;return e+"+/="})(),Ye=e=>{if(null==e)return"";var t,i,o,n,s,r,a,l="",d=0;for(e=(e=>{if(null==e)return"";let t,i,o,n={},s={},r="",a="",l="",d=2,c=3,h=2,u="",p=0,g=0,v=String.fromCharCode;for(o=0;o>=1}else{for(i=1,t=0;t>=1}d--,0==d&&(d=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;d--,0==d&&(d=Math.pow(2,h),h++),n[a]=c++,l=String(r)}if(""!==l){if(Object.prototype.hasOwnProperty.call(s,l)){if(l.charCodeAt(0)<256){for(t=0;t>=1}else{for(i=1,t=0;t>=1}d--,0==d&&(d=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;d--,0==d&&(d=Math.pow(2,h),h++)}for(i=2,t=0;t>=1;for(;;){if(p<<=1,15==g){u+=v(p);break}g++}return u})(e);d<2*e.length;)d%2==0?(t=e.charCodeAt(d/2)>>8,i=255&e.charCodeAt(d/2),o=d/2+1>8:NaN):(t=255&e.charCodeAt((d-1)/2),(d+1)/2>8,o=255&e.charCodeAt((d+1)/2)):i=o=NaN),d+=3,n=t>>2,s=(3&t)<<4|i>>4,r=(15&i)<<2|o>>6,a=63&o,isNaN(i)?r=a=64:isNaN(o)&&(a=64),l=l+$e.charAt(n)+$e.charAt(s)+$e.charAt(r)+$e.charAt(a);return l};var Qe=t("fireRequest"),Xe=t("dropRequestDueToOptOut"),et=t("addUseIPToRequest"),tt=t("addARPToRequest");class it{constructor(){this.networkRetryCount=0,this.minDelayFrequency=0}static fireRequest(e,t,o,n){i(this,Qe)[Qe](e,1,t,o,n)}getDelayFrequency(){if(this.logger.debug("Network retry #"+this.networkRetryCount),this.networkRetryCount<10)return this.logger.debug(this.account.id,"Failure count is "+this.networkRetryCount+". Setting delay frequency to 1s"),this.minDelayFrequency=W,this.minDelayFrequency;if(null==this.account.region)return this.logger.debug(this.account.id,"Setting delay frequency to 1s"),W;{const e=1e3*(Math.floor(10*Math.random())+1);return this.minDelayFrequency+=e,this.minDelayFrequency<6e5?(this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency):(this.minDelayFrequency=W,this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency)}}}it.logger=void 0,it.device=void 0,it.account=void 0,Object.defineProperty(it,Qe,{value:function(e,t,o,n,s){var r,a;if(i(this,Xe)[Xe]())return void this.logger.debug("req dropped due to optout cookie: "+this.device.gcookie);if(oe(this.device.gcookie)||(ue.blockRequest=!0),s&&s===K)!oe(this.device.gcookie)&&ue.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(this.networkRetryCount)),i(this,Qe)[Qe](e,void 0,o,n)}),this.getDelayFrequency());else if(!oe(this.device.gcookie)&&ue.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(t)),i(this,Qe)[Qe](e,t+1,o,n)}),50);if(n?window.isOULInProgress=!0:(oe(this.device.gcookie)&&(e=Ge(e,"gc",this.device.gcookie)),e=i(this,tt)[tt](e,o)),e=Ge(e,"tries",t),e=i(this,et)[et](e),e=Ge(e,"r",(new Date).getTime()),(null===(r=window.clevertap)||void 0===r?void 0:r.hasOwnProperty("plugin"))||(null===(a=window.wizrocket)||void 0===a?void 0:a.hasOwnProperty("plugin"))){const t=window.clevertap.plugin||window.wizrocket.plugin;e=Ge(e,"ct_pl",t)}-1!==e.indexOf("chrome-extension:")&&(e=e.replace("chrome-extension:","https:"));for(var l=document.getElementsByClassName("ct-jp-cb");l[0]&&l[0].parentNode;)l[0].parentNode.removeChild(l[0]);const d=document.createElement("script");d.setAttribute("type","text/javascript"),d.setAttribute("src",e),d.setAttribute("class","ct-jp-cb"),d.setAttribute("rel","nofollow"),d.async=!0,document.getElementsByTagName("head")[0].appendChild(d),this.logger.debug("req snt -> url: "+e)}}),Object.defineProperty(it,Xe,{value:function(){return!ue.isOptInRequest&&oe(this.device.gcookie)&&Y(this.device.gcookie)?":OO"===this.device.gcookie.slice(-3):(ue.isOptInRequest=!1,!1)}}),Object.defineProperty(it,et,{value:function(e){var t=he.getMetaProp(_);return"boolean"!=typeof t&&(t=!1),Ge(e,_,t?"true":"false")}}),Object.defineProperty(it,tt,{value:function(e,t){if(!0===t){const t={skipResARP:!0};return Ge(e,"arp",Ze(JSON.stringify(t),this.logger))}return he._isLocalStorageSupported()&&void 0!==localStorage.getItem(P)&&null!==localStorage.getItem(P)?Ge(e,"arp",Ze(JSON.stringify(he.readFromLSorCookie(P)),this.logger)):e}});const ot=()=>{let e={};if(he._isLocalStorageSupported()){let t=he.read(y);null!=t?(t=JSON.parse(decodeURIComponent(t).replace(p,'"')),t.hasOwnProperty("global")?e.wp=t:e=t):e={}}return e},nt=e=>{if(he._isLocalStorageSupported()){const t={...ot(),...e},i=JSON.stringify(t);he.save(y,encodeURIComponent(i)),st()}},st=()=>{if(he._isLocalStorageSupported()){let i=he.read(b);if(oe(i))try{i=JSON.parse(decodeURIComponent(he.read(b)));const o=he.read(w)?JSON.parse(decodeURIComponent(he.read(w))):{};if(i&&he._isLocalStorageSupported()){var e={},t=ot();Object.keys(t).forEach((n=>{const s=i in o&&Object.keys(o[i]).length&&o[i][n]?o[i][n]:{},r=t[n].global,a=re(),l=t[n][a];if(void 0!==r){const e=Object.keys(r);for(const t in e){let i=[];if(e.hasOwnProperty(t)){let o=0,n=0;const a=e[t];if("tc"===a)continue;void 0!==l&&void 0!==l[a]&&(o=l[a]),void 0!==r&&void 0!==r[a]&&(n=r[a]),i=[a,o,n],s[a]=i}}}e={...e,[n]:s}})),o[i]=e,he.save(w,encodeURIComponent(JSON.stringify(o)))}}catch(e){console.error("Invalid clevertap Id "+e)}}},rt=()=>{const e=JSON.parse(decodeURIComponent(he.read(b)));let t={};if(he._isLocalStorageSupported()){let i={};t=ot();const o=he.read(w),n=o?decodeURIComponent(o):null,s=n?JSON.parse(n):null,r=e&&null!=o&&s&&s[e]&&s[e].wp?Object.values(s[e].wp):[],a=e&&null!=o&&s&&s[e]&&s[e].wi?Object.values(s[e].wi):[],l=re();let d=0,c=0;return t.wp&&t.wp[l]&&"undefined"!==t.wp[l].tc&&(d=t.wp[l].tc),t.wi&&t.wi[l]&&"undefined"!==t.wi[l].tc&&(c=t.wi[l].tc),i={wmp:d,wimp:c,tlc:r,witlc:a},i}},at=(e,t)=>{let{logger:i}=t,o=!1;if(Q(e))for(const t in e)if(e.hasOwnProperty(t)){o=!0;let n=e[t];if(null==n){delete e[t];continue}"Gender"!==t||n.match(/^M$|^F$/)||(o=!1,i.error(_e)),"Employed"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Ee)),"Married"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Ae)),"Education"!==t||n.match(/^School$|^College$|^Graduate$/)||(o=!1,i.error(Me)),"Age"===t&&null!=n&&(te(n)?e.Age=+n:(o=!1,i.error(Le))),"DOB"===t?(/^\$D_/.test(n)&&11===(n+"").length||X(n)||(o=!1,i.error(Te)),X(n)&&(e[t]=le(n))):X(n)&&(e[t]=le(n)),"Phone"!==t||ee(n)||(n.length>8&&"+"===n.charAt(0)?(n=n.substring(1,n.length),te(n)?e.Phone=+n:(o=!1,i.error(je+". Removed."))):(o=!1,i.error(je+". Removed."))),o||delete e[t]}return o},lt=e=>{const t={};t.Name=e.name,null!=e.id&&(t.FBID=e.id+""),"male"===e.gender?t.Gender="M":"female"===e.gender?t.Gender="F":t.Gender="O";null!=e.relationship_status&&(t.Married="N","Married"===e.relationship_status&&(t.Married="Y"));const i=function(e){if(null!=e){let t="",i="";for(let o=0;o0?"Y":"N",null!=e.email&&(t.Email=e.email),null!=e.birthday){const i=e.birthday.split("/");t.DOB=de(i[2]+i[0]+i[1])}return t},dt=(e,t)=>{let{logger:i}=t;const o={};if(null!=e.displayName&&(o.Name=e.displayName),null!=e.id&&(o.GPID=e.id+""),null!=e.gender&&("male"===e.gender?o.Gender="M":"female"===e.gender?o.Gender="F":"other"===e.gender&&(o.Gender="O")),null!=e.image&&!1===e.image.isDefault&&(o.Photo=e.image.url.split("?sz")[0]),null!=e.emails)for(let t=0;t{if(he._isLocalStorageSupported()){if(null==ue.globalProfileMap&&(ue.globalProfileMap=he.readFromLSorCookie(x),null==ue.globalProfileMap&&(ue.globalProfileMap={})),null!=e._custom){const t=e._custom;for(const i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);delete e._custom}for(const i in e)if(e.hasOwnProperty(i)){if(ue.globalProfileMap.hasOwnProperty(i)&&!t)continue;ue.globalProfileMap[i]=e[i]}null!=ue.globalProfileMap._custom&&delete ue.globalProfileMap._custom,he.saveToLSorCookie(x,ue.globalProfileMap)}},ht=(e,t,i)=>{if(null!=e&&"-1"!==e&&he._isLocalStorageSupported()){const t=ot();let o=t.wp[i];null==o&&(o={},t[i]=o),o[e]="dnd",nt(t)}if(null!=ue.campaignDivMap){const t=ue.campaignDivMap[e];null!=t&&(document.getElementById(t).style.display="none","intentPreview"===t&&null!=document.getElementById("intentOpacityDiv")&&(document.getElementById("intentOpacityDiv").style.display="none"))}};var ut=t("logger"),pt=t("request"),gt=t("account"),vt=t("oldValues"),ft=t("isPersonalisationActive"),bt=t("processProfileArray");class mt extends Array{constructor(e,t){let{logger:o,request:n,account:s,isPersonalisationActive:r}=e;super(),Object.defineProperty(this,bt,{value:yt}),Object.defineProperty(this,ut,{writable:!0,value:void 0}),Object.defineProperty(this,pt,{writable:!0,value:void 0}),Object.defineProperty(this,gt,{writable:!0,value:void 0}),Object.defineProperty(this,vt,{writable:!0,value:void 0}),Object.defineProperty(this,ft,{writable:!0,value:void 0}),i(this,ut)[ut]=o,i(this,pt)[pt]=n,i(this,gt)[gt]=s,i(this,vt)[vt]=t,i(this,ft)[ft]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o0)for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];let n,s={};if(null!=o.Site){if(n=o.Site,ee(n)||!at(n,{logger:i(this,ut)[ut]}))return}else if(null!=o.Facebook){const e=o.Facebook;ee(e)||e.error||(n=lt(e))}else if(null!=o["Google Plus"]){const e=o["Google Plus"];ee(e)||e.error||(n=dt(e,{logger:i(this,ut)[ut]}))}if(null!=n&&!ee(n)){s.type="profile",null==n.tz&&(n.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),s.profile=n,ct(n,!0),s=i(this,pt)[pt].addSystemDataToObject(s,void 0),i(this,pt)[pt].addFlags(s);const e=Ze(JSON.stringify(s),i(this,ut)[ut]);let t=i(this,gt)[gt].dataPostURL;t=Ge(t,"type",A),t=Ge(t,"d",e),i(this,pt)[pt].saveAndFireRequest(t,ue.blockRequest)}}},wt=t("request"),Ct=t("logger"),kt=t("account"),xt=t("session"),Pt=t("oldValues"),It=t("device"),St=t("processOUL"),Ot=t("handleCookieFromCache"),_t=t("deleteUser"),Et=t("processLoginArray");class At extends Array{constructor(e,t){let{request:o,account:n,session:s,logger:r,device:a}=e;super(),Object.defineProperty(this,Et,{value:Rt}),Object.defineProperty(this,_t,{value:Tt}),Object.defineProperty(this,Ot,{value:Lt}),Object.defineProperty(this,St,{value:Mt}),Object.defineProperty(this,wt,{writable:!0,value:void 0}),Object.defineProperty(this,Ct,{writable:!0,value:void 0}),Object.defineProperty(this,kt,{writable:!0,value:void 0}),Object.defineProperty(this,xt,{writable:!0,value:void 0}),Object.defineProperty(this,Pt,{writable:!0,value:void 0}),Object.defineProperty(this,It,{writable:!0,value:void 0}),i(this,wt)[wt]=o,i(this,kt)[kt]=n,i(this,xt)[xt]=s,i(this,Ct)[Ct]=r,i(this,Pt)[Pt]=t,i(this,It)[It]=a}clear(){i(this,Ct)[Ct].debug("clear called. Reset flag has been set."),i(this,_t)[_t](),he.setMetaProp(g,!0)}push(){for(var e=arguments.length,t=new Array(e),o=0;o{let o=he.readFromLSorCookie(m);const n=he.readFromLSorCookie(b);let s;if(null==o)o={},s=e;else{s=o.id;let r=!1,a=!1;if(null==s&&(s=e[0],r=!0),null==ue.LRU_CACHE&&he._isLocalStorageSupported()&&(ue.LRU_CACHE=new ve(100)),r)null!=n&&(ue.LRU_CACHE.set(s,n),ue.blockRequest=!1);else for(const t in e)if(e.hasOwnProperty(t)){const i=e[t];if(ue.LRU_CACHE.cache[i]){s=i,a=!0;break}}if(a){s!==ue.LRU_CACHE.getLastKey()?i(this,Ot)[Ot]():(t=!1,he.saveToLSorCookie(D,t));const e=ue.LRU_CACHE.get(s);ue.LRU_CACHE.set(s,e),he.saveToLSorCookie(b,e),i(this,It)[It].gcookie=e;const o=ue.LRU_CACHE.getSecondLastKey();if(he.readFromLSorCookie(D)&&-1!==o){const e=ue.LRU_CACHE.cache[o];i(this,wt)[wt].unregisterTokenForGuid(e)}}else r?null!=n&&(i(this,It)[It].gcookie=n,he.saveToLSorCookie(b,n),t=!1):this.clear(),he.saveToLSorCookie(D,!1),s=e[0]}o.id=s,he.saveToLSorCookie(m,o)};if(Array.isArray(e)&&e.length>0)for(const n in e)if(e.hasOwnProperty(n)){const s=e[n];let r,a={};if(null!=s.Site){if(r=s.Site,ee(r)||!at(r,{logger:i(this,Ct)[Ct]}))return}else if(null!=s.Facebook){const e=s.Facebook;ee(e)||e.error||(r=lt(e))}else if(null!=s["Google Plus"]){const e=s["Google Plus"];ee(e)&&!e.error&&(r=dt(e,{logger:i(this,Ct)[Ct]}))}if(null!=r&&!ee(r)){a.type="profile",null==r.tz&&(r.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),a.profile=r;const e=[];he._isLocalStorageSupported()&&(r.Identity&&e.push(r.Identity),r.Email&&e.push(r.Email),r.GPID&&e.push("GP:"+r.GPID),r.FBID&&e.push("FB:"+r.FBID),e.length>0&&o(e)),ct(r,!0),a=i(this,wt)[wt].addSystemDataToObject(a,void 0),i(this,wt)[wt].addFlags(a),t&&(a.isOUL=!0);const n=Ze(JSON.stringify(a),i(this,Ct)[Ct]);let s=i(this,kt)[kt].dataPostURL;s=Ge(s,"type",A),s=Ge(s,"d",n),i(this,wt)[wt].saveAndFireRequest(s,ue.blockRequest,t)}}},Lt=function(){ue.blockRequest=!1,console.debug("Block request is false"),he._isLocalStorageSupported()&&(delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),he.removeCookie(y,Je()),he.removeCookie(i(this,xt)[xt].cookieName,ue.broadDomain),he.removeCookie(P,ue.broadDomain),i(this,xt)[xt].setSessionCookieObject("")},Tt=function(){ue.blockRequest=!0,i(this,Ct)[Ct].debug("Block request is true"),ue.globalCache={gcookie:null,REQ_N:0,RESP_N:0},he._isLocalStorageSupported()&&(delete localStorage.WZRK_G,delete localStorage.WZRK_K,delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),he.removeCookie(b,ue.broadDomain),he.removeCookie(y,Je()),he.removeCookie(m,Je()),he.removeCookie(i(this,xt)[xt].cookieName,ue.broadDomain),he.removeCookie(P,ue.broadDomain),i(this,It)[It].gcookie=null,i(this,xt)[xt].setSessionCookieObject("")},Rt=function(e){if(Array.isArray(e)&&e.length>0){const t=e.pop();if(null!=t&&Q(t)&&(null!=t.Site&&Object.keys(t.Site).length>0||null!=t.Facebook&&Object.keys(t.Facebook).length>0||null!=t["Google Plus"]&&Object.keys(t["Google Plus"]).length>0)){he.setInstantDeleteFlagInK();try{i(this,St)[St]([t])}catch(e){i(this,Ct)[Ct].debug(e)}}else i(this,Ct)[Ct].error("Profile object is in incorrect format")}};class jt extends HTMLElement{constructor(){super(),this._details=null,this.shadow=null,this.shadow=this.attachShadow({mode:"open"})}get details(){return this._details||""}set details(e){null===this._details&&(this._details=e,this.renderBanner())}renderBanner(){this.shadow.innerHTML=this.getBannerContent(),!1!==this.trackClick&&this.addEventListener("click",(()=>{const e=this.details.onClick;e&&(this.details.window?window.open(e,"_blank"):window.parent.location.href=e),window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId})}getBannerContent(){return'\n \n \n ")}}class Dt extends HTMLElement{constructor(){super(),this._target=null,this._carousel=null,this.shadow=null,this.slides=0,this.previouslySelectedItem=-1,this.selectedItem=1,this.autoSlide=null,this.stopAutoSlideTimeout=null,this.shadow=this.attachShadow({mode:"open"}),void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",jt)}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderCarousel())}get details(){return this.target.display.details}get display(){return this.target.display}renderCarousel(){this.slides=this.details.length,this.shadow.innerHTML=this.getStyles();const e=this.getCarouselContent();this.display.showNavBtns&&e.insertAdjacentHTML("beforeend",this.display.navBtnsHtml),this.display.showNavArrows&&(e.insertAdjacentHTML("beforeend",this.display.leftNavArrowHtml),e.insertAdjacentHTML("beforeend",this.display.rightNavArrowHtml)),this._carousel=e,this.shadow.appendChild(e),this.setupClick(),this.updateSelectedItem(),this.startAutoSlide(),this.setupOnHover(),window.clevertap.renderNotificationViewed({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot})}setupClick(){this._carousel.addEventListener("click",(e=>{const t=e.target.id;if(t.startsWith("carousel__button")){const e=+t.split("-")[1];e!==this.selectedItem&&(this.previouslySelectedItem=this.selectedItem,this.selectedItem=e,this.updateSelectedItem(),this.startAutoSlide())}else if(t.startsWith("carousel__arrow"))t.endsWith("right")?this.goToNext():this.goToPrev(),this.startAutoSlide();else if(t.indexOf("-")>-1){const e=+t.split("-")[1],i=e-1;window.parent.clevertap&&window.clevertap.renderNotificationClicked({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot,wzrk_slideNo:e});const o=this.details[i].onClick;""!==o&&(this.details[i].window?window.open(o,"_blank"):window.location.href=o)}}))}setupOnHover(){this._carousel.addEventListener("mouseenter",(e=>{this.stopAutoSlideTimeout=setTimeout((()=>{this.autoSlide=clearInterval(this.autoSlide)}),500)})),this._carousel.addEventListener("mouseleave",(e=>{clearTimeout(this.stopAutoSlideTimeout),void 0===this.autoSlide&&this.startAutoSlide()}))}getCarouselContent(){const e=document.createElement("div");return e.setAttribute("class","carousel"),this.details.forEach(((t,i)=>{const o=document.createElement("ct-web-personalisation-banner");o.classList.add("carousel__item"),o.trackClick=!1,o.setAttribute("id","carousel__item-".concat(i+1)),o.details=t,e.appendChild(o)})),e}getStyles(){var e,t;return"\n \n ")}updateSelectedItem(){if(-1!==this.previouslySelectedItem){const e=this.shadow.getElementById("carousel__item-".concat(this.previouslySelectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.previouslySelectedItem));e.classList.remove("carousel__item--selected"),t&&t.classList.remove("carousel__button--selected")}const e=this.shadow.getElementById("carousel__item-".concat(this.selectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.selectedItem));e.classList.add("carousel__item--selected"),t&&t.classList.add("carousel__button--selected")}startAutoSlide(){clearInterval(this.autoSlide),this.autoSlide=setInterval((()=>{this.goToNext()}),this.display.sliderTime?1e3*this.display.sliderTime:3e3)}goToNext(){this.goTo(this.selectedItem,(this.selectedItem+1)%this.slides)}goToPrev(){this.goTo(this.selectedItem,this.selectedItem-1)}goTo(e,t){this.previouslySelectedItem=e,this.selectedItem=t,0===t&&(this.selectedItem=this.slides),this.updateSelectedItem()}}class Bt extends HTMLElement{constructor(){super(),this._target=null,this._session=null,this.shadow=null,this.popup=null,this.container=null,this.resizeObserver=null,this.shadow=this.attachShadow({mode:"open"})}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderImageOnlyPopup())}get session(){return this._session||""}set session(e){this._session=e}get msgId(){return this.target.wzrk_id}get pivotId(){return this.target.wzrk_pivot}get onClickUrl(){return this.target.display.onClickUrl}renderImageOnlyPopup(){const e=this.target.wzrk_id.split("_")[0],t=this.session.sessionId;this.shadow.innerHTML=this.getImageOnlyPopupContent(),this.popup=this.shadowRoot.getElementById("imageOnlyPopup"),this.container=this.shadowRoot.getElementById("container"),this.closeIcon=this.shadowRoot.getElementById("close"),this.popup.addEventListener("load",this.updateImageAndContainerWidth()),this.resizeObserver=new ResizeObserver((()=>this.handleResize(this.popup,this.container))),this.resizeObserver.observe(this.popup),this.closeIcon.addEventListener("click",(()=>{if(this.resizeObserver.unobserve(this.popup),document.getElementById("wzrkImageOnlyDiv").style.display="none",this.remove(),null!=e&&"-1"!==e&&he._isLocalStorageSupported()){const i=ot();let o=i.wp[t];null==o&&(o={},i[t]=o),o[e]="dnd",nt(i)}})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId}),this.onClickUrl&&this.popup.addEventListener("click",(()=>{this.target.display.window?window.open(this.onClickUrl,"_blank"):window.parent.location.href=this.onClickUrl,window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})}))}handleResize(e,t){const i=this.getRenderedImageWidth(e);t.style.setProperty("width","".concat(i,"px"))}getImageOnlyPopupContent(){return"\n ".concat(this.target.msgContent.css,"\n ").concat(this.target.msgContent.html,"\n ")}updateImageAndContainerWidth(){return()=>{const e=this.getRenderedImageWidth(this.popup);this.popup.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("height","auto"),this.container.style.setProperty("position","fixed"),this.popup.style.setProperty("visibility","visible"),this.closeIcon.style.setProperty("visibility","visible"),document.getElementById("wzrkImageOnlyDiv").style.visibility="visible"}}getRenderedImageWidth(e){const t=e.naturalWidth/e.naturalHeight;return e.height*t}}class Nt extends HTMLElement{constructor(e,t){super(),this.wrapper=null,this.snackBar=null,this.shadow=this.attachShadow({mode:"open"}),this.config=e,this.message=t,this.renderMessage(t)}get pivotId(){return this.message.wzrk_pivot}get campaignId(){return this.message.wzrk_id}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}renderMessage(e){switch(this.wrapper=this.createEl("div","messageWrapper"),e.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":{const t=this.prepareBasicMessage(e.msg[0]);this.wrapper.appendChild(t)}}const t=this.createEl("div","timeStamp");if(t.innerHTML="".concat(Jt(e.id.split("_")[1]),""),!e.viewed){const e=this.createEl("span","unreadMarker");t.appendChild(e)}this.wrapper.appendChild(t),this.shadow.appendChild(this.wrapper)}prepareBasicMessage(e){const t=this.createEl("div","message");if(e.imageUrl){const i=this.addImage(e.imageUrl,"mainImg");t.appendChild(i)}const i=this.createEl("div","iconTitleDescWrapper");if(e.iconUrl){const t=this.addImage(e.iconUrl,"iconImg");i.appendChild(t)}const o=this.createEl("div","titleDescWrapper");if(e.title){const t=this.createEl("div","title");t.innerText=e.title,o.appendChild(t)}if(e.description){const t=this.createEl("div","description");t.innerText=e.description,o.appendChild(t)}if((e.title||e.description)&&i.appendChild(o),(e.iconUrl||e.title||e.description)&&t.appendChild(i),e.buttons&&e.buttons.length){const i=this.addButtons(e.buttons);t.appendChild(i)}return t}addButtons(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.createEl("div","buttonsContainer");let i=!1;return e.forEach(((e,o)=>{const n=this.createEl("button","button-".concat(o),"button");n.innerText=e.text,o>0&&(n.style.cssText+="margin-left: 2px;"),"copy"===e.action&&(i=!0),t.appendChild(n)})),i&&this.addSnackbar(t),t}addSnackbar(e){this.snackBar=this.createEl("div","snackbar-".concat(this.campaignId),"snackbar"),this.snackBar.innerHTML=Yt;const t=this.createEl("span","snackbar-msg-".concat(this.campaignId),"snackbar-msg");t.innerText="Copied to clipboard",this.snackBar.appendChild(t),e.appendChild(this.snackBar)}addImage(e,t){const i=this.createEl("div","".concat(t,"Container")),o=this.createEl("img",t);return o.setAttribute("src",e),o.setAttribute("loading","lazy"),i.appendChild(o),i}raiseClickedEvent(e,t){switch(this.message.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":this.raiseClickedForBasicTemplates(e,t)}}raiseClickedForBasicTemplates(e,t){const i=this.message.msg[0],o={msgId:this.campaignId,pivotId:this.pivotId};if("BUTTON"===e.tagName){const t=e.id.split("-")[1],n=i.buttons[t];o.kv={wzrk_c2a:n.text},"url"===n.action?n.openUrlInNewTab?window.open(n.url,"_blank"):window.location=n.url:"copy"===n.action&&(window.focus(),navigator.clipboard.writeText(n.clipboardText),this.snackBar.style.setProperty("display","flex","important"),setTimeout((()=>{this.snackBar.style.setProperty("display","none","important")}),2e3))}else"CT-INBOX-MESSAGE"===e.tagName&&i.onClickUrl&&(i.openUrlInNewTab?window.open(i.onClickUrl,"_blank"):window.location=i.onClickUrl);t?console.log("Notifiction clicked event will be raised at run time with payload ::",o):window.clevertap.renderNotificationClicked(o)}}class zt extends HTMLElement{constructor(e){super(),this.isInboxOpen=!1,this.isInboxFromFlutter=!1,this.selectedCategory=null,this.unviewedMessages={},this.unviewedCounter=0,this.isPreview=!1,this.inboxConfigForPreview={},this.inboxSelector=null,this.inbox=null,this.emptyInboxMsg=null,this.inboxCard=null,this.unviewedBadge=null,this.observer=null,this.selectedCategoryRef=null,this.addClickListenerOnDocument=(()=>e=>{if(e.composedPath().includes(this.inbox)){const t=e.path||e.composedPath&&e.composedPath();if(t.length){const e=t[0].id;if("closeInbox"===e)this.toggleInbox();else if(e.startsWith("category-"))this.prevCategoryRef=this.selectedCategoryRef,this.selectedCategoryRef=t[0],this.updateActiveCategory(t[0].innerText);else{const e=t.filter((e=>{var t;return(null===(t=e.id)||void 0===t?void 0:t.startsWith("button-"))||"CT-INBOX-MESSAGE"===e.tagName}));if(e.length){e[e.length-1].raiseClickedEvent(e[0],this.isPreview)}}}}else(this.inboxSelector.contains(e.target)||this.isInboxOpen)&&(this.isInboxFromFlutter?this.isInboxFromFlutter=!1:this.toggleInbox(e))})(),this.setBadgeStyle=e=>{null!==this.unviewedBadge&&(this.unviewedBadge.innerText=e>9?"9+":e,this.unviewedBadge.style.display=e>0?"flex":"none")},this.logger=e,this.shadow=this.attachShadow({mode:"open"})}get incomingMessages(){return[]}set incomingMessages(e){void 0===e&&(e=[]),e.length>0&&this.inbox&&this.updateInboxMessages(e)}get incomingMessagesForPreview(){return[]}set incomingMessagesForPreview(e){void 0===e&&(e=[]);const t={};e.length>0&&this.inbox&&(this.isPreview=!0,this.unviewedCounter=0,e.forEach((e=>{const i="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=i,t[i]=e,this.unviewedMessages[i]=e,this.unviewedCounter++})),this.buildUIForMessages(t),this.updateUnviewedBadgeCounter())}connectedCallback(){this.init()}init(){this.config=this.isPreview?this.inboxConfigForPreview:he.readFromLSorCookie(q)||{},0!==Object.keys(this.config).length&&(this.inboxSelector=document.getElementById(this.config.inboxSelector),null!==this.inboxSelector&&(this.config.styles.notificationsBadge?this.addUnviewedBadge():this.unviewedBadge&&this.unviewedBadge.remove(),this.createinbox(),document.removeEventListener("click",this.addClickListenerOnDocument),document.addEventListener("click",this.addClickListenerOnDocument),this.config.categories.length&&this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadow.innerHTML=this.getInboxStyles(),this.shadow.appendChild(this.inbox)))}addMsgsToInboxFromLS(){const e=this.deleteExpiredAndGetUnexpiredMsgs(!1),t=e?Object.keys(e):[];0!==t.length&&(t.forEach((t=>{e[t].viewed||(this.unviewedMessages[t]=e[t],this.unviewedCounter++)})),this.buildUIForMessages(e),this.updateUnviewedBadgeCounter())}deleteExpiredAndGetUnexpiredMsgs(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Vt();const i=Math.floor(Date.now()/1e3);for(const o in t)if(t[o].wzrk_ttl&&t[o].wzrk_ttl>0&&t[o].wzrk_ttl0&&(t=Object.values(t).sort(((e,t)=>t.date-e.date)).reduce(((e,t)=>(e[t.id]=t,e)),{})),Wt(t),t}updateInboxMessages(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.deleteExpiredAndGetUnexpiredMsgs(),i=Date.now(),o={};e.forEach(((e,n)=>{const s="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=s,e.date=i-n,e.viewed=0,t[s]=e,o[s]=e,this.unviewedMessages[s]=e,this.unviewedCounter++})),Wt(t),this.buildUIForMessages(o),this.updateUnviewedBadgeCounter()}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}addUnviewedBadge(){this.unviewedBadge||(this.unviewedBadge=this.createEl("div","unviewedBadge"),this.unviewedBadge.style.cssText="display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ".concat(this.config.styles.notificationsBadge.backgroundColor,"; font-size: 12px; color: ").concat(this.config.styles.notificationsBadge.textColor,"; font-weight: bold; align-items: center; justify-content: center;"),document.body.appendChild(this.unviewedBadge)),this.updateUnviewedBadgePosition(),window.addEventListener("resize",(()=>{this.updateUnviewedBadgePosition()}))}updateUnviewedBadgePosition(){const{top:e,right:t}=this.inboxSelector.getBoundingClientRect();this.unviewedBadge.style.top="".concat(e-8,"px"),this.unviewedBadge.style.left="".concat(t-8,"px")}createinbox(){this.inbox=this.createEl("div","inbox");const e=this.createEl("div","header"),t=this.createEl("div","headerTitle");t.innerText=this.config.title;const i=this.createEl("div","closeInbox");if(i.innerHTML="×",e.appendChild(t),e.appendChild(i),this.inbox.appendChild(e),this.config.categories.length){const e=this.createCategories();this.inbox.appendChild(e)}this.inboxCard=this.createEl("div","inboxCard"),this.inbox.appendChild(this.inboxCard),this.emptyInboxMsg=this.createEl("div","emptyInboxMsg"),this.emptyInboxMsg.innerText="All messages will be displayed here.",this.inboxCard.appendChild(this.emptyInboxMsg);const o={root:this.inboxCard,rootMargin:"0px",threshold:.5};this.observer=new IntersectionObserver(((e,t)=>{this.handleMessageViewed(e)}),o),this.addMsgsToInboxFromLS()}createCategories(){const e=this.createEl("div","categoriesContainer"),t=this.createEl("div","leftArrow");t.innerHTML=$t,t.children[0].style="transform: rotate(180deg)",t.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(-70,0)})),e.appendChild(t);const i=this.createEl("div","categoriesWrapper");["All",...this.config.categories].forEach(((e,t)=>{const o=this.createEl("div","category-".concat(t),"category");o.innerText=e,0===t&&(this.selectedCategoryRef=o),i.appendChild(o)})),e.appendChild(i);const o=this.createEl("div","rightArrow");o.innerHTML=$t,o.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(70,0)})),e.appendChild(o);const n={root:e,threshold:.9},s=i.children[0],r=i.children[this.config.categories.length];new IntersectionObserver((e=>{this.categoryObserverCb(t,e[0].intersectionRatio>=.9)}),n).observe(s);return new IntersectionObserver((e=>{this.categoryObserverCb(o,e[0].intersectionRatio>=.9)}),n).observe(r),e}categoryObserverCb(e,t){e&&(e.style.display=t?"none":"flex")}updateActiveCategory(e){this.selectedCategory=e,this.inboxCard.scrollTop=0;let t=0;this.prevCategoryRef&&this.prevCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef.setAttribute("selected","true"),this.inboxCard.childNodes.forEach((e=>{"emptyInboxMsg"!==e.getAttribute("id")&&(e.style.display="All"===this.selectedCategory||e.getAttribute("category")===this.selectedCategory?"block":"none","block"===e.style.display&&t++)})),0===t?(this.emptyInboxMsg.innerText="".concat(e," messages will be displayed here."),this.emptyInboxMsg.style.display="block"):this.emptyInboxMsg.style.display="none"}buildUIForMessages(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!this.isPreview&&this.updateTSForRenderedMsgs(),this.inboxCard.scrollTop=0;const i=null!==(e=this.config.maxMsgsInInbox)&&void 0!==e?e:15,o=this.inboxCard.firstChild,n=Object.values(t).sort(((e,t)=>t.date-e.date)).map((e=>e.id));for(const e of n){const i=new Nt(this.config,t[e]);i.setAttribute("id",t[e].id),i.setAttribute("pivot",t[e].wzrk_pivot),i.setAttribute("part","ct-inbox-message"),this.config.categories.length>0?(i.setAttribute("category",t[e].tags[0]||""),i.style.display="All"===this.selectedCategory||t[e].category===this.selectedCategory?"block":"none"):i.style.display="block",this.inboxCard.insertBefore(i,o),this.observer.observe(i)}let s=this.inboxCard.querySelectorAll("ct-inbox-message").length;for(;s>i;){const e=this.inboxCard.querySelectorAll("ct-inbox-message");e.length>0&&e[e.length-1].remove(),s--}const r=this.inboxCard.querySelectorAll('ct-inbox-message[style*="display: block"]').length;this.emptyInboxMsg.style.display=r?"none":"block"}handleMessageViewed(e){const t=!this.isPreview;this.isInboxOpen&&e.forEach((e=>{e.isIntersecting&&this.unviewedMessages.hasOwnProperty(e.target.id)&&0===e.target.message.viewed&&(e.target.message.viewed=1,t?(window.clevertap.renderNotificationViewed({msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.updateMessageInLS(e.target.id,{...e.target.message,viewed:1}),setTimeout((()=>{e.target.shadowRoot.getElementById("unreadMarker").style.display="none"}),1e3)):console.log("Notifiction viewed event will be raised at run time with payload ::",{msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.unviewedCounter--,this.updateUnviewedBadgeCounter(),delete this.unviewedMessages[e.target.id])}))}updateMessageInLS(e,t){if(!this.isPreview){const i=Vt();i[e]=t,Wt(i)}}toggleInbox(e){this.isInboxOpen=!this.isInboxOpen,this.isInboxFromFlutter=!!(null==e?void 0:e.rect),this.isInboxOpen?(this.inboxCard.scrollTop=0,!this.isPreview&&this.deleteExpiredAndGetUnexpiredMsgs(),this.inbox.style.display="block",this.inbox.style.zIndex="2147483647",this.config.categories.length&&(this.selectedCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef=this.shadowRoot.getElementById("category-0"),this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadowRoot.getElementById("categoriesWrapper").scrollLeft-=this.shadowRoot.getElementById("categoriesWrapper").scrollWidth),this.setInboxPosition(e)):this.inbox.style.display="none"}setInboxPosition(e){const t=window.outerWidth,i=getComputedStyle(ue.inbox),o=i.getPropertyValue("--inbox-top"),n=i.getPropertyValue("--inbox-bottom"),s=i.getPropertyValue("--inbox-left"),r=i.getPropertyValue("--inbox-right");if(t>481&&!(o||n||s||r)){const t=Gt(e,this.inbox.clientHeight,this.inbox.clientWidth),i=t.xPos,o=t.yPos;this.inbox.style.top=o+"px",this.inbox.style.left=i+"px"}}updateUnviewedBadgeCounter(){if(this.isPreview)return void this.setBadgeStyle(this.unviewedCounter);let e=0;this.inboxCard.querySelectorAll("ct-inbox-message").forEach((t=>{const i=Vt();i[t.id]&&0===i[t.id].viewed&&e++})),this.setBadgeStyle(e)}updateTSForRenderedMsgs(){this.inboxCard.querySelectorAll("ct-inbox-message").forEach((e=>{const t=e.id.split("_")[1];e.shadow.getElementById("timeStamp").firstChild.innerText=Jt(t)}))}getInboxStyles(){const e=this.config.categories.length?64:16,t={panelBackgroundColor:this.config.styles.panelBackgroundColor,panelBorderColor:this.config.styles.panelBorderColor,headerBackgroundColor:this.config.styles.header.backgroundColor,headerTitleColor:this.config.styles.header.titleColor,closeIconColor:this.config.styles.closeIconColor,categoriesTabColor:this.config.styles.categories.tabColor,categoriesTitleColor:this.config.styles.categories.titleColor,selectedCategoryTabColor:this.config.styles.categories.selectedTab.tabColor,selectedCategoryTitleColor:this.config.styles.categories.selectedTab.titleColor,headerCategoryHeight:36+e};this.config.styles.categories.borderColor&&(t.categoriesBorderColor=this.config.styles.categories.borderColor),this.config.styles.categories.selectedTab.borderColor&&(t.selectedCategoryBorderColor=this.config.styles.categories.selectedTab.borderColor);const i=(e=>{let{panelBackgroundColor:t,panelBorderColor:i,headerBackgroundColor:o,headerTitleColor:n,closeIconColor:s,categoriesTabColor:r,categoriesTitleColor:a,categoriesBorderColor:l,selectedCategoryTabColor:d,selectedCategoryTitleColor:c,selectedCategoryBorderColor:h,headerCategoryHeight:u}=e;return'\n \n ")})(t),o=this.config.styles.cards;return i+(e=>{let{backgroundColor:t,borderColor:i,titleColor:o,descriptionColor:n,buttonColor:s,buttonTextColor:r,unreadMarkerColor:a}=e;return'\n \n ")})({backgroundColor:o.backgroundColor,borderColor:o.borderColor,titleColor:o.titleColor,descriptionColor:o.descriptionColor,buttonColor:o.buttonColor,buttonTextColor:o.buttonTextColor,unreadMarkerColor:o.unreadMarkerColor})}}const Ut=e=>{e.inbox_preview?ue.inbox.incomingMessagesForPreview=e.inbox_notifs:ue.inbox.incomingMessages=e},Ft=e=>{Ht(),ue.inbox=new zt({logger:e}),document.body.appendChild(ue.inbox)},qt=e=>{const t=he.readFromLSorCookie(V)||{};if(Object.keys(t).length>0&&Object.keys(t)[0].includes("_")){const i={};return i[e]=t,he.saveToLSorCookie(V,i),i}return t},Vt=()=>{const e=JSON.parse(decodeURIComponent(he.read(b)));if(!oe(e))return{};const t=qt(e);return t.hasOwnProperty(e)?t[e]:{}},Wt=e=>{const t=JSON.parse(decodeURIComponent(he.read(b)));if(!oe(t))return;const i={...qt(t),[t]:e};he.saveToLSorCookie(V,i)},Kt=e=>new Promise(((t,i)=>{if("complete"===document.readyState)Ft(e),t();else{const i=he.readFromLSorCookie(q)||{},o=()=>{null===ue.inbox&&Ft(e),t()};window.addEventListener("load",(()=>{if(document.getElementById(i.inboxSelector))o();else{let n=0;if(n<20){const s=setInterval((()=>{document.getElementById(i.inboxSelector)?(o(),clearInterval(s),t()):n>=20&&(clearInterval(s),e.debug("Failed to add inbox")),n++}),500)}}}))}})),Ht=()=>{void 0===customElements.get("ct-web-inbox")&&(customElements.define("ct-web-inbox",zt),customElements.define("ct-inbox-message",Nt))},Gt=(e,t,i)=>{const o=document.scrollingElement.scrollLeft,n=document.scrollingElement.scrollTop,s=window.innerWidth+o,r=window.innerHeight+n,a=e.rect||e.target.getBoundingClientRect(),l=a.x+o,d=a.y+n,c=a.left+o,h=a.right+o,u=a.top+n,p=a.bottom,g=a.height,v=a.width;let f,b,m=!1;const y=16;if(p+t<=r){const e=r-(p+t);b=e>=y?p+y:p+e}else if(u-t>=n){const e=u-t;b=e>=y?u-t-y:u-t-e}else m=!0,b=d+g/2-t/2,br&&(b=r-t);if(m){const e=h+i;if(e<=s){f=h+(e+y<=s?y:s-e)}else{const e=c-i;f=e-(e-y>=o?y:e-o)}}else f=l+v/2-i/2,fs&&(f=h-i>=o?h-i:s-i);return{xPos:f,yPos:b}},Jt=e=>{const t=Date.now();let i=Math.floor((t-e)/6e4);return i<5?"Just now":i<60?"".concat(i," minute").concat(i>1?"s":""," ago"):(i=Math.floor(i/60),i<24?"".concat(i," hour").concat(i>1?"s":""," ago"):(i=Math.floor(i/24),"".concat(i," day").concat(i>1?"s":""," ago")))},Zt=()=>Object.keys(he.readFromLSorCookie(q)||{}).length>0,$t='\n\n\n',Yt='\n\n\n',Qt="https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/overlay.js",Xt="https://d2r1yp2w7bby2u.cloudfront.net/js/lib-overlay/style.css",ei=e=>{var t,i;e.data&&e.data.message&&("Dashboard"===e.data.message&&e.data.url?ti(e.data.url,null!==(t=e.data.variant)&&void 0!==t?t:null,null!==(i=e.data.details)&&void 0!==i?i:{}):"Overlay"===e.data.message&&oi(e.data,!0))},ti=(e,t,i)=>{document.addEventListener("DOMContentLoaded",(()=>function(e,t,i){document.body.innerHTML="",ii=document.createElement("div"),ii.id="overlayDiv",ii.style.position="relative",ii.style.display="flex",document.body.appendChild(ii);(function(e,t,i,o){return new Promise(((n,s)=>{var r=document.createElement("script");r.type="module",r.src=e,r.onload=function(){"function"==typeof window.Overlay?(window.Overlay({id:"#overlayDiv",url:t,variant:i,details:o}),n()):s(new Error("ContentLayout not found in overlay.js"))},r.onerror=function(e){s(e)},document.head.appendChild(r)}))})(Qt,e,t,i).then((()=>{console.log("Overlay script loaded successfully.")})).catch((e=>{console.error("Error loading overlay script:",e)})),o=document.createElement("link"),o.rel="stylesheet",o.type="text/css",o.href=Xt,document.head.appendChild(o),function(){const e={kitId:"eqj6nom",scriptTimeout:3e3,async:!0},t=document.documentElement,i=setTimeout((function(){t.className=t.className.replace(/\bwf-loading\b/g,"")+" wf-inactive"}),e.scriptTimeout),o=document.createElement("script");let n=!1;const s=document.getElementsByTagName("script")[0];let r;t.className+=" wf-loading",o.src="https://use.typekit.net/"+e.kitId+".js",o.async=!0,o.onload=o.onreadystatechange=function(){if(r=this.readyState,!(n||r&&"complete"!==r&&"loaded"!==r)){n=!0,clearTimeout(i);try{Typekit.load(e)}catch(e){}}},s.parentNode.insertBefore(o,s)}();var o}(e,t,i)))};let ii;const oi=(e,t)=>{const i=t?e.details[0]:e.display.details[0],o=Object.keys(i)[0],n=i[o];if(o===window.location.href.split("?")[0])for(const i in n){const o=document.querySelector(i);if(o)n[i].html?o.outerHTML=n[i].html:ni(e,n[i]),t||window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot});else{let o=0;const s=setInterval((()=>{const r=document.querySelector(i);r?(n[i].html?r.outerHTML=n[i].html:ni(e,n[i]),t||window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot}),clearInterval(s)):(o++,o>=20&&(console.log("No element present on DOM with selector '".concat(i,"'.")),clearInterval(s)))}),500)}}};function ni(e,t){const i={};i.msgId=e.wzrk_id,e.wzrk_pivot&&(i.pivotId=e.wzrk_pivot),null!=t.json&&(i.json=t.json);const o=new CustomEvent("CT_web_native_display_buider",{detail:i});document.dispatchEvent(o)}const si=e=>{const t=e.indexOf("